public override void Checkin(Machine machine, NodeFollower context) { if (stateMethods.ContainsKey(machine)) { stateMethods[machine](); } }
public override void OnEncountered(Node prevNode, Machine machine, NodeFollower context) { if (!Valid) { Debug.LogError("Encountered an invalid state! Check the referenced class exists and extends State"); } }
public override void OnEncountered(Node prevNode, Machine machine, NodeFollower context) { if (runOnEncounter) { Checkin(machine, context); } }
public override void Checkin(Machine machine, NodeFollower context) { if (followers[context].Active) { machine.UpdateCurrents(followers[context].Checkin()); } }
public override void OnRunEnd(Machine machine, NodeFollower context) { if (followers == null) { followers = new Dictionary <NodeFollower, NodeFollower>(); } followers.Remove(context); }
public override void OnEncountered(Node prevNode, Machine machine, NodeFollower context) { if (!Valid) { Debug.LogError("Encountered an invalid state! Check the referenced class exists and extends State"); return; } if (eventMethods.ContainsKey(machine)) { eventMethods[machine](); } }
public override void OnEncountered(Node prevNode, Machine machine, NodeFollower context) { if (!logProp) { Debug.Log(message); } else { try { Debug.Log(machine.name + " > " + propName + ": " + machine.GetProp(propName)); } catch (KeyNotFoundException) { Debug.LogError("Could not debug " + machine.name + " > " + propName + " - prop not found!"); } } }
public override void OnRunStart(Machine machine, NodeFollower context) { if (followers == null) { followers = new Dictionary <NodeFollower, NodeFollower>(); } if (!followers.ContainsKey(context)) { FunctionNode funcNode = machine._model.GetFunction(function); if (funcNode != null) { followers.Add(context, new NodeFollower(machine, funcNode, context, continuous)); } else { Debug.LogError("Attempted to run non-existent function " + function + "!"); } } }
// Update is called once per frame void FixedUpdate() { foreach (NodeFollower nf in waiting) { nf.deactivate = true; } if (waiting.Count == 1) { waiting[0].deactivate = false; } if (waiting.Count > 0) { if (waiting[0].stop) { NodeFollower bad = waiting[0]; waiting.Remove(waiting[0]); waiting.Add(bad); } else { waiting[0].deactivate = false; } } }
public override void OnEncountered(Node prevNode, Machine machine, NodeFollower context) { if (followers == null) { followers = new Dictionary <NodeFollower, NodeFollower>(); } if (!followers.ContainsKey(context)) { FunctionNode funcNode = machine._model.GetFunction(function); if (funcNode != null) { followers.Add(context, new NodeFollower(machine, funcNode, context, true)); } else { Debug.LogError("Attempted to run non-existent function " + function + "!"); } } if (followers[context].Active) { machine.UpdateCurrents(followers[context].Checkin()); } }
public override void Checkin(Machine machine, NodeFollower context) { }
public override void OnPassed(HashSet <Node> nextNodes, Machine machine, NodeFollower context) { triggered = false; }
// Use this for initialization void Start() { nf = control.GetComponent <NodeFollower>(); }
/// <summary> /// Triggered when this node is passed while the machine is searching for the next node. /// </summary> /// <remarks> /// Note: if the model does not support parallel flow, then only the first element of <c>nextNodes</c> will be followed. /// </remarks> public virtual void OnPassed(HashSet <Node> nextNodes, Machine machine, NodeFollower context) { }
public virtual void OnRunEnd(Machine machine, NodeFollower context) { }
public abstract void Checkin(Machine machine, NodeFollower context);
public override void OnEncountered(Node prevNode, Machine machine, NodeFollower context) { conditionMet = ConditionMet(machine); }
/// <summary> /// Triggered when this node is encountered while the machine is searching for the next node. /// </summary> public virtual void OnEncountered(Node prevNode, Machine machine, NodeFollower context) { }