Exemple #1
0
 public BT_While(BT_Node _c, BT_Node _p, IfEvent _e)
 {
     children = new List <BT_Node>();
     children.Add(_c);
     parent    = _p;
     condition = _e;
 }
    protected IfEvent UnityEvent2IfEvent(UnityEngine.Events.UnityEvent e)
    {
        object target = e.GetPersistentTarget(0);
        Type   t      = target.GetType();

        System.Reflection.MethodInfo mi = t.GetMethod(e.GetPersistentMethodName(0));
        IfEvent ie = () => {
            object o = mi.Invoke(target, new object[] {});
            return((bool)o);
        };

        return(ie);
    }
Exemple #3
0
 virtual public void SetCondition(IfEvent _e)
 {
     condition = _e;
 }