Exemplo n.º 1
0
        /// <summary>
        /// 结束行为创建
        /// </summary>
        /// <returns></returns>
        public YuAIBehaviorTree End()
        {
            while (behaviorNodes.Count > 0)
            {
                behaviorNodes.Pop();
            }
            YuAIBehaviorTree tree = new YuAIBehaviorTree(rootBehavior);

            //初始化行为树创建器
            unitEntity   = null;
            rootBehavior = null;

            return(tree);
        }
Exemplo n.º 2
0
 public abstract void OnFixedUpdate(UnitEntityBase role);
Exemplo n.º 3
0
 public abstract void Exit(UnitEntityBase role);
Exemplo n.º 4
0
 public abstract void Execute(UnitEntityBase role, object param);
Exemplo n.º 5
0
 public abstract void Enter(UnitEntityBase role, double duration, object param);
Exemplo n.º 6
0
 public override void OnFixedUpdate(UnitEntityBase role)
 {
 }
Exemplo n.º 7
0
 /// <summary>
 /// 设置AI的主体,一直持续到End()
 /// </summary>
 /// <param name="role"></param>
 public void SetAISubject(UnitEntityBase role)
 {
     unitEntity = role;
 }
Exemplo n.º 8
0
 public override void Exit(UnitEntityBase role)
 {
 }
Exemplo n.º 9
0
 public override void Execute(UnitEntityBase role, object param)
 {
 }
Exemplo n.º 10
0
 public override void Enter(UnitEntityBase role, double duration, object param)
 {
     role.AnimaControl.UnitPlayAnima("run", false /*, speed*/);
 }
Exemplo n.º 11
0
        protected bool m_isNegation = false;    //是否取反

        public void SetRoleAndIsNegation(UnitEntityBase unit, bool isNegation)
        {
            unitEntity   = unit;
            m_isNegation = isNegation;
        }
        //protected UnitEntityBase unit;    //行为主体

        public void SetRole(UnitEntityBase unitEntity)
        {
            //unit = unitEntity;
        }