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

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

            Instance.DelaySequences.Insert(0, sequence);
            Instance.RaiseOnDelayEventsChanged();
        }
Example #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);
         }
     }));
 }
Example #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();
            }
        }
Example #6
0
 public static void Add(DelaySequence sequence)
 {
     Instance.DelaySequences.Insert(0, sequence);
     Instance.RaiseOnDelayEventsChanged();
 }
Example #7
0
 public FrameDelay(int frameCount, DelaySequence sequence) : base(sequence)
 {
     m_GoFrame = Time.frameCount + frameCount;
 }
Example #8
0
 public TimeDelay(float delay, DelaySequence sequence) : base(sequence)
 {
     m_StartTime = sequence.CurrentTime;
     m_Delay     = delay;
 }
Example #9
0
 public WaitDelay(Func <bool> test, float timeOut, DelaySequence sequence) : base(sequence)
 {
     m_Test      = test;
     m_StartTime = sequence.CurrentTime;
     m_TimeOut   = timeOut;
 }
Example #10
0
 public WaitDelay(Func <bool> test, DelaySequence sequence) : this(test, -1, sequence)
 {
 }
Example #11
0
 public ManualDelay(DelaySequence sequence) : base(sequence)
 {
 }