Ejemplo n.º 1
0
 void Start()
 {
     pickup       = this.GetComponent <PickUp>();
     iceCreation  = GameObject.Find("IceGenerator").GetComponent <IceCreation>();
     logicManager = GameObject.Find("LogicManager").GetComponent <LogicManager>();
     coolerObject = GameObject.Find("Cylinder");
     cooler       = coolerObject.transform;
     soundManager = GameObject.Find("SoundManager").GetComponent <SoundManager>();
 }
Ejemplo n.º 2
0
    void Start()
    {
        soundManager = GameObject.Find("SoundManager").GetComponent <SoundManager>();
        iceCreation  = GameObject.Find("IceGenerator").GetComponent <IceCreation>();
        logicManager = GameObject.Find("LogicManager").GetComponent <LogicManager>();
        coinManager  = GameObject.Find("CoinManager").GetComponent <CoinManager>();

        //Laden der Bereits vorhandenen Upgrades aus den PlayerPrefs
        if (PlayerPrefs.GetInt("UpgradeLevelCooling") == 1)
        {
            upgradeLevel = 1;
            blocks[0].SetActive(true);
            iceCreation.timeMax = 9;
            upgradeCost         = 20;
        }
        else if (PlayerPrefs.GetInt("UpgradeLevelCooling") == 2)
        {
            upgradeLevel = 2;
            blocks[1].SetActive(true);
            blocks[0].SetActive(true);
            iceCreation.timeMax           = 9;
            logicManager.addCoolingAmount = 7;
            upgradeCost = 30;
        }
        else if (PlayerPrefs.GetInt("UpgradeLevelCooling") == 3)
        {
            upgradeLevel = 3;
            blocks[2].SetActive(true);
            blocks[0].SetActive(true);
            blocks[1].SetActive(true);
            iceCreation.timeMax           = 8;
            logicManager.addCoolingAmount = 7;
            upgradeCost = 40;
        }
        else if (PlayerPrefs.GetInt("UpgradeLevelCooling") == 4)
        {
            upgradeLevel = 4;
            blocks[3].SetActive(true);
            blocks[0].SetActive(true);
            blocks[1].SetActive(true);
            blocks[2].SetActive(true);
            iceCreation.timeMax           = 8;
            logicManager.addCoolingAmount = 9;
            upgradeCost = 50;
        }
        else if (PlayerPrefs.GetInt("UpgradeLevelCooling") == 5)
        {
            upgradeLevel = 5;
            blocks[4].SetActive(true);
            blocks[0].SetActive(true);
            blocks[1].SetActive(true);
            blocks[2].SetActive(true);
            blocks[3].SetActive(true);

            iceCreation.timeMax           = 7;
            logicManager.addCoolingAmount = 10;
            upgradeCost = 0;
        }
        else
        {
            upgradeLevel = 0;
            upgradeCost  = 10;
        }
    }