Exemplo n.º 1
0
    void OnClickListener()
    {
        PlanetSpawner planetSpawner = GameObject.Find("PlanetSpawner").GetComponent <PlanetSpawner>();

        if (detailsScript.universalPopulation >= detailsScript.planetSpawnThreshold)
        {
            gameObject.GetComponent <AudioSource>().Play(0);
            planetSpawner.CreateNewPlanet();
            detailsScript.planetSpawnThreshold *= generalData.planetSpawnThresholdScale;
        }
    }
Exemplo n.º 2
0
    void EndAnimation()
    {
        newLvlClicked                     = false;
        detailsObj.ActivePlanetId         = 0;
        detailsObj.popFromPreviousSystems = detailsObj.universalPopulation;
        PlanetSpawner planetSpawner = GameObject.Find("PlanetSpawner").GetComponent <PlanetSpawner>();

        planetSpawner.numPlanetsSpawned = 0;
        planetSpawner.CreateNewPlanet();
        detailsObj.CreateStar();
        detailsObj.ActivateSpawnPlanetUpgrade();
        foreach (var go in openPanelsBeforeNewLvl)
        {
            if (go != null)
            {
                go.SetActive(true);
            }
        }

        if (detailsObj.level == 2)
        {
            investScience.SetActive(true);
        }

        // change upgrade to level 3 for future versions of game
        if (detailsObj.level == 2)
        {
            clonePanel.SetActive(true);
        }

        if (clonePanel.activeSelf)
        {
            clonePanel.GetComponent <ClonePanel>().cloningPossibleBasedOnPop = true;
            GameObject.Find("CloneResult").GetComponent <Text>().text        = "Try cloning your people!";
        }
    }