void OnMouseUp() { playerScript.GeneratePathTo(posX, posY); playerScript.playerPath.RemoveAt(playerScript.playerPath.Count - 1); playerScript.target = this.gameObject; Destroy(GameObject.FindGameObjectWithTag("Marker")); Instantiate(playerScript.redMarker, mapScript.TileCoordToWorldCoord(posX, posY) + new Vector3(0, 0.2f, 0), Quaternion.identity); }
void OnMouseUp() { player.GeneratePathTo(x, y); Destroy(GameObject.FindGameObjectWithTag("Marker")); Instantiate(player.greenMarker, map.TileCoordToWorldCoord(x, y) + new Vector3(0, 0.2f, 0), Quaternion.identity); player.target = this.gameObject; }
void OnMouseUp() { Player PS = player.GetComponent <Player>(); PS.GeneratePathTo(x, y); PS.target = this.gameObject; PS.playerPath.RemoveAt(PS.playerPath.Count - 1); Destroy(GameObject.FindGameObjectWithTag("Marker")); Instantiate(PS.redMarker, map.TileCoordToWorldCoord(x, y) + new Vector3(0, 0.2f, 0), Quaternion.identity); }
void DebugLineController() { if (playerPath != null) { int currNode = 0; while (currNode < playerPath.Count - 1) { Vector3 start = mapScript.TileCoordToWorldCoord(playerPath[currNode].x, playerPath[currNode].y); Vector3 end = mapScript.TileCoordToWorldCoord(playerPath[currNode + 1].x, playerPath[currNode + 1].y); Debug.DrawLine(start, end, Color.green); currNode++; } } }