Beispiel #1
0
    //-----------------------------------------------------------------
    //! @summary   シートの変更があった時の処理
    //!
    //! @parameter [void] なし
    //!
    //! @return    なし
    //-----------------------------------------------------------------
    public void OnValueChangedSheetDropdown()
    {
        // 選択されているシートをヒエラルキーの一番最後に移動させる
        switch (m_sheetDropdown.value)
        {
        case 0:
            m_sheets[m_sheetDropdown.value].SetAsLastSibling();

            // 複数選択がされている
            if (m_noteManager.GetMultipleSelectFlag())
            {
                m_connectNoteSheetController.SetAsLastSibling();
            }
            break;

        case 1:
            m_sheets[m_sheetDropdown.value].SetAsLastSibling();
            break;

        case 2:
            m_sheets[m_sheetDropdown.value].SetAsLastSibling();
            break;
        }
    }
Beispiel #2
0
    //-----------------------------------------------------------------
    //! @summary   選択されているノーツを設定する
    //!
    //! @parameter [selectNotes] 設定するノーツ
    //!
    //! @return    なし
    //-----------------------------------------------------------------
    public void SetSelectNotes(GameObject selectNotes)
    {
        if (selectNotes != null)
        {
            // Ctrlキーが押されている
            if (Input.GetKey(KeyCode.LeftControl))
            {
                // 登録されているか調べる
                int index = m_selectNotes.IndexOf(selectNotes);

                // 登録されていない場合
                if (index < 0)
                {
                    // 選択されているノーツを追加する
                    m_selectNotes.Add(selectNotes);

                    // 光彩を付ける
                    if (selectNotes.GetComponent <EditNotesController>())
                    {
                        selectNotes.GetComponent <EditNotesController>().SwitchGlow(true);
                    }
                }
                else
                {
                    // 選択リストから外す
                    m_selectNotes.RemoveAt(index);

                    // 選択されたノーツの光彩を切る
                    selectNotes.GetComponent <EditNotesController>().SwitchGlow(false);
                }
            }
            else
            {
                // 選択されている全ての光彩を切る
                if (m_selectNotes.Count != 0)
                {
                    foreach (GameObject note in m_selectNotes)
                    {
                        if (note.GetComponent <EditNotesController>())
                        {
                            note.GetComponent <EditNotesController>().SwitchGlow(false);
                        }
                        else
                        {
                            note.GetComponent <ConnectNoteController>().SwitchGlow(false);
                        }
                    }
                }

                // リストをクリアする
                m_selectNotes.Clear();

                // 選択されているノーツを追加する
                m_selectNotes.Add(selectNotes);

                // 光彩を付ける
                if (selectNotes.GetComponent <EditNotesController>())
                {
                    selectNotes.GetComponent <EditNotesController>().SwitchGlow(true);
                }
                else
                {
                    selectNotes.GetComponent <ConnectNoteController>().SwitchGlow(true);
                }
            }

            // シートの切り替え
            if (m_selectNotes.Count > 1)
            {
                // 複数選択のフラグを立てる
                m_multipleSelectFlag = true;

                // 連結ノーツシートを手前に持ってくる
                m_connectNoteSheetController.SetAsLastSibling();
            }
            else
            {
                if (m_selectNotes.Count == 0)
                {
                    // 複数選択のフラグを倒す
                    m_multipleSelectFlag = false;

                    // 連結ノーツシートを奥に持っていく
                    m_connectNoteSheetController.SetAsFirstSibling();
                }
                else
                {
                    if (m_selectNotes[0].GetComponent <EditNotesController>())
                    {
                        // 複数選択のフラグを倒す
                        m_multipleSelectFlag = false;

                        // 連結ノーツシートを奥に持っていく
                        m_connectNoteSheetController.SetAsFirstSibling();
                    }
                    else
                    {
                        // 複数選択のフラグを立てる
                        m_multipleSelectFlag = true;

                        // 連結ノーツシートを手前に持ってくる
                        m_connectNoteSheetController.SetAsLastSibling();
                    }
                }
            }

            // UIへ情報を反映させる
            if (selectNotes.GetComponent <EditNotesController>())
            {
                m_notesSheetController.DisplayNotes(selectNotes.GetComponent <EditNotesController>());
            }
            else
            {
                m_connectNoteSheetController.DisplayNotes(selectNotes.GetComponent <ConnectNoteController>());
            }
        }
        else
        {
            // 複数選択のフラグを倒す
            m_multipleSelectFlag = false;

            // 連結ノーツシートを奥に持っていく
            m_connectNoteSheetController.SetAsFirstSibling();

            // UIへ情報を反映させる
            m_notesSheetController.DisplayNotes(null);
            m_connectNoteSheetController.DisplayNotes(null);
        }

        // ソートする
        if (m_selectNotes.Count > 1)
        {
            m_selectNotes.Sort((a, b) =>
            {
                if (a.GetComponent <EditNotesController>())
                {
                    if (b.GetComponent <EditNotesController>())
                    {
                        if (a.GetComponent <EditNotesController>().GetNotesData().m_startBeat > b.GetComponent <EditNotesController>().GetNotesData().m_startBeat)
                        {
                            return(1);
                        }
                        else if (a.GetComponent <EditNotesController>().GetNotesData().m_startBeat < b.GetComponent <EditNotesController>().GetNotesData().m_startBeat)
                        {
                            return(-1);
                        }
                    }
                    else
                    {
                        if (a.GetComponent <EditNotesController>().GetNotesData().m_startBeat > b.GetComponent <ConnectNoteController>().GetNoteData().m_startBeat)
                        {
                            return(1);
                        }
                        else if (a.GetComponent <EditNotesController>().GetNotesData().m_startBeat < b.GetComponent <ConnectNoteController>().GetNoteData().m_startBeat)
                        {
                            return(-1);
                        }
                    }
                }
                else
                {
                    if (b.GetComponent <EditNotesController>())
                    {
                        if (a.GetComponent <ConnectNoteController>().GetNoteData().m_startBeat > b.GetComponent <EditNotesController>().GetNotesData().m_startBeat)
                        {
                            return(1);
                        }
                        else if (a.GetComponent <ConnectNoteController>().GetNoteData().m_startBeat < b.GetComponent <EditNotesController>().GetNotesData().m_startBeat)
                        {
                            return(-1);
                        }
                    }
                    else
                    {
                        if (a.GetComponent <ConnectNoteController>().GetNoteData().m_startBeat > b.GetComponent <ConnectNoteController>().GetNoteData().m_startBeat)
                        {
                            return(1);
                        }
                        else if (a.GetComponent <ConnectNoteController>().GetNoteData().m_startBeat < b.GetComponent <ConnectNoteController>().GetNoteData().m_startBeat)
                        {
                            return(-1);
                        }
                    }
                }

                return(0);
            });
        }
    }