Пример #1
0
    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);
            }
        }
    }
Пример #2
0
    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);
    }
Пример #3
0
	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);
	}