示例#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);
        }
示例#2
0
 public abstract void OnFixedUpdate(UnitEntityBase role);
示例#3
0
 public abstract void Exit(UnitEntityBase role);
示例#4
0
 public abstract void Execute(UnitEntityBase role, object param);
示例#5
0
 public abstract void Enter(UnitEntityBase role, double duration, object param);
示例#6
0
 public override void OnFixedUpdate(UnitEntityBase role)
 {
 }
示例#7
0
 /// <summary>
 /// 设置AI的主体,一直持续到End()
 /// </summary>
 /// <param name="role"></param>
 public void SetAISubject(UnitEntityBase role)
 {
     unitEntity = role;
 }
示例#8
0
 public override void Exit(UnitEntityBase role)
 {
 }
示例#9
0
 public override void Execute(UnitEntityBase role, object param)
 {
 }
示例#10
0
 public override void Enter(UnitEntityBase role, double duration, object param)
 {
     role.AnimaControl.UnitPlayAnima("run", false /*, speed*/);
 }
示例#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;
        }