Exemplo n.º 1
0
    /// <summary>
    /// 楽曲(譜面)リストの表示
    /// </summary>
    public void LoadToDisplay()
    {
        //譜面番号の初期化
        number = 1;

        //並び替えの方法を指定
        grid.onCustomSort = (a, b) => { return(ChartSort(a, b)); };

        //譜面情報の取得
        var charts = Directory.GetFiles(Define.c_ChartSaveDirectory, "*" + Define.c_JSON);

        Yuuki.FileIO.FileIO fileIO = new Yuuki.FileIO.FileIO();
        foreach (var it in charts)
        {
            var chart = JsonUtility.FromJson <Chart>(fileIO.GetContents(it));
            Create(chart);
        }
        #region スクロールバー
        //フレームをトグルのアルファ値に合わせ、表示を合わせる
        {
            StartCoroutine(ScrollBarFrameAlphaSync());
        }
        #endregion
        //整列
        grid.Reposition();
        //スクロールバーを初期位置に
        scrollBar.value = 0;
    }
Exemplo n.º 2
0
    public void CreateData()
    {
        var   fileIO = new Yuuki.FileIO.FileIO();
        Chart chart  = new Chart();

        chart.Title      = musicTitle.text; //曲名
        chart.FilePath   = executeFilePath; //楽曲パス
        chart.Comb       = (uint)ret.Count;
        chart.BPM        = bpm;             //BPM
        chart.ResistName = chartName.text;  //譜面の名前
        Debug.Log("ret.ToArray Size = " + ret.ToArray().Count());
        chart.Notes = ret.ToArray();
        Debug.Log("chart.Notes:" + chart.Notes);
        Debug.Log("chart.Notes.ToArray Size = " + chart.Notes.ToArray().Count());
        chart.Interval = float.Parse(intervalSec.text);
        fileIO.CreateFile(
            Define.c_ChartSaveDirectory + Define.c_Delimiter + chartName.text + Define.c_JSON,
            JsonUtility.ToJson(chart),
            Yuuki.FileIO.FileIO.FileIODesc.Overwrite
            );
    }