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); }
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); }
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); }
protected override void OnEnter(BtWorkingData workData) { AIEntityWorkingData this_data = workData.As <AIEntityWorkingData>(); }