コード例 #1
0
        protected override void OnEnter(BtWorkingData workData)
        {
            AIEntityWorkingData thisData = workData.As <AIEntityWorkingData>();
            UserContextData     userData = GetUserContextData <UserContextData>(workData);

            userData._attackingTime = DefaultWaitingTime;

            Debug.Log("进入攻击状态,设定Target");
            //this_data.EntityAnimator.CrossFade("attack", 0.2f);
        }
コード例 #2
0
        public BtEntityAi Init()
        {
            _behavior_tree = BtEntityFactory.GetBehaviorTreeDemo1();

            _behavior_working_data          = new AIEntityWorkingData();
            _behavior_working_data.EntityAi = this;
            _blackboard = new BtBlackBoard();

            _nexttime_to_gen_moving_target = 0;
            return(this);
        }
コード例 #3
0
        protected override int OnExecute(BtWorkingData workData)
        {
            AIEntityWorkingData thisData = workData.As <AIEntityWorkingData>();
            UserContextData     userData = GetUserContextData <UserContextData>(workData);

            if (userData._attackingTime > 0)
            {
                userData._attackingTime -= thisData.DeltaTime;
                if (userData._attackingTime <= 0)
                {
                    Debug.Log("再一次攻击");
                    //this_data.EntityAnimator.CrossFade(ending_anim[Random.Range(0, ending_anim.Length)], 0.2f);
                }
            }
            return(BtRunningStatus.EXECUTING);
        }
コード例 #4
0
 protected override void OnEnter(BtWorkingData workData)
 {
     AIEntityWorkingData this_data = workData.As <AIEntityWorkingData>();
 }