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; }
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; }
public GameGridCell(int x, int y, GameCellType type) { X = x; Y = y; Type = type; }
public GameGridCell(int x, int y) { X = x; Y = y; Type = GameCellType.Empty; }
public GameCell(Vector2 position, GameCellType type) { Position = position; Type = type; }