コード例 #1
0
 public override FSMBasic moveToNextState(FSMStage theContrtoller)
 {
     //找不到目标就继续找
     if (theMainEMY == null)
     {
         return(this);
     }
     //找到了目标就转到下一个状态
     else
     {
         //Debug.Log ("search to attack");
         FSMBasic attack = theContrtoller.getState(1);
         attack.makeState(this.theMoveController, this.theAttackLlinkController, this.theAnimator, this.theThis, this.theMainEMY);
         return(attack);
     }
 }
コード例 #2
0
ファイル: FSM_RunAfter.cs プロジェクト: BXZR/Sword
    //AI最简单的群体行为操作
    //一人追杀则群体追杀
    public override void OnChangeToThisState()
    {
        //Debug.Log("all move ");
        Collider [] AIs = Physics.OverlapSphere(this.theThis.transform.position, 1.3f);
        for (int i = 0; i < AIs.Length; i++)
        {
            FSMStage theStage = AIs [i].GetComponent <FSMStage> ();
            if (AIs [i].tag == "AI" && theStage)
            {
                if (theStage.theStateNow == null)
                {
                    return;
                }

                //ID = 4表示还在search,这个时候应该把自己的敌人通知给身边的单位
                if (theStage.theStateNow.geID() == 4 || theStage.theStateNow.geID() == 2)
                {
                    FSM_RunAfter runafter = new FSM_RunAfter();
                    theStage.moveTotheState(runafter, this.theEMY);
                }
            }
        }
    }
コード例 #3
0
 public virtual FSMBasic moveToNextState(FSMStage theController)
 {
     return(this);
 }
コード例 #4
0
ファイル: FSMRenderSwitch.cs プロジェクト: BXZR/Sword
 void Start()
 {
     theStage = this.GetComponentInParent <FSMStage> ();
 }