protected virtual void OnChangeState(int i) { if (colliderAnimation != null) { EiTimer.Stop(colliderAnimation); colliderAnimation = null; } if (isCrouched && i == 0) { Movement.SetFrozen(false); } isCrouched = i == 1; if (isCrouched) { Movement.SetFrozen(true); colliderAnimation = EiTimer.Animate(crouchDelay, AnimateCrouch); SubscribeFixedUpdate(); } else { if (i == 0 && fixedUpdateNode != null) { colliderAnimation = EiTimer.Animate(crouchDelay, AnimateStandup); } UnsubscribeFixedUpdate(); } }
void OnDeathCallback() { EiTimer.Once(timeBeforeDestroy, DestroyThis); }