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); } } }
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; } }
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); } } }