Example #1
0
    private void FinishChallenge(OnFinishChallenge e)
    {
        EventManager.TriggerEvent(new ControllerEvent(false));
        _TimeCounting.StopTime();

        _TransitionObject.SetActive(true);
        _Transition.CrossFade("FadeIn", 0);

        StartCoroutine(WinTransition());

        //EventManager.TriggerEvent(new LeaderboardAddEvent(_TimeCounting.GetTime(), LeaderboardType.CHALLENGE_2));
        if (_ThisChallenge == 0)
        {
            EventManager.TriggerEvent(new LeaderboardAddEvent(_TimeCounting.GetTime(), LeaderboardType.CHALLENGE_2));
            Debug.Log("Challenge2 = " + _TimeCounting.GetTime());
        }
        if (_ThisChallenge == 1)
        {
            EventManager.TriggerEvent(new LeaderboardAddEvent(_TimeCounting.GetTime(), LeaderboardType.CHALLENGE_3));
            Debug.Log("Challenge3 = " + _TimeCounting.GetTime());
        }
        EventManager.TriggerEvent(new BGMEvent(PlayType.STOP));
        EventManager.TriggerEvent(new SFXPlayEvent(SfxType.LABIRIN, true));
    }
Example #2
0
    private void GoToNextLevel(OnNextLevel e)
    {
        if (_NextLevel > _Level.Count - 1)
        {
            _NextLevel = 0;
            IsEndLevel = true;
        }

        EventManager.TriggerEvent(new ControllerEvent(false));
        _TimeCounting.StopTime();
        //LEADERBOARD ADD CHALLENGE
        if (_ThisLevel == 29)
        {
            Debug.Log("LEVEL 30 = " + _TimeCounting.GetTime());
            EventManager.TriggerEvent(new LeaderboardAddEvent(_TimeCounting.GetTime(), LeaderboardType.CHALLENGE_1));
        }

        //_WinUI.SetActive(true);
        _TransitionObject.SetActive(true);
        _Transition.CrossFade("FadeIn", 0);

        StartCoroutine(WinTransition());

        for (int i = 0; i < _Level.Count; i++)
        {
            if (i == Global.Level)
            {
                if ((_Level[i].IsClear == false) && (_Level[i].Stage == 1))
                {
                    Global.StarCollect   += 3;
                    Global.StarPerStage1 += 3;
                    Debug.Log(Global.StarCollect);
                    _Level[i].IsClear = true;
                }

                if ((_Level[i].IsClear == false) && (_Level[i].Stage == 2))
                {
                    Global.StarCollect   += 3;
                    Global.StarPerStage2 += 3;
                    Debug.Log(Global.StarCollect);
                    _Level[i].IsClear = true;
                }

                if ((_Level[i].IsClear == false) && (_Level[i].Stage == 3))
                {
                    Global.StarCollect   += 3;
                    Global.StarPerStage3 += 3;
                    Debug.Log(Global.StarCollect);
                    _Level[i].IsClear = true;
                }

                if ((_Level[i].IsClear == false) && (_Level[i].Stage == 4))
                {
                    Global.StarCollect   += 3;
                    Global.StarPerStage4 += 3;
                    Debug.Log(Global.StarCollect);
                    _Level[i].IsClear = true;
                }

                if ((_Level[i].IsClear == false) && (_Level[i].Stage == 5))
                {
                    Global.StarCollect   += 3;
                    Global.StarPerStage5 += 3;
                    Debug.Log(Global.StarCollect);
                    _Level[i].IsClear = true;
                }

                if ((_Level[i].IsClear == false) && (_Level[i].Stage == 6))
                {
                    Global.StarCollect   += 3;
                    Global.StarPerStage6 += 3;
                    Debug.Log(Global.StarCollect);
                    _Level[i].IsClear = true;
                }
            }
        }

        if (IsEndLevel == true)
        {
            _NextLevelButton.SetActive(false);
        }

        EventManager.TriggerEvent(new BGMEvent(PlayType.STOP));
        EventManager.TriggerEvent(new SFXPlayEvent(SfxType.LABIRIN, true));
    }