示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GameMode"/> class.
 /// </summary>
 public GameMode(Device Device)
 {
     this.Device      = Device;
     this.Time        = new Time();
     this.Random      = new Random();
     this.Office      = new Office();
     this.CityMap     = new CityMap(this);
     this.Puzzle      = new Puzzle(this);
     this.EnergyTimer = new EnergyTimer(this);
 }
示例#2
0
    void Start()
    {
        Time.timeScale = 1;
        weaponShopInfo = GameObject.Find("WeaponShoop").GetComponent <WeaponShop>();
        armourShopInfo = GameObject.Find("ArmourShop").GetComponent <Shop>();
        //money
        gold            = gold.GetComponent <Text>();
        crystals        = crystals.GetComponent <Text>();
        goldCostArUI    = goldCostArUI.GetComponent <Text>();
        crystalCostArUI = crystalCostArUI.GetComponent <Text>();
        goldCostWUI     = goldCostWUI.GetComponent <Text>();
        crystalCostWUI  = crystalCostWUI.GetComponent <Text>();
        //EnergyBar
        notEnoughtEnergy   = notEnoughtEnergy.GetComponent <Canvas>();
        energyBar          = energyBar.GetComponent <Image>();
        energyBarIndicator = energyBarIndicator.GetComponent <Text>();
        playerInfoMenu     = GameObject.Find("PlayerInfoMenu");
        playerInfoSC       = playerInfoMenu.GetComponent <PlayerINFOScript>();
        energyTimer        = GameObject.Find("EventSystem").GetComponent <EnergyTimer>();
        UpdateEnergyBar();


        //Canvases

        secondQuestionWeapon = secondQuestionWeapon.GetComponent <Canvas>();
        begginingMenu        = begginingMenu.GetComponent <Canvas>();
        mainMenu             = mainMenu.GetComponent <Canvas>();
        chaptersMenu         = chaptersMenu.GetComponent <Canvas>();
        levelMenu            = levelMenu.GetComponent <Canvas>();
        shopMenu             = shopMenu.GetComponent <Canvas>();
        armourMenu           = armourMenu.GetComponent <Canvas>();
        weaponMenu           = weaponMenu.GetComponent <Canvas>();
        //Buttons
        //shoping
        notEnoughMoney         = notEnoughMoney.GetComponent <Canvas>();
        notEnoughMoney.enabled = false;
        notEnoughMoneyText     = notEnoughMoneyText.GetComponent <Text>();
        //Enabling Menus
        notEnoughtEnergy.enabled     = false;
        begginingMenu.enabled        = true;
        mainMenu.enabled             = false;
        chaptersMenu.enabled         = false;
        levelMenu.enabled            = false;
        shopMenu.enabled             = false;
        armourMenu.enabled           = false;
        weaponMenu.enabled           = false;
        secondQuestion.enabled       = false;
        secondQuestionWeapon.enabled = false;
        // results level1
        timelevel1 = timelevel1.GetComponent <Text>();
    }
示例#3
0
    void Start()
    {
        energyTimer = GameObject.Find("EventSystem").GetComponent <EnergyTimer>();
        skin        = PlayerPrefs.GetInt("skin");
        weapon      = PlayerPrefs.GetInt("weapon");
        gold        = PlayerPrefs.GetInt("gold");
        crystals    = PlayerPrefs.GetInt("crystals");
        swords      = PlayerPrefs.GetInt("swords");

        level1BestTime = PlayerPrefs.GetFloat("Level1BestTime");
        energy         = PlayerPrefs.GetFloat("energy");
        // Energy restoring
        // Results
        finishScript = GameObject.Find("Finish").GetComponent <FinishScript>();
        //Level 2
        level2BestTime = PlayerPrefs.GetFloat("Level2BestTime");
    }