예제 #1
0
    // Update is called once per frame
    void Update()
    {
        if (isScroll)
        {
            return;
        }

        if (Input.GetKeyDown(KeyCode.A))
        {
            ChangeMusicSubject?.Invoke(eDirection.UP,
                                       null,
                                       () =>
            {
                if (musicList.SelectedMusicIndex == 0)
                {
                    arrow_up.SetActive(false);
                }
                else if (musicList.SelectedMusicIndex == musicList.MusicListLength() - 2)
                {
                    arrow_down.SetActive(true);
                }
                Scroll(musicList.SelectedMusicIndex);
            });
        }
        else if (Input.GetKeyDown(KeyCode.S))
        {
            ChangeMusicSubject?.Invoke(eDirection.DOWN,
                                       null,
                                       () =>
            {
                if (musicList.SelectedMusicIndex == musicList.MusicListLength() - 1)
                {
                    arrow_down.SetActive(false);
                }
                else if (musicList.SelectedMusicIndex == 1)
                {
                    arrow_up.SetActive(true);
                }
                Scroll(musicList.SelectedMusicIndex);
            });
        }
        else if (Input.GetKeyDown(KeyCode.H))
        {
            ChangeLevelSubject?.Invoke(eDirection.LEFT);
        }
        else if (Input.GetKeyDown(KeyCode.J))
        {
            ChangeLevelSubject?.Invoke(eDirection.RIGHT);
        }
        else if (Input.GetKeyDown(KeyCode.L))
        {
            MusicInfo selectedMusic = musicList.GetSelectedMusic();
            SingletonData.Instance.selectedMusicInfo = selectedMusic.BmsFileList[selectedMusic.SelectedLevelIndex];
            SceneManager.LoadSceneAsync((int)eSceneName.SCENE_LOADING);
        }
    }