public override FSMBasic moveToNextState() { if (theEMY == null || theEMY.isAlive == false) { //Debug.Log ("attack to search"); FSM_Search search = new FSM_Search(); search.makeState(this.theMoveController, this.theAttackLlinkController, this.theAnimator, this.theThis); return(search); } if (this.theThis.transform.position.y < this.theEMY.transform.position.y - 0.75) { //Debug.Log ("attack to jump"); FSM_Jump jump = new FSM_Jump(); jump.makeState(this.theMoveController, this.theAttackLlinkController, this.theAnimator, this.theThis, this.theEMY); return(jump); } if (Vector3.Distance(this.theThis.transform.position, this.theEMY.transform.position) > this.theThis.theAttackAreaLength * 0.8f) { //Debug.Log ("attack to runafter"); FSM_RunAfter runafter = new FSM_RunAfter(); runafter.makeState(this.theMoveController, this.theAttackLlinkController, this.theAnimator, this.theThis, this.theEMY); return(runafter); } return(this); }
public override FSMBasic moveToNextState() { if (this.theThis.transform.position.y >= this.theEMY.transform.position.y - 0.75 || timer < 0) { //Debug.Log ("jump to runafter"); FSM_RunAfter runafter = new FSM_RunAfter(); runafter.makeState(this.theMoveController, this.theAttackLlinkController, this.theAnimator, this.theThis, this.theEMY); return(runafter); } return(this); }
public override FSMBasic moveToNextState() { if (this.theAim == null || this.theAim.isAlive == false) { //Debug.Log ("attack to search"); FSM_Search search = new FSM_Search(); search.makeState(this.theMoveController, this.theAnimator, this.theThis, null); return(search); } if (Vector3.Distance(this.theMoveController.transform.position, this.theAim.transform.position) > this.theAttackLength * 0.8f) { //Debug.Log ("attack to runafter"); FSM_RunAfter runafter = new FSM_RunAfter(); runafter.makeState(this.theMoveController, this.theAnimator, this.theThis, this.theAim); runafter.OnChangeToThisState(); return(runafter); } return(this); }
/// <summary> /// 强制显示生命条 /// </summary> public void GotAim() { if (!thethis.theBloodSlider) { thethis.MakeHpSlider(); } if (this.theStateNow is FSM_Search) { FSMBasic theStateNew = new FSM_RunAfter(); theStateNew.makeState(this.theMoveController, this.theAnimator, theStateNow.theThis, theStateNow.theAim); theStateNew.setArea(attackarea, searchArea); if (theStateNew != theStateNow) { OnStateChange(theStateNow, theStateNew); } theStateNow = theStateNew; } }