コード例 #1
0
ファイル: GameController.cs プロジェクト: XANkui/Carrot_XAN
    //具体产怪方法
    private void InstantiateMonster()
    {
        PlayEffectMusic("NormalMordel/Monster/Create");
        if (mMonsterIDIndex >= mMonsterIDList.Length)
        {
            StopCreateMonster();
            return;
        }
        //产生特效
        GameObject effectGo = GetGameObjectResource("CreateEffect");

        effectGo.transform.SetParent(transform);
        effectGo.transform.position = mapMaker.monsterPathPos[0];
        //产生怪物
        if (mMonsterIDIndex < mMonsterIDList.Length)
        {
            monsterBuilder.m_monsterID = level.roundList[level.currentRound].roundInfo.mMonsterIDList[mMonsterIDIndex];
        }

        GameObject monsterGo = monsterBuilder.GetProduct();

        monsterGo.transform.SetParent(transform);
        monsterGo.transform.position = mapMaker.monsterPathPos[0];
        mMonsterIDIndex++;
    }
コード例 #2
0
    // 产怪的方法(单个产怪)
    private void InstantiateMonster()
    {
        if (currentMonsterIndex == monstersID.Length)
        {
            StopCreateMonster();
            return;
        }

        PlayAudioEffect("NormalMordel/Monster/Create"); // 产生音效
        // 产生特效
        GameObject effect = GetItem("CreateMonsterEffect");

        effect.transform.SetParent(transform);
        effect.transform.position = mapMaker.monsterPointPosList[0];

        // 产生怪物
        if (currentMonsterIndex < monstersID.Length)
        {
            monsterBuilder.monsterID = level.rounds[level.currentRound].info.mMonsterIDList[currentMonsterIndex];
        }
        GameObject monster = monsterBuilder.GetProduct();

        monster.transform.SetParent(transform);
        monster.transform.position = mapMaker.monsterPointPosList[0];
        currentMonsterIndex++;
    }
コード例 #3
0
    /// <summary>
    /// 产生怪物
    /// </summary>
    private void instantiateMonster()
    {
        GameObject effectGo = GetGameObjectResources("DoorEffect");

        effectGo.transform.SetParent(transform);
        effectGo.transform.position = mapMaker.monsterPathPos[0];
        //产生怪物
        if (mMonsterIDIndex < mMonsterIDList.Length)
        {
            monsterBuilder.m_monsterID = mLevel.RoundsList[mLevel.CurrentRound].roundInfo.mMonsterIDList[mMonsterIDIndex];
        }

        GameObject monsterGo = monsterBuilder.GetProduct();

        monsterGo.transform.SetParent(transform);
        monsterGo.transform.position = mapMaker.monsterPathPos[0];
        mMonsterIDIndex++;
        if (mMonsterIDIndex >= mMonsterIDList.Length)
        {
            StopCreateMonster();
        }
    }
コード例 #4
0
    //具体的产怪方法
    public void InstantiateMonster()
    {
        if (mMonsterIDIndex >= mMonsterIDList.Length)
        {
            StopCreateMonster();
            return;
        }
        PlayEffectClip("NormalMordel/Monster/Create");
        GameObject effectGo = GetGameObjectResource("CreateEffect");

        effectGo.transform.position = mapMaker.monsterPathPos[0];
        effectGo.transform.SetParent(transform);
        //产生怪物
        if (mMonsterIDIndex < mMonsterIDList.Length)
        {
            //Debug.Log(monsterBuilder.m_monsterID);
            monsterBuilder.m_monsterID = level.roundList[level.currentRound].roundInfo.mMonsterIDList[mMonsterIDIndex];
        }
        GameObject monster = monsterBuilder.GetProduct();

        monster.transform.position = mapMaker.monsterPathPos[0];
        monster.transform.SetParent(transform);
        mMonsterIDIndex++;
    }