Example #1
0
 void Start()
 {
     //Instantiate(Resources.Load())
     //MySheetMusic.bpm = 120;
     //MySheetMusic.Channel_1 = new List<float>();
     //for (int i = 0; i < 1000; i++)
     //{
     //    MySheetMusic.Channel_1.Add(i);
     //}
     MySheetMusic = SheetDataManager.Load(0);
     Ready();
 }
Example #2
0
    void OnEnable()
    {
        //data = SheetDataManager.LoadList();

        SheetData = new SheetData();
        if (SheetDataManager.isEditorDataExist())
        {
            EditorData = SheetDataManager.Load();
        }
        else
        {
            EditorData = new EditorData();
            SheetDataManager.Save(EditorData);
        }
        SectionNo = 0;
    }
Example #3
0
    void OnGUI()
    {
        EditorGUILayout.BeginHorizontal();
        index = EditorGUILayout.Popup(index, EditorData.sheetPool.ToArray(), GUILayout.Width(100));
        //Debug.Log(index);
        if (GUILayout.Button("開新譜面", GUILayout.Width(100)))
        {
            EditorData.SheetNumber++;
            EditorData.sheetPool.Add("Enpty" + EditorData.SheetNumber);
            SheetDataManager.Save(EditorData);
        }

        if (EditorData.SheetNumber != -1 && SheetDataManager.isSavedataExist(index))
        {
            if (GUILayout.Button("讀取之前的進度", GUILayout.Width(150)))
            {
                if (EditorUtility.DisplayDialog("迷之音", "確定要讀入" + EditorData.sheetPool[index] + "嘛?", "是", "再考慮"))
                {
                    SheetData = SheetDataManager.Load(index);
                    if (SheetData.Ch1.Capacity > 0)
                    {
                        SectionNo = 1;
                    }
                }
            }
        }
        if (EditorData.SheetNumber != -1)
        {
            //if (GUILayout.Button("Clean this Sheet", GUILayout.Width(150)))
            //{
            //    if (EditorUtility.DisplayDialog("迷之音", "確定要清除所有譜面內容嘛?", "是", "再考慮"))
            //    {
            //        SheetData.Audio = OpenAudioSource();
            //        EditorData.sheetPool[index] = SheetData.Audio;
            //        SheetDataManager.Save(EditorData);
            //    }

            //}
            if (GUILayout.Button("刪除此樂譜", GUILayout.Width(100)))
            {
                if (EditorUtility.DisplayDialog("迷之音", "確定要刪除" + EditorData.sheetPool[index] + "嘛?", "是", "再考慮"))
                {
                    EditorData.SheetNumber--;
                    EditorData.sheetPool.RemoveAt(index);
                    SheetDataManager.Save(EditorData);
                    AssetDatabase.DeleteAsset(Application.dataPath + @"\Sheet" + index.ToString());
                }
            }
        }


        EditorGUILayout.EndHorizontal();
        Draw();

        //if (isNew)
        //{
        //    if (GUILayout.Button("Creat", button))
        //    {
        //        data.Add(new SheetData());
        //        Debug.Log(index);
        //        isNew = false;
        //    }
        //}
    }