示例#1
0
        private void UnpauseEntity(Entity entity)
        {
            TimeScaleComponent timeScaleComponent = entity.GetComponent <TimeScaleComponent>();
            AnimationComponent animationComponent = entity.GetComponent <AnimationComponent>();
            SkillComponent     skillComponent     = entity.GetComponent <SkillComponent>();

            Unpause(timeScaleComponent, animationComponent, skillComponent);
        }
示例#2
0
 private static void Unpause(TimeScaleComponent timeScaleComponent, AnimationComponent animationComponent,
                             SkillComponent skillComponent)
 {
     timeScaleComponent.Unpause();
     animationComponent.Animation.UnpauseAnimation();
     if (!timeScaleComponent.IsPaused)
     {
         skillComponent.Character.UnpauseForLockFrame();
     }
 }
示例#3
0
        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();
        }