how to use RunCoroutine in Unity 2D Gamekit Behavior Tree
public static class BT
{
public static Root Root() { return new Root(); }
public static Sequence Sequence() { return new Sequence(); }
public static Selector Selector(bool shuffle = false) { return new Selector(shuffle); }
public static Action RunCoroutine(System.Func<IEnumerator<BTState>> coroutine) { return new Action(coroutine); }
public static Action Call(System.Action fn) { return new Action(fn); }
public static ConditionalBranch If(System.Func<bool> fn) { return new ConditionalBranch(fn); }
public static While While(System.Func<bool> fn) { return new While(fn); }
public static Condition Condition(System.Func<bool> fn) { return new Condition(fn); }
public static Repeat Repeat(int count) { return new Repeat(count); }
public static Wait Wait(float seconds) { return new Wait(seconds); }
public static Trigger Trigger(Animator animator, string name, bool set = true) { return new Trigger(animator, name, set); }
public static WaitForAnimatorState WaitForAnimatorState(Animator animator, string name, int layer = 0) { return new WaitForAnimatorState(animator, name, layer); }
public static SetBool SetBool(Animator animator, string name, bool value) { return new SetBool(animator, name, value); }
public static SetActive SetActive(GameObject gameObject, bool active) { return new SetActive(gameObject, active); }
public static WaitForAnimatorSignal WaitForAnimatorSignal(Animator animator, string name, string state, int layer = 0) { return new WaitForAnimatorSignal(animator, name, state, layer); }
public static Terminate Terminate() { return new Terminate(); }
public static Log Log(string msg) { return new Log(msg); }
public static RandomSequence RandomSequence(int[] weights = null) { return new BTAI.RandomSequence(weights); }
}
there is a function named RunCoroutine, but I can't find any example about how to do with it., public static class BT { public static Root Root() { return new Root(); } public static Sequence Sequence() { return new Sequence(); } public static Selector Selector(bool shuffle = false) { return new Selector(shuffle); } public static Action RunCoroutine(System.Func coroutine) { return new Action(coroutine); } public static Action Call(System.Action fn) { return new Action(fn); } public static ConditionalBranch If(System.Func fn) { return new ConditionalBranch(fn); } public static While While(System.Func fn) { return new While(fn); } public static Condition Condition(System.Func fn) { return new Condition(fn); } public static Repeat Repeat(int count) { return new Repeat(count); } public static Wait Wait(float seconds) { return new Wait(seconds); } public static Trigger Trigger(Animator animator, string name, bool set = true) { return new Trigger(animator, name, set); } public static WaitForAnimatorState WaitForAnimatorState(Animator animator, string name, int layer = 0) { return new WaitForAnimatorState(animator, name, layer); } public static SetBool SetBool(Animator animator, string name, bool value) { return new SetBool(animator, name, value); } public static SetActive SetActive(GameObject gameObject, bool active) { return new SetActive(gameObject, active); } public static WaitForAnimatorSignal WaitForAnimatorSignal(Animator animator, string name, string state, int layer = 0) { return new WaitForAnimatorSignal(animator, name, state, layer); } public static Terminate Terminate() { return new Terminate(); } public static Log Log(string msg) { return new Log(msg); } public static RandomSequence RandomSequence(int[] weights = null) { return new BTAI.RandomSequence(weights); }
}
there is a function called RunCoroutine, But I can't find any examples about how to use it.