Пример #1
0
    public void UpdateOnPlay()
    {
        if (showSmallMenu)
        {
            smallMenu.Update(selectedWeapon.toInt());
            smallMenu.menuArea.AdjustToSquare();
        }

        if (ButtonManager.GetDown(ButtonManager.ButtonID.L1, this))
        {
            smallMenu.menuArea.Grow(true);
            showSmallMenu = true;
            manager.Slow(0.1f);
        }

        if (ButtonManager.GetUp(ButtonManager.ButtonID.L1, this))
        {
            smallMenu.menuArea.Reduce(() =>
            {
                showSmallMenu = false;
                manager.Slow(1f);
                SetSelectedWeapon((Commandments.Weapon)smallMenu.menuIndex.Get());
            });
        }

        //if (Input.GetButtonDown("ADDWEAPON"))
        //{
        //    Commandments.ZodiacAnimal animal = (Commandments.ZodiacAnimal)Random.Range(1, 12);
        //    manager.ActivateWeapon(animal);
        //    weaponFullSize.StartGrowing();
        //    weaponFullSize.StartMoveFrom(new Vector2(0, 1));
        //}
    }
    /// <summary>
    /// Function to initialize some internal properties. Should be called in Start()
    /// </summary>
    public void Init(int weaponsSize, Commandments.Weapon selectedWeapon)
    {
        base.Init(new CircularIndex(weaponsSize));

        gameManager = GameManager.GetInstance();
        uiManager   = UIManager.GetInstance();
        weapons     = uiManager.weapon;

        elementContent.SetParent(onPlay);

        if (weaponsSize > 0)
        {
            selectedImage = new BlinkTexture(weapons.GetWeapon(selectedWeapon).elementActivated, blinkControl);
            menuIndex.Set(selectedWeapon.toInt());
        }

        onPlay.AdjustToSquare();
        onPause.AdjustToSquare();

        weaponPauseBGArea.SetParent(onPause);
        weaponPauseArea.SetParent(weaponPauseBGArea);
        pauseBG.SetParent(onPause);
    }
 public void ChangeWeaponIndex(Commandments.Weapon weapon)
 {
     menuIndex.Set(weapon.toInt());
     selectedImage = new BlinkTexture(weapons.GetWeapon(weapon).elementActivated, blinkControl);
 }