void Update() { TGMap tempMap = (TGMap)FindObjectOfType(typeof(TGMap)); CharacterManager tempCharacterManager = (CharacterManager)FindObjectOfType(typeof(CharacterManager)); if (prevSelectedTileIndex != selectedTileIndex) { myPathSearch.AStar(tempMap.tileDataMap.GetTile(tempCharacterManager.GetCurrentCharacterTileIndex()), tempMap.tileDataMap.GetTile(selectedTileIndex)); pathSolution = myPathSearch.GetSolution(); tempCharacterManager.SetCharacterPath(pathSolution); PathMarkerMaintence(); } }