public void NodeClicked(NodePreview NP, bool unwalkable) { pathFinder.node[,] allMapNodes = newmap.GetMapNodes(); if (unwalkable) { if (allMapNodes [NP.row, NP.column].usageID != -1) { allMapNodes [NP.row, NP.column].usageID = -1; } else { allMapNodes [NP.row, NP.column].usageID = 0; } UpdateTestNodeState(); return; } if (NodePreview_1 == null) { NodePreview_1 = NP; return; } NodePreview_2 = NP; //GetPath (new Vector2(NodePreview_1.transform.position.x,NodePreview_1.transform.position.y) , new Vector2(NodePreview_2.transform.position.x,NodePreview_2.transform.position.y) ,true); NodePreview_1 = null; NodePreview_2 = null; }
private void CreatThisCart(int index) { Vector3 pos = new Vector3(ClickedNode.position.x, ClickedNode.position.y, 10); GameObject NewOBj = Instantiate(allCharsPrefabs[index], pos, allCharsPrefabs[index].transform.rotation) as GameObject; DefaultCard defaultcart = NewOBj.GetComponent <DefaultCard> (); defaultcart.SetInfo(ClickedNode.row, ClickedNode.column); ClickedNode.SetUsageID(index); SelectedNPList.Add(defaultcart); ClickedNode = null; }
public void tileClicked(NodePreview NP) { if (NP.column < 15) { return; } if (ClickedNode != null) { ClickedNode.SetColor(freeNodeColor); ClickedNode = null; return; } if (NP.usageID != -2) { return; } ClickedNode = NP; AllNodePreviews [ClickedNode.column, ClickedNode.row].SetColor(selectedNodeColor); }