コード例 #1
0
        static bool phaseEqualsTweenTime(UnityPhase phase, TweenTime time)
        {
            switch (time)
            {
            case TweenTime.OnUpdate:
            case TweenTime.OnUpdateUnscaled:
                if (phase == UnityPhase.Update)
                {
                    return(true);
                }
                break;

            case TweenTime.OnLateUpdate:
            case TweenTime.OnLateUpdateUnscaled:
                if (phase == UnityPhase.LateUpdate)
                {
                    return(true);
                }
                break;

            case TweenTime.OnFixedUpdate:
                if (phase == UnityPhase.FixedUpdate)
                {
                    return(true);
                }
                break;

            default: throw new ArgumentOutOfRangeException();
            }
            return(false);
        }
コード例 #2
0
 public void FixedUpdate()
 {
     phase = UnityPhase.FixedUpdate;
     onFixedUpdate.runOn(Time.fixedDeltaTime);
 }
コード例 #3
0
 public void LateUpdate()
 {
     phase = UnityPhase.LateUpdate;
     onLateUpdate.runOn(Time.deltaTime);
     onLateUpdateUnscaled.runOn(Time.unscaledDeltaTime);
 }