示例#1
0
    // 具体产怪方法
    public void InstantiateMonster()
    {
        // 产生特效
        GameObject CreatEffect = GetGameObjectResource("CreatEffect");

        CreatEffect.transform.SetParent(transform);
        CreatEffect.transform.position = mapMaker.monsterPathPos[0];
        // 产生怪物
        if (mMonsterIDIndex < mMonsterIDList.Length)
        {
            Round currentRound = level.roundArray[level.currentRound];
            monsterBuilder.mMonsterID = currentRound.roundInfo.mMonsterIDList[mMonsterIDIndex];
        }
        GameObject monsterGo = monsterBuilder.GetProductGO();

        monsterGo.transform.SetParent(transform);
        monsterGo.transform.position = mapMaker.monsterPathPos[0];
        mMonsterIDIndex++;
        if (mMonsterIDIndex >= mMonsterIDList.Length)
        {
            StopCreatMonster();
        }
    }