public void OnInvincible(float invincibleTime) { Time.timeScale = 1.2f; setInvincible(true); MobileInputHandler.EnableInput(true); System.Action functionToCall = () => ResetInvincibleState(); MyMath.StopCalledFunction(this, functionRoutine); MyMath.RunFunctionAfter(functionToCall, this, invincibleTime, out functionRoutine); }
public void OnlevelRestarted() { GetComponent <RagdollController>().EnableRagdoll(false); if (GetComponent <Rigidbody>()) { GetComponent <Rigidbody>().isKinematic = false; } MobileInputHandler.EnableInput(true); anim.speed = 1; Invincible = false; }
public void OnLevelComplete() { UnSubscribeFromEvent(); // do stuff when level completes if (GetComponent <Rigidbody>()) { GetComponent <Rigidbody>().isKinematic = true; } MobileInputHandler.EnableInput(false); }
public void OnFreezed() { if (IsPlayerInvincible()) { ApplyInvincibleStateAbility(); return; } rb.isKinematic = true; anim.speed = 0; MobileInputHandler.EnableInput(false); rb.isKinematic = false; }
public void OnBombed() { if (IsPlayerInvincible()) { ApplyInvincibleStateAbility(); return; } MobileInputHandler.EnableInput(false); onBombedListeners?.Invoke(); LevelManager.Instance.OnPlayerDied(); ragdoll_rb.AddExplosionForce(30000, transform.position, 50); }
public void OnLevelFailed() { // do stuff when level fails UnSubscribeFromEvent(); MobileInputHandler.EnableInput(false); }