/* http://www.cgsoso.com/forum-211-1.html CG搜搜 Unity3d 每日Unity3d插件免费更新 更有VIP资源! CGSOSO 主打游戏开发,影视设计等CG资源素材。 插件如若商用,请务必官网购买! daily assets update for try. U should buy the asset from home store if u use it in your project! */ using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; [Serializable] //public class PipeSprites //{ // public List sprites; //} public class Cell : MonoBehaviour { public Vector2Int pos; public PipeColor defaultColor; public int rightRotationValue; [Header("PipeDetail")] public RectTransform pipeParent; public CellType pipeCellType; public List pipes; public List pipeSprites; //public List _PipeSprites; public int correctRotateDelta = 4; [HideInInspector] public bool redundant; private bool _isHint; public int _rotationValue; private object pipe; public CellKind cellKind; public bool IsHint { get { return _isHint; } set { if (value) { RotationValue = rightRotationValue; ApplyRotationOnImage(0.05f); GetComponent().color = ColorManager.intance.hintCellBGColor; } else { GetComponent().color = ColorManager.intance.normalCellBGColor; } _isHint = value; } } public int RotationValue { get { return _rotationValue; } set { if (!IsHint) { int num = (value < 4) ? value : 0; num = (_rotationValue = ((num >= 0) ? num : 3)); pipes.ForEach(delegate (Pipe obj) { obj.SetPipeRotation(_rotationValue); SetCellFlowSide(cellKind); }); } } } public Cell RightCell { get { Vector2Int v = pos + Vector2Int.right; if (!IsValidIndex(v)) { return null; } return GetCellFromVector(v); } } public Cell LeftCell { get { Vector2Int v = pos + Vector2Int.left; if (!IsValidIndex(v)) { return null; } return GetCellFromVector(v); } } public Cell TopCell { get { Vector2Int v = pos + Vector2Int.down; if (!IsValidIndex(v)) { return null; } return GetCellFromVector(v); } } public Cell BottomCell { get { Vector2Int v = pos + Vector2Int.up; if (!IsValidIndex(v)) { return null; } return GetCellFromVector(v); } } public void SetLevelData(LevelCellData lcd) { defaultColor = lcd.DefaultColor; if (pipeCellType != 0) { GetComponent