private void SetPowerActive(bool active) { PowerUpPreset powerUpPreset = SphereManager.Instance.powerUpPresets.Where(item => item.powerUp == sphereStats.PowerUpUI.PowerUp) .FirstOrDefault(); powerUpPreset.button.interactable = active; }
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); }
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); } }
private void ResetButton(PowerUpPreset powerUpPreset) { powerUpPreset.timer = 0; buttonClock.fillAmount = 0; button.interactable = false; }