示例#1
0
    private void SetPowerActive(bool active)
    {
        PowerUpPreset powerUpPreset = SphereManager.Instance.powerUpPresets.Where(item => item.powerUp == sphereStats.PowerUpUI.PowerUp)
                                      .FirstOrDefault();

        powerUpPreset.button.interactable = active;
    }
示例#2
0
    public void ResetPowerUp()
    {
        buttonClock.color = Color.white;
        PowerUpPreset POPreset = SphereManager.Instance.powerUpPresets.Where(item => item.button == button)
                                 .FirstOrDefault();

        ResetButton(POPreset);

        GameSphere SphereReset = SphereManager.Instance.spheres.Where(item => item.sphereStats.PowerUpUI.PowerUp == powerUp)
                                 .FirstOrDefault();

        ResetSphere(SphereReset);
    }
示例#3
0
 private void CheckForPowerUp()
 {
     if (sphereStats.PowerUpUI.sphereClock.fillAmount < 1)
     {
         sphereStats.PowerUpUI.sphereClock.fillAmount += Time.deltaTime * SphereManager.Instance.powerUpGainSpeed;
         if (sphereStats.SphereOwner == SphereOwner.player)
         {
             PowerUpPreset preset = SphereManager.Instance.powerUpPresets.Where(item => item.powerUp == sphereStats.PowerUpUI.PowerUp)
                                    .FirstOrDefault();
             preset.buttonFill.fillAmount += Time.deltaTime * SphereManager.Instance.powerUpGainSpeed;
         }
     }
     else if (!sphereStats.PowerUpUI.PowerActive && sphereStats.SphereOwner == SphereOwner.player)
     {
         sphereStats.PowerUpUI.PowerActive = true;
         PowerUpPreset preset = SphereManager.Instance.powerUpPresets.Where(item => item.powerUp == sphereStats.PowerUpUI.PowerUp)
                                .FirstOrDefault();
         preset.buttonFill.color = Color.blue;
         Debug.Log("preset button is: " + preset.buttonFill.gameObject.name);
     }
 }
示例#4
0
 private void ResetButton(PowerUpPreset powerUpPreset)
 {
     powerUpPreset.timer    = 0;
     buttonClock.fillAmount = 0;
     button.interactable    = false;
 }