public void NodeClicked(GraphNode gn) { if (!mship.IsOrbiting()) { return; } if (gn.tier > unlockedTier) { return; } if (gn == currentNode) { LoadWorld(); } foreach (GraphNode g in gn.neighbours) { if (g == currentNode) { mship.SetState(MshipState.TRAVEL, gn); SetCurrentNode(gn); } } }
void Start() { if (mc != null) { DestroyImmediate(gameObject); return; } mc = this; gg = Instantiate(generatorPrefab) as GraphGenerator; currentNode = gg.Generate(); if (storedNodeIndex != -1) { currentNode = gg.GetNode(storedNodeIndex); } currentNode.SetActive(true); Camera.main.transform.position = new Vector3(currentNode.transform.position.x, currentNode.transform.position.y, -20); mship = Instantiate(mshipprefab, currentNode.transform.position, Quaternion.identity) as MapMothership; mship.SetState(MshipState.ORBIT, currentNode); }
void Start() { if (mc != null) { DestroyImmediate (gameObject); return; } mc = this; gg = Instantiate (generatorPrefab) as GraphGenerator; currentNode = gg.Generate (); if (storedNodeIndex != -1) { currentNode = gg.GetNode(storedNodeIndex); } currentNode.SetActive (true); Camera.main.transform.position = new Vector3 (currentNode.transform.position.x, currentNode.transform.position.y, -20); mship = Instantiate(mshipprefab, currentNode.transform.position, Quaternion.identity) as MapMothership; mship.SetState(MshipState.ORBIT, currentNode); }