Пример #1
0
    private void CreatSoilderModel(AIGameManger _aIGameManger)
    {
        for (int i = 0; i < m_datainfolist.dataList.Count; i++)
        {
            SoilderAIStateController ai;
            Quaternion spawnRotation = new Quaternion();
            spawnRotation.eulerAngles = new Vector3(0.0f, Random.Range(0.0f, 360.0f));
            switch (m_datainfolist.dataList[i].name)
            {
            case ("S0"):
                ai = new LittleMaoStateController();

                _aIGameManger.CreatSoilderRole(ai, "Props/" + m_datainfolist.dataList[i].name, m_datainfolist.dataList[i].LastPos, spawnRotation);
                ai.Role.GetComponent <PlayerHealth>().currenthp = m_datainfolist.dataList[i].currentHp;
                break;

            case ("S1"):
                ai = new SummonMaoStateController();

                _aIGameManger.CreatSoilderRole(ai, "Props/" + m_datainfolist.dataList[i].name, m_datainfolist.dataList[i].LastPos, spawnRotation);
                ai.Role.GetComponent <PlayerHealth>().currenthp = m_datainfolist.dataList[i].currentHp;
                break;


            case ("S2"):
                ai = new BombMaoStateController();
                _aIGameManger.CreatSoilderRole(ai, "Props/" + m_datainfolist.dataList[i].name, m_datainfolist.dataList[i].LastPos, spawnRotation);
                ai.Role.GetComponent <PlayerHealth>().currenthp = m_datainfolist.dataList[i].currentHp;
                break;


            case ("S3"):
                ai = new HeadMaoStateController();
                _aIGameManger.CreatSoilderRole(ai, "Props/" + m_datainfolist.dataList[i].name, m_datainfolist.dataList[i].LastPos, spawnRotation);
                ai.Role.GetComponent <PlayerHealth>().currenthp = m_datainfolist.dataList[i].currentHp;
                break;


            case ("S4"):
                ai = new BattleMaoStateController();
                _aIGameManger.CreatSoilderRole(ai, "Props/" + m_datainfolist.dataList[i].name, m_datainfolist.dataList[i].LastPos, spawnRotation);
                ai.Role.GetComponent <PlayerHealth>().currenthp = m_datainfolist.dataList[i].currentHp;
                break;

            default:
                break;
            }
        }
    }
    private void CreatStrongMao(string Name, Vector3 pos, Quaternion q)
    {
        BattleMaoStateController ai = new BattleMaoStateController();

        aIGameManger.CreatSoilderRole(ai, "Props/" + Name, pos, q);
    }