void captureTotem(float captureSpeed) { if (transform.rotation.eulerAngles.z < 359) { transform.Rotate(Vector3.forward * captureSpeed); } else if (_totemOfEagleCaptured == false) { System.Random rand = new System.Random(); _playerControler1.IncreseDamage(2); _playerControler2.IncreseDamage(2); Debug.Log("player damage = " + _playerControler2.DAMAGE); if (OnTotemCapured != null) { OnTotemCapured.Invoke(this, null); } if (OnEnableSpecialAbility != null) { OnEnableSpecialAbility.Invoke(this, rand.Next(1, 3)); } _totemOfEagleCaptured = true; StartCoroutine(DiscapturingTotem()); StartCoroutine(DisableSpecialAbility()); } }
public IEnumerator DisableSpecialAbility() { for (int i = 0; i < specialAbilityDuration; i++) { yield return(new WaitForSeconds(1)); } Debug.Log("SA disabled"); if (OnEnableSpecialAbility != null) { OnEnableSpecialAbility.Invoke(this, 0); } }