public override TickResult Tick(AgentMemory am) { if (am.IsRunning(ID) == false) { am.SetInt(ID, "lastRunningNode", 0); am.StartRunning(ID); } for (int node = am.GetInt(ID, "lastRunningNode", 0); node < Children.Count; node++) { TickResult result = TickChild(Children[node], am); if (result == TickResult.Success) { // Sprawdzamy następny continue; } else if (result == TickResult.Running) { am.SetInt(ID, "lastRunningNode", node); return(result); } else { // Porażka lub błąd - zaczynamy od nowa am.StopRunning(ID); return(result); } } am.StopRunning(ID); return(TickResult.Success); }
public override TickResult Tick(AgentMemory agentMemory) { if (agentMemory.IsRunning(ID) == false) { agentMemory.SetInt(ID, "lastRunningNode", 0); agentMemory.StartRunning(ID); } for (int node = agentMemory.GetInt(ID, "lastRunningNode", 0); node < Children.Count; node++) { TickResult result = TickChild(Children[node], agentMemory); if (result == TickResult.Failure) { continue; } else if (result == TickResult.Running) { agentMemory.SetInt(ID, "lastRunningNode", node); return(result); } else { agentMemory.StopRunning(ID); return(result); } } agentMemory.StopRunning(ID); return(TickResult.Failure); }
public TickResult Tick(AgentMemory agentMemory) { agentMemory.ResetActiveNodesList(); agentMemory.ProcessTimers(agentMemory.DeltaTime); agentMemory.CurrentTree = this; TickResult result = Node.TickChild(Root, agentMemory); return(result); }
public override TickResult Tick(AgentMemory agentMemory) { TickResult result; do { result = TickChild(Child, agentMemory); }while (result == TickResult.Success || result == TickResult.Running); return(result); }
public override TickResult Tick(AgentMemory am) { for (int i = 0; i < Children.Count; i++) { TickResult result = TickChild(Children[i], am); if (result != TickResult.Success) { return(result); } } return(TickResult.Success); }
public override TickResult Tick(AgentMemory agentMemory) { TickResult result = TickChild(Child, agentMemory); if (result == TickResult.Failure) { return(TickResult.Success); } else if (result == TickResult.Success) { return(TickResult.Failure); } else { return(result); } }
public override TickResult Tick(AgentMemory agentMemory) { for (int i = 0; i < Children.Count; i++) { TickResult result = TickChild(Children[i], agentMemory); if (result == TickResult.Failure) { continue; } else { return(result); } } return(TickResult.Failure); }
public override TickResult Tick(AgentMemory agentMemory) { if (agentMemory.IsRunning(ID) == false) { agentMemory.SetFloat(ID, "timer", waitingTime); agentMemory.StartRunning(ID); } float timer = agentMemory.GetFloat(ID, "timer", 0f); timer -= agentMemory.DeltaTime; agentMemory.SetFloat(ID, "timer", timer); if (timer <= 0) { agentMemory.StopRunning(ID); return(TickResult.Success); } else { return(TickResult.Running); } }
public override TickResult Tick(AgentMemory agentMemory) { return(TickResult.Failure); }
public override TickResult Tick(AgentMemory am) { System.Diagnostics.Trace.WriteLine(message); return(TickResult.Success); }
public override TickResult Tick(AgentMemory agentMemory) { return(TickResult.Success); }