public void UpdateGridState() { currentCell.SetOccupyingObject(null); currentCell.state = CellState.open; //GridManager.Instance.gridState[currentIndex.x, currentIndex.y] = CellState.open; SetCurrentCell(); //Debug.Log(characterStats.characterName+" Grid State Updated"); }
public void SetCurrentCell() { SetCurrentIndex(); currentCell = mapAdapter.GetCellByIndex(currentIndex); currentCell.SetOccupyingObject(this.gameObject); CellState cellstate; if (gameObject.tag == "Player") { cellstate = CellState.occupiedParty; } else { cellstate = CellState.occupiedEnemy; } currentCell.state = cellstate; GridManager.Instance.gridState[currentIndex.x, currentIndex.y] = cellstate; }