예제 #1
0
        internal void SetupCell(GameCellType type)
        {
            // var active = type != GameCellType.Empty;
            // cachedRenderer.enabled = active;
            //
            // if (active)
            // {
            //     cachedRenderer.material.color = type == GameCellType.Target ? Color.red : Color.green;
            // }

            Color color = Color.white;

            switch (type)
            {
            case GameCellType.Target:
                color = Color.red;
                break;

            case GameCellType.Snake:
                color = Color.green;
                break;
            }

            cachedRenderer.material.color = color;
        }
예제 #2
0
 public GameCell(int rowIndex,
                 int columnIndex,
                 GameCellType type   = GameCellType.None,
                 GameCellColor color = GameCellColor.None,
                 IGameCell bindCell  = null)
 {
     Row      = rowIndex;
     Column   = columnIndex;
     Type     = type;
     Color    = color;
     BindCell = bindCell;
 }
예제 #3
0
 public GameGridCell(int x, int y, GameCellType type)
 {
     X    = x;
     Y    = y;
     Type = type;
 }
예제 #4
0
 public GameGridCell(int x, int y)
 {
     X    = x;
     Y    = y;
     Type = GameCellType.Empty;
 }
예제 #5
0
 public GameCell(Vector2 position, GameCellType type)
 {
     Position = position;
     Type     = type;
 }