// Update is called once per frame void Update() { bool BlueActive = Input.GetMouseButton(0); bool RedActive = Input.GetMouseButton(1); if (BlueActive) { BlueForceField.SetActive(true); RedForceField.SetActive(false); OnCast?.Invoke(); return; } if (RedActive) { BlueForceField.SetActive(false); RedForceField.SetActive(true); OnCast?.Invoke(); return; } OnStopCast?.Invoke(); BlueForceField.SetActive(false); RedForceField.SetActive(false); }
void ActivateAbility(int index) { if (available[index] && !gcd && player.GetCurrentMana() > abilities[index].GetCost()) { lastIndex = index; StartCoroutine(GlobalCooldown()); if (abilities[index].CastTime > 0f) // do not begin cast bar for instant cast abilities { casting = true; onCast?.Invoke(abilities[index].abilityName, abilities[index].CastTime, castingComplete); player.GetComponent <PlayerController>().MovementPaused(true); } else { CastingFinished(); } } }