Exemple #1
0
    public void AddTask(behaviac.Agent agent, BehaviorTaskData behaviorTaskData)
    {
        if (agent == null)
        {
            return;
        }

        m_TaskTable.Add(agent.GetId(), behaviorTaskData);
    }
Exemple #2
0
    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}");
    }
Exemple #3
0
 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();
 }
Exemple #4
0
 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();
 }
Exemple #5
0
    public void RemoveAgent(behaviac.Agent agent)
    {
        if (agent == null)
        {
            return;
        }

        if (m_AgentTable.ContainsKey(agent.GetId()))
        {
            m_AgentTable.Remove(agent.GetId());
        }
    }
Exemple #6
0
    /// <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);
    }
Exemple #7
0
    /// <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);
    }
Exemple #8
0
 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);
 }
Exemple #11
0
 protected override EBTStatus update_impl(Agent pAgent, EBTStatus childStatus)
 {
     ((ObjAgent)pAgent).SetCurBehavior(this.method_p0);
     return(EBTStatus.BT_SUCCESS);
 }
Exemple #12
0
 protected override EBTStatus update_impl(Agent pAgent, EBTStatus childStatus)
 {
     return(((ObjAgent)pAgent).PlayDeadAgeAction());
 }
Exemple #13
0
 public Vector3 predicateFirePoint(behaviac.Agent target)
 {
     return(Vector3.zero);
 }
Exemple #14
0
 protected override int GetFrames(Agent pAgent)
 {
     return((int)pAgent.GetVariable(775476708u));
 }
Exemple #15
0
 protected override EBTStatus update_impl(Agent pAgent, EBTStatus childStatus)
 {
     ((ObjAgent)pAgent).ShowHeadExclamationMark();
     return(EBTStatus.BT_SUCCESS);
 }
Exemple #16
0
 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;
		}
Exemple #19
0
 protected override EBTStatus update_impl(Agent pAgent, EBTStatus childStatus)
 {
     ((ObjAgent)pAgent).SetIsAttackByEnemyHero(this.method_p0);
     return(EBTStatus.BT_FAILURE);
 }
Exemple #20
0
 protected override void onexit(Agent pAgent, EBTStatus s)
 {
 }
Exemple #21
0
        protected override EBTStatus update_impl(Agent pAgent, EBTStatus childStatus)
        {
            uint variable = (uint)pAgent.GetVariable((uint)0x7e66728f);

            return(((ObjAgent)pAgent).IsAlive(variable));
        }
Exemple #22
0
 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);
 }
Exemple #27
0
        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);
 }
Exemple #29
0
 protected override EBTStatus update_impl(Agent pAgent, EBTStatus childStatus)
 {
     return(((ObjAgent)pAgent).RealUseSkill(this.method_p0));
 }
Exemple #30
0
 public override bool IsValid(Agent pAgent, BehaviorTask pTask)
 {
     return((pTask.GetNode() is behaviac.Action) && base.IsValid(pAgent, pTask));
 }