예제 #1
0
    void UpdateInput()
    {
        if (InputManager.Instance.HasMoveUp())
        {
            mSongList.SelectPrevious();
        }

        if (InputManager.Instance.HasMoveDown())
        {
            mSongList.SelectNext();
        }

        if (InputManager.Instance.HasOk())
        {
            var focusNode = MainScript.Instance.MusicTree.FocusNode;
            if (focusNode is BoxNode)
            {
                mSongList.IntoBox();
            }
            else if (focusNode is BackNode)
            {
                mSongList.OutofBox();
            }
            else if (focusNode != null)
            {
                PlayingMusicNode(focusNode);
            }
        }

        if (InputManager.Instance.HasCancle())
        {
            var focusNode = MainScript.Instance.MusicTree.FocusNode;
            if (focusNode != null && focusNode.Parent != MainScript.Instance.MusicTree.Root)
            {
                mSongList.OutofBox();
            }
            else
            {
                StageManager.Instance.Open <LoginStage>();
                Close();
            }
        }
    }