예제 #1
0
    public void OnBeatCubeHit(BeatCube cube)
    {
        StartMusicIfItsTheFirstSection();

        if (AudioManager.instance.IsPlaying() && CheckAudioPlaybackTimeIsWithinSection())
        {
            AddIDBeats(cube.id);

            cube.SubmitReaction();
            BackgroundManager.instance.SetTwinkle(cube.sector);
        }
    }
예제 #2
0
    public void OnBeatCubeHitForMenu(BeatCube cube)
    {
        switch (cube.sector)
        {
        case Sector.Left:
            verticalContentManager.ChangeSelectedContent(true);
            break;

        case Sector.Center:
            verticalContentManager.ConfirmSelectedMenu();
            cube.SubmitReaction();
            BackgroundManager.instance.SetTwinkle(cube.sector);
            break;

        case Sector.Right:
            verticalContentManager.ChangeSelectedContent(false);
            break;
        }
    }
예제 #3
0
    public void OnBeatCubeHit(BeatCube cube)
    {
        //AudioManager.instance.PlayDrumSound();

        if (gameState == GameState.PlayGame)
        {
            bool react = cube.PlaySound();
            if (react)
            {
                cube.SubmitReaction();
                BackgroundManager.instance.SetTwinkle(cube.sector);
            }
            return;
        }

        if (gameState == GameState.New_EditMusic_Edit)
        {
            EditorManager.instance.OnBeatCubeHit(cube);
            return;
        }


        if (IsMenuSelectingState(gameState))
        {
            UIManager.instance.OnBeatCubeHitForMenu(cube);
            return;
        }


        switch (cube.sector)
        {
        case Sector.Left:
            if (gameState == GameState.New_MusicSelection || gameState == GameState.Load_MusicSelection)
            {
                MoveToNextMusic(true);
                UIManager.instance.UpdateUI();
            }
            else if (gameState == GameState.New_DivideSection)
            {
                AudioManager.instance.AudioFastForward(false);
                UIManager.instance.UpdateTimeLineCursor();
            }
            break;

        case Sector.Center:
            if (gameState == GameState.New_MusicSelection)
            {
                if (AudioManager.instance.GetAudioClip() != null)
                {
                    ChangeState(GameState.New_Menu, true);
                    cube.SubmitReaction();
                    BackgroundManager.instance.SetTwinkle(cube.sector);
                }
            }
            else if (gameState == GameState.Load_MusicSelection)
            {
                if (AudioManager.instance.GetAudioClip() != null)
                {
                    ChangeState(GameState.PlayGame, true);
                    cube.SubmitReaction();
                    BackgroundManager.instance.SetTwinkle(cube.sector);
                }
            }
            else if (gameState == GameState.New_DivideSection)
            {
                bool react = SectionManager.instance.AddSection();
                if (react)
                {
                    cube.SubmitReaction();
                    BackgroundManager.instance.SetTwinkle(cube.sector);
                    UIManager.instance.AddSectionPointToTimeLine(AudioManager.instance.GetCurrentPlayTime());
                }
            }
            break;

        case Sector.Right:
            if (gameState == GameState.New_MusicSelection || gameState == GameState.Load_MusicSelection)
            {
                MoveToNextMusic(false);
                UIManager.instance.UpdateUI();
            }
            else if (gameState == GameState.New_DivideSection)
            {
                AudioManager.instance.AudioFastForward(true);
                UIManager.instance.UpdateTimeLineCursor();
            }
            break;
        }
    }