public void createCorpse(Tiles loc) { Debug.Log("Corpse created"); Vector3 vectorLocation = tileManager.FindTile(loc); Vector3 change = vectorLocation - icon.transform.position; icon.transform.Translate(change); srenderer.enabled = true; }
public void SetLocation(Tiles loc) { Vector3 oldLocation = vectorLocation; location = loc; vectorLocation = tileManager.FindTile(location); pathfinder.grid.addWalkable(vectorLocation); pathfinder.grid.addWalkable(oldLocation); pathfinder.grid.setStartEndGH(oldLocation, vectorLocation); path = pathfinder.findPath(); pathfinder.grid.removeWalkable(oldLocation); pathfinder.grid.removeWalkable(vectorLocation); }