private void UnpauseEntity(Entity entity) { TimeScaleComponent timeScaleComponent = entity.GetComponent <TimeScaleComponent>(); AnimationComponent animationComponent = entity.GetComponent <AnimationComponent>(); SkillComponent skillComponent = entity.GetComponent <SkillComponent>(); Unpause(timeScaleComponent, animationComponent, skillComponent); }
private static void Unpause(TimeScaleComponent timeScaleComponent, AnimationComponent animationComponent, SkillComponent skillComponent) { timeScaleComponent.Unpause(); animationComponent.Animation.UnpauseAnimation(); if (!timeScaleComponent.IsPaused) { skillComponent.Character.UnpauseForLockFrame(); } }
private IEnumerator <float> PauseFor_(Entity entityToPause, float duration, Action onCompleted) { TimeScaleComponent timeScaleComponent = entityToPause.GetComponent <TimeScaleComponent>(); AnimationComponent animationComponent = entityToPause.GetComponent <AnimationComponent>(); SkillComponent skillComponent = entityToPause.GetComponent <SkillComponent>(); timeScaleComponent.Pause(); animationComponent.Animation.PauseAnimation(); if (timeScaleComponent.IsFirstPause()) { skillComponent.Character.PauseForLockFrame(); } yield return(Timing.WaitForSeconds(duration)); Unpause(timeScaleComponent, animationComponent, skillComponent); onCompleted(); }