public void AddTask(behaviac.Agent agent, BehaviorTaskData behaviorTaskData) { if (agent == null) { return; } m_TaskTable.Add(agent.GetId(), behaviorTaskData); }
public void AddSwitchCommandTable(behaviac.Agent agent, string relativePath) { if (agent == null || m_SwitchTreeCommandTable.ContainsKey(agent.GetId())) { return; } m_SwitchTreeCommandTable.Add(agent.GetId(), relativePath); LogFormat(agent, $"AddSwitchCommandTable relativePath:{relativePath}"); }
private void DispathcSwitchTreeCommand() { foreach (var item in m_SwitchTreeCommandTable) { behaviac.Agent agent = null; if (m_AgentTable.TryGetValue(item.Key, out agent)) { BehaviorManager.Instance.SwitchTree(agent, item.Value); } } m_SwitchTreeCommandTable.Clear(); }
private void DispatchTask() { foreach (var item in m_TaskTable) { behaviac.Agent agent = null; if (m_AgentTable.TryGetValue(item.Key, out agent)) { agent.FireEvent(item.Value.Name, item.Value.EventType); } } m_TaskTable.Clear(); }
public void RemoveAgent(behaviac.Agent agent) { if (agent == null) { return; } if (m_AgentTable.ContainsKey(agent.GetId())) { m_AgentTable.Remove(agent.GetId()); } }
/// <summary> /// 添加Agent /// </summary> /// <param name="agent"></param> public void AddAgent(behaviac.Agent agent) { if (agent == null) { return; } if (m_AgentTable.ContainsKey(agent.GetId())) { return; } m_AgentTable.Add(agent.GetId(), agent); }
/// <summary> /// 切换行为树 /// </summary> /// <param name="agent"></param> /// <param name="relativePath"></param> /// <returns></returns> public bool SwitchTree(behaviac.Agent agent, string relativePath) { if (agent == null) { return(false); } bool ret = agent.btload(relativePath); agent.btsetcurrent(relativePath); BehaviorManager.Instance.LogFormat(agent, string.Format($"switch to {relativePath}")); return(ret); }
protected override bool onenter(Agent pAgent) { return(true); }
protected override EBTStatus update_impl(Agent pAgent, EBTStatus childStatus) { ((ObjAgent)pAgent).PlayAnimation(this.method_p0, this.method_p1, this.method_p2, this.method_p3); return(EBTStatus.BT_SUCCESS); }
protected override int GetFrames(Agent pAgent) { return(1); }
protected override EBTStatus update_impl(Agent pAgent, EBTStatus childStatus) { ((ObjAgent)pAgent).SetCurBehavior(this.method_p0); return(EBTStatus.BT_SUCCESS); }
protected override EBTStatus update_impl(Agent pAgent, EBTStatus childStatus) { return(((ObjAgent)pAgent).PlayDeadAgeAction()); }
public Vector3 predicateFirePoint(behaviac.Agent target) { return(Vector3.zero); }
protected override int GetFrames(Agent pAgent) { return((int)pAgent.GetVariable(775476708u)); }
protected override EBTStatus update_impl(Agent pAgent, EBTStatus childStatus) { ((ObjAgent)pAgent).ShowHeadExclamationMark(); return(EBTStatus.BT_SUCCESS); }
protected override EBTStatus update_impl(Agent pAgent, EBTStatus childStatus) { ((ObjAgent)pAgent).NotifySelfCampSelfWillAttack(this.method_p0); return(EBTStatus.BT_SUCCESS); }
protected override int GetCount(Agent pAgent) { return(-1); }
protected override EBTStatus update_impl(Agent pAgent, EBTStatus childStatus) { int num = (int)pAgent.GetVariable(3103756267u); int num2 = 30; return (num > num2) ? EBTStatus.BT_SUCCESS : EBTStatus.BT_FAILURE; }
protected override EBTStatus update_impl(Agent pAgent, EBTStatus childStatus) { ((ObjAgent)pAgent).SetIsAttackByEnemyHero(this.method_p0); return(EBTStatus.BT_FAILURE); }
protected override void onexit(Agent pAgent, EBTStatus s) { }
protected override EBTStatus update_impl(Agent pAgent, EBTStatus childStatus) { uint variable = (uint)pAgent.GetVariable((uint)0x7e66728f); return(((ObjAgent)pAgent).IsAlive(variable)); }
protected override EBTStatus update_impl(Agent pAgent, EBTStatus childStatus) { return(((ObjAgent)pAgent).IsLadder()); }
protected override EBTStatus update_impl(Agent pAgent, EBTStatus childStatus) { return(((ObjAgent)pAgent).IsControlByHostPlayer()); }
protected override int GetWeight(Agent pAgent) { return(100); }
protected override EBTStatus update_impl(Agent pAgent, EBTStatus childStatus) { ((ObjAgent)pAgent).ClearHelpOther(); return(EBTStatus.BT_SUCCESS); }
protected override EBTStatus update_impl(Agent pAgent, EBTStatus childStatus) { ((ObjAgent)pAgent).TerminateMove(); return(EBTStatus.BT_SUCCESS); }
protected override EBTStatus update_impl(Agent pAgent, EBTStatus childStatus) { SkillSlotType variable = (SkillSlotType)((int)pAgent.GetVariable((uint)0x6c745b)); return(((ObjAgent)pAgent).SetSkill(variable)); }
protected override EBTStatus update_impl(Agent pAgent, EBTStatus childStatus) { return ((ObjAgent) pAgent).AbortCurUseSkillByType(this.method_p0); }
protected override EBTStatus update_impl(Agent pAgent, EBTStatus childStatus) { return(((ObjAgent)pAgent).RealUseSkill(this.method_p0)); }
public override bool IsValid(Agent pAgent, BehaviorTask pTask) { return((pTask.GetNode() is behaviac.Action) && base.IsValid(pAgent, pTask)); }