private void Step() { AntCell antCell = grid[currentCellIndex.x, currentCellIndex.y]; if (antCell.isActive) { TurnLeft(); } else { TurnRight(); } antCell.StepOnCell(); }
private void Awake() { side = Side.Down; currentCellIndex.x = width / 2; currentCellIndex.y = height / 2; grid = new AntCell[width, height]; for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { AntCell cell = Instantiate(cellPrefab); cell.transform.position = EvaluateCellSize(i, j); cell.transform.SetParent(transform); cell.gameObject.name = $"{i} {j}"; grid[i, j] = cell; } } StartCoroutine(nameof(UpdareLife)); }