예제 #1
0
    private void WormPhaseEnded(EventInfo eventInfo)
    {
        WormEventInfo info = (WormEventInfo)eventInfo;

        if (info.wormBb.killerPlayer != null)
        {
            PlayerStats stats;

            switch (info.wormBb.killerPlayer.Id)
            {
            case 1:
                stats = p1Stats;
                break;

            case 2:
                stats = p2Stats;
                break;

            default:
                stats = p1Stats;
                break;
            }

            stats.EnemyKilledOk(ChromaColorInfo.Random, true);
        }
    }
    private void SetCurrentPhase(EventInfo eventInfo)
    {
        WormEventInfo info = (WormEventInfo)eventInfo;

        currentPhase = info.wormBb.wormCurrentPhase;

        sphereCollider.radius = AttackSettingsPhase.detectionRadius;
        attackWaitTime        = UnityEngine.Random.Range(AttackSettingsPhase.minWaitTime, AttackSettingsPhase.maxWaitTime);
    }
예제 #3
0
    private void WormPhaseEnded(EventInfo eventInfo)
    {
        WormEventInfo info = (WormEventInfo)eventInfo;

        if (info.wormBb.wormCurrentPhase < info.wormBb.wormMaxPhases - 1)
        {
            switch (info.wormBb.wormCurrentPhase)
            {
            case 0:
                rsc.audioMng.ChangeMusic(AudioManager.MusicType.LEVEL_BOSS_02, 5f);
                break;

            case 1:
                rsc.audioMng.ChangeMusic(AudioManager.MusicType.LEVEL_BOSS_03, 5f);
                break;

            case 2:
                rsc.audioMng.ChangeMusic(AudioManager.MusicType.LEVEL_BOSS_04, 5f);
                break;

            default:
                break;
            }
        }
        else //Last phase
        //if(info.wormBb.wormCurrentPhase == info.wormBb.wormMaxPhases - 1)
        {
            if (rsc.gameInfo.player1Controller.ActiveAndAlive)
            {
                rsc.gameInfo.player1Controller.SetInvulnerable();
            }
            if (rsc.gameInfo.numberOfPlayers == 2 && rsc.gameInfo.player2Controller.ActiveAndAlive)
            {
                rsc.gameInfo.player2Controller.SetInvulnerable();
            }

            rsc.eventMng.TriggerEvent(EventManager.EventType.KILL_ENEMIES, EventInfo.emptyInfo);
        }
    }