Exemplo n.º 1
0
    public void ChangeBeatCubeSet(BeatCubeSetType type)
    {
        GameState gameState = GameManager.instance.GetGameState();

        switch (type)
        {
        case BeatCubeSetType.set_3:
            if (curSetType != BeatCubeSetType.set_3)
            {
                beatCube_6set.SetActive(false);
                beatCube_3set.SetActive(true);
            }
            break;

        case BeatCubeSetType.set_6:
            if (curSetType != BeatCubeSetType.set_6)
            {
                beatCube_3set.SetActive(false);
                beatCube_6set.SetActive(true);
            }
            break;

        case BeatCubeSetType.set_9:
            break;
        }

        if (gameState == GameState.New_EditMusic_KeySelection || gameState == GameState.PlayGame)
        {
            StartCoroutine(DelayChangeBeatCubeSet(type));
        }

        curSetType = type;
    }
Exemplo n.º 2
0
    private void Start()
    {
        beatCube_3set.SetActive(true);
        beatCube_6set.SetActive(false);

        curSetType = BeatCubeSetType.set_3;
    }
Exemplo n.º 3
0
 public void ChangeBeatCubeSet(BeatCubeSetType type)
 {
     if (type == BeatCubeSetType.set_3)
     {
         BeatCubeManager.instance.ChangeBeatCubeSet(BeatCubeSetType.set_3);
     }
     else if (type == BeatCubeSetType.set_6)
     {
         BeatCubeManager.instance.ChangeBeatCubeSet(BeatCubeSetType.set_6);
     }
     else
     {
         BeatCubeManager.instance.ChangeBeatCubeSet(BeatCubeSetType.set_9);
     }
 }
Exemplo n.º 4
0
    IEnumerator DelayChangeBeatCubeSet(BeatCubeSetType type)
    {
        BeatCube[] beatCubes = GetComponentsInChildren <BeatCube>();
        foreach (var cube in beatCubes)
        {
            cube.GetComponent <Collider>().enabled = false;
        }

        yield return(new WaitForSeconds(1));

        foreach (var cube in beatCubes)
        {
            cube.GetComponent <Collider>().enabled = true;
        }
    }
Exemplo n.º 5
0
    public void ChangeState(GameState _gameState, bool stackTheState)
    {
        AudioManager.instance.StopAudio();
        PlayModeManager.instance.StopAllSounds();

        if (gameState == GameState.New_Menu && _gameState == GameState.PlayGame)
        {
            if (FileIOManager.instance.GetMusicInfo(AudioManager.instance.GetAudioClip().name) == null)
            {
                Debug.Log("unable to get music info");
                return;
            }
        }

        gameState = _gameState;

        switch (_gameState)
        {
        case GameState.Loading:
            FileIOManager.instance.LoadMusicInfos();
            FileIOManager.instance.LoadSoundFiles();
            break;

        case GameState.MainMenu:
            BackgroundManager.instance.StartTwinkleBackground();
            break;

        case GameState.New_MusicSelection:
            soundFiles = FileIOManager.instance.GetSoundFiles();
            StartMusicSeletion();
            break;

        case GameState.New_Menu:
            //
            break;

        case GameState.Option:
            //
            break;

        case GameState.Load_MusicSelection:
            soundFiles = FileIOManager.instance.GetSoundFilesOfPremade();
            StartMusicSeletion();
            break;

        case GameState.New_DivideSection:
            SectionManager.instance.StartDividingSections();
            break;

        case GameState.New_EditMusic_Edit:
            InitBeatCubes();
            EditorManager.instance.StartEditingMusic();
            OnSectionButtonClick(0);
            break;

        case GameState.PlayGame:
            BackgroundManager.instance.StopTwinkleBackground();
            AudioManager.instance.StopAudio();
            string          musicToPlay = AudioManager.instance.GetAudioClip().name;
            BeatCubeSetType setType     = FileIOManager.instance.GetMusicInfo(musicToPlay).setType;
            BeatCubeManager.instance.ChangeBeatCubeSet(setType);
            InitBeatCubes();
            PlayModeManager.instance.StartPlayMode(musicToPlay);
            OnSectionButtonClick(0);
            break;
        }

        UIManager.instance.UpdateUI();
        BeatCubeManager.instance.UpdateBeatCubeForm();

        if (stackTheState)
        {
            StackState();
        }
    }