Ejemplo n.º 1
0
 void Awake()
 {
     fightfsm = transform.GetComponent <com_FightFSM>();
     ap       = transform.GetComponent <AniPlayer>();
     ai_table = fightfsm.aiStateTable;
     table    = fightfsm.stateTable;
 }
Ejemplo n.º 2
0
        public Input_AI_Expand(Input_AI input, IBattleField battlefield, CharController_Direct _self, FB.FFSM.AI_StateTable table, AILevel aiLevel)
        {
            this.selfCC      = _self;
            this.battlefield = battlefield;
            this.input       = input;
            this.aiLevel     = aiLevel;
            this.ai_table    = table;
            //ai改变属性
            AILevelChange();

            vIdlePos = (battlefield as BattleField).GetRealChar(selfCC.idCare).transform.position;

            enemyCC = battlefield.GetAllCCBySide(1)[0] as CharController_Direct;
            //enemyCC.SetCCLife(0);
            stateTable = (battlefield as BattleField).GetRealChar(selfCC.idCare).transform.GetComponent <FB.FFSM.com_FightFSM>().stateTable;
            Start();
            ChangeState(StateMachine.idle);

            ai_attackstate_map = new Dictionary <int, List <AI_StateItem> >();
            for (int i = 0; i <= 3; i++)
            {
                ai_attackstate_map[i] = new List <AI_StateItem>();//0 移动系列
            }
            if (ai_table == null || ai_table.allstates == null)
            {
                return;
            }
            foreach (var a in ai_table.allstates)
            {
                ai_attackstate_map[a.attacktype].Add(a);
            }
        }