// Use this for initialization void Start() { Debug.Log(Time.frameCount); var delayFrameAction = DelayFrameAction.Allocate(1, () => { Debug.Log(Time.frameCount); }); this.ExecuteNode(delayFrameAction); this.DelayFrame(2, (() => { Debug.Log(Time.frameCount); })); this.Sequence() .Event(() => Debug.Log(Time.frameCount)) .DelayFrame(2) .Event(() => Debug.Log(Time.frameCount)) .Begin(); this.NextFrame(() => { Debug.Log(Time.frameCount); }); }
public static IActionChain NextFrame(this IActionChain selfChain) { return(selfChain.Append(DelayFrameAction.Allocate(1))); }
public static IActionChain DelayFrame(this IActionChain selfChain, int frameCount) { return(selfChain.Append(DelayFrameAction.Allocate(frameCount))); }
public static void NextFrame <T>(this T selfBehaviour, System.Action nextFrameEvent) where T : MonoBehaviour { selfBehaviour.ExecuteNode(DelayFrameAction.Allocate(1, nextFrameEvent)); }
public static void DelayFrame <T>(this T selfBehaviour, int frameCount, System.Action delayFrameEvent) where T : MonoBehaviour { selfBehaviour.ExecuteNode(DelayFrameAction.Allocate(frameCount, delayFrameEvent)); }