public DelaySequence ThenWaitFor(Func <DelaySequence> subSequenceFunc, float timeout) { return(AddDelay(() => { DelaySequence subSequence = subSequenceFunc(); return new WaitDelay(() => subSequence.IsDone, timeout, this); })); }
protected BaseDelay(DelaySequence sequence) { if (!Application.isPlaying) { throw new DelayPromiseException("Delay system only works when the application is running!"); } m_Sequence = sequence; }
public static void Add(DelaySequence sequence) { if (!AppTracker.IsPlaying) { return; } Instance.DelaySequences.Insert(0, sequence); Instance.RaiseOnDelayEventsChanged(); }
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); } })); }
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(); } }
public static void Add(DelaySequence sequence) { Instance.DelaySequences.Insert(0, sequence); Instance.RaiseOnDelayEventsChanged(); }
public FrameDelay(int frameCount, DelaySequence sequence) : base(sequence) { m_GoFrame = Time.frameCount + frameCount; }
public TimeDelay(float delay, DelaySequence sequence) : base(sequence) { m_StartTime = sequence.CurrentTime; m_Delay = delay; }
public WaitDelay(Func <bool> test, float timeOut, DelaySequence sequence) : base(sequence) { m_Test = test; m_StartTime = sequence.CurrentTime; m_TimeOut = timeOut; }
public WaitDelay(Func <bool> test, DelaySequence sequence) : this(test, -1, sequence) { }
public ManualDelay(DelaySequence sequence) : base(sequence) { }