Ejemplo n.º 1
0
Archivo: Action.cs Proyecto: s76/testAI
        public override void Init(Reactor reactor)
        {
            base.Init(reactor);

            ComponentMethod cm = null;
            try {
                cm = reactor.FindMethod(actionMethod);
            } catch (ArgumentNullException e) {
                Debug.LogError("[Action Node] Could not find method :" + actionMethod + "\n" + NodeNamesInStack());
                throw e;
            }
            if(cm == null) {
                Debug.LogError("Could not load action method: " + actionMethod);
            } else {
                if(cm.methodInfo.ReturnType == typeof(IEnumerator<NodeResult>)) {
                    component = cm.component;
                    methodInfo = cm.methodInfo;
                    if( methodParams != null )
                    {
                        methodParams.ConvertParams(methodInfo);
                    }
                } else {
                    Debug.LogError("Action method has invalid signature: " + actionMethod);
                }
            }
        }
Ejemplo n.º 2
0
 public override void Init(Reactor reactor)
 {
     base.Init(reactor);
     var cm = reactor.FindMethod (functionName);
     if (cm == null) {
         Debug.LogError ("Could not load function method: " + functionName);
     } else {
         component = cm.component;
         methodInfo = cm.methodInfo;
     }
 }
Ejemplo n.º 3
0
Archivo: If.cs Proyecto: s76/testAI
 public override void Init(Reactor reactor)
 {
     base.Init(reactor);
     var cm = reactor.FindMethod(conditionMethod);
     if(cm == null) {
         Debug.LogError("Could not load condition method: " + conditionMethod);
     } else {
         if(cm.methodInfo.ReturnType == typeof(bool)) {
             component = cm.component;
             methodInfo = cm.methodInfo;
         } else {
             Debug.LogError("Condition method has invalid signature: " + conditionMethod);
         }
     }
 }