//ReportIfClicked tileScript; // Use this for initialization void Start() { GameObject playerObj = Instantiate(player, new Vector3(0, 0, 0), this.transform.rotation); playerMoveScript = playerObj.GetComponent <ClickToMoveAI>(); for (int x = 0; x < gridWidth; x++) { for (int z = 0; z < gridHeight; z++) { GameObject newTile = GameObject.Instantiate(tileTemplate); newTile.transform.position = new Vector3(x, 0, z); Node tileNode = new Node(newTile.transform.position); if (z == 0 && x == 0) { playerMoveScript.AIStartNode = tileNode; } print("Making node at: " + tileNode.position); nodesByPosition.Add(tileNode.position, tileNode); tilesToNode.Add(newTile, tileNode); nodesToTile.Add(tileNode, newTile); tiles.Add(newTile); nodesList.Add(tileNode); newTile.GetComponent <ReportIfClicked>().generatedTiles = this; } } //Debug.Log("nodesByPos count = " + nodesByPosition.Count); //Debug.Log("NodesByPos.Keys.Count: " + nodesByPosition.Keys.Count); //connections Debug.Log("making connections in start"); makeConnections(); //Debug.Log(weightedConnections.Count); }
// Use this for initialization void Start() { ai = GameObject.FindGameObjectWithTag("Player").GetComponent <ClickToMoveAI>(); }