示例#1
0
 public DelaySequence ThenWaitFor(Func <DelaySequence> subSequenceFunc, float timeout)
 {
     return(AddDelay(() => {
         DelaySequence subSequence = subSequenceFunc();
         return new WaitDelay(() => subSequence.IsDone, timeout, this);
     }));
 }
示例#2
0
            protected BaseDelay(DelaySequence sequence)
            {
                if (!Application.isPlaying)
                {
                    throw new DelayPromiseException("Delay system only works when the application is running!");
                }

                m_Sequence = sequence;
            }
示例#3
0
        public static void Add(DelaySequence sequence)
        {
            if (!AppTracker.IsPlaying)
            {
                return;
            }

            Instance.DelaySequences.Insert(0, sequence);
            Instance.RaiseOnDelayEventsChanged();
        }
示例#4
0
 public DelaySequence ThenWaitFor(Func <DelaySequence> subSequenceFunc)
 {
     return(AddDelay(() => {
         try {
             DelaySequence subSequence = subSequenceFunc();
             return new WaitDelay(() => subSequence.IsDone, this);
         }
         catch (Exception e) {
             Debug.LogException(e);
             return new TimeDelay(0, this);
         }
     }));
 }
示例#5
0
        protected void SetInternal(Action action)
        {
            if (m_DelaySequence != null)
            {
                m_DelaySequence.Cancel("Starting a new delay on SetAnimator", this);
            }

            if (m_Delay > 0)
            {
                m_DelaySequence = Delay.For(m_Delay, this).Then(action);
            }
            else
            {
                action();
            }
        }
示例#6
0
 public static void Add(DelaySequence sequence)
 {
     Instance.DelaySequences.Insert(0, sequence);
     Instance.RaiseOnDelayEventsChanged();
 }
示例#7
0
 public FrameDelay(int frameCount, DelaySequence sequence) : base(sequence)
 {
     m_GoFrame = Time.frameCount + frameCount;
 }
示例#8
0
 public TimeDelay(float delay, DelaySequence sequence) : base(sequence)
 {
     m_StartTime = sequence.CurrentTime;
     m_Delay     = delay;
 }
示例#9
0
 public WaitDelay(Func <bool> test, float timeOut, DelaySequence sequence) : base(sequence)
 {
     m_Test      = test;
     m_StartTime = sequence.CurrentTime;
     m_TimeOut   = timeOut;
 }
示例#10
0
 public WaitDelay(Func <bool> test, DelaySequence sequence) : this(test, -1, sequence)
 {
 }
示例#11
0
 public ManualDelay(DelaySequence sequence) : base(sequence)
 {
 }