// Start is called before the first frame update void Start() { gameController = GameController.instance; buildManager = BuildManager.instance; rend = GetComponent <SpriteRenderer>(); startColor = rend.material.color; nodesParent = GameObject.Find("Nodes").GetComponent <NodesParent>(); }
private NodeEntry AddNodeDisplay(NodeInfo nodeInfo, Node node, bool newlyCreated = false) { var entry = m_NodeEntryFactory.CreateNodeEntry(nodeInfo, node); var t = entry.transform; t.SetParent(NodesParent); if (newlyCreated) { var position = m_GraphContent.position; t.position = position; node.position = NodesParent.InverseTransformPoint(position); } else { t.localPosition = node.position; } t.localScale = Vector3.one; return(entry); }