2025-01-26 21:10:16 -05:00
|
|
|
|
using System.Collections;
|
|
|
|
|
|
using System.Collections.Generic;
|
2025-02-08 23:09:50 -05:00
|
|
|
|
using Ichni.RhythmGame.Beatmap;
|
2025-01-26 21:10:16 -05:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
2025-02-08 23:09:50 -05:00
|
|
|
|
namespace Ichni.RhythmGame
|
2025-01-26 21:10:16 -05:00
|
|
|
|
{
|
2025-02-08 23:09:50 -05:00
|
|
|
|
public class SongInformation : IBaseElement
|
2025-01-26 21:10:16 -05:00
|
|
|
|
{
|
2025-02-08 23:09:50 -05:00
|
|
|
|
public AudioClip song; //曲目
|
|
|
|
|
|
public string songName;
|
|
|
|
|
|
public string songLocation; //曲名
|
|
|
|
|
|
public float bpm; //每分钟节拍数
|
|
|
|
|
|
public float delay; //设定音乐和谱面延迟Delay秒后开始,在延迟中,SongPosition为负数。
|
|
|
|
|
|
|
|
|
|
|
|
public BaseElement_BM matchedBM { get; set; }
|
2025-01-26 21:10:16 -05:00
|
|
|
|
|
2025-02-08 23:09:50 -05:00
|
|
|
|
public SongInformation(string songName, float bpm, float delay)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.songName = songName;
|
|
|
|
|
|
this.bpm = bpm;
|
|
|
|
|
|
this.delay = delay;
|
|
|
|
|
|
songLocation = EditorManager.instance.projectInformation.projectPath + "/" + songName + ".wav";
|
|
|
|
|
|
Debug.Log("Loading song from " + songLocation + " " + ES3.FileExists(songLocation));
|
|
|
|
|
|
song = ES3.LoadAudio(songLocation, AudioType.WAV);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void SaveBM()
|
|
|
|
|
|
{
|
|
|
|
|
|
matchedBM = new SongInformation_BM(songName, bpm, delay);
|
|
|
|
|
|
}
|
2025-01-26 21:10:16 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-02-08 23:09:50 -05:00
|
|
|
|
namespace Beatmap
|
2025-01-26 21:10:16 -05:00
|
|
|
|
{
|
2025-02-08 23:09:50 -05:00
|
|
|
|
public class SongInformation_BM : BaseElement_BM
|
|
|
|
|
|
{
|
|
|
|
|
|
public string songName;
|
|
|
|
|
|
public float bpm;
|
|
|
|
|
|
public float delay;
|
|
|
|
|
|
|
|
|
|
|
|
public SongInformation_BM()
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public SongInformation_BM(string songName, float bpm, float delay)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.songName = songName;
|
|
|
|
|
|
this.bpm = bpm;
|
|
|
|
|
|
this.delay = delay;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void ExecuteBM()
|
|
|
|
|
|
{
|
|
|
|
|
|
EditorManager.instance.songInformation = new SongInformation(songName, bpm, delay);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-01-26 21:10:16 -05:00
|
|
|
|
}
|
2025-02-08 23:09:50 -05:00
|
|
|
|
}
|