mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 11:17:39 +02:00
start implementation of new format
needs fixes for some types
This commit is contained in:
@ -13,8 +13,8 @@ namespace HeavenStudio
|
||||
public class GameManager : MonoBehaviour
|
||||
{
|
||||
[Header("Lists")]
|
||||
public Beatmap Beatmap = new Beatmap();
|
||||
[HideInInspector] public List<Beatmap.Entity> playerEntities = new List<Beatmap.Entity>();
|
||||
public DynamicBeatmap Beatmap = new DynamicBeatmap();
|
||||
[HideInInspector] public List<DynamicBeatmap.DynamicEntity> playerEntities = new List<DynamicBeatmap.DynamicEntity>();
|
||||
private List<GameObject> preloadedGames = new List<GameObject>();
|
||||
public List<GameObject> SoundObjects = new List<GameObject>();
|
||||
|
||||
@ -75,7 +75,7 @@ namespace HeavenStudio
|
||||
if (txt != null)
|
||||
{
|
||||
string json = txt.text;
|
||||
Beatmap = JsonConvert.DeserializeObject<Beatmap>(json);
|
||||
Beatmap = JsonConvert.DeserializeObject<DynamicBeatmap>(json);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -116,20 +116,33 @@ namespace HeavenStudio
|
||||
|
||||
public void NewRemix()
|
||||
{
|
||||
Beatmap = new Beatmap();
|
||||
Beatmap = new DynamicBeatmap();
|
||||
Beatmap.bpm = 120f;
|
||||
Beatmap.musicVolume = 100;
|
||||
Beatmap.firstBeatOffset = 0f;
|
||||
Conductor.instance.musicSource.clip = null;
|
||||
}
|
||||
|
||||
public void LoadRemix(string json = "")
|
||||
public void LoadRemix(string json = "", string type = "riq", int version = 0)
|
||||
{
|
||||
SortEventsList();
|
||||
|
||||
if (json != "")
|
||||
{
|
||||
Beatmap = JsonConvert.DeserializeObject<Beatmap>(json);
|
||||
switch (type)
|
||||
{
|
||||
case "tengoku":
|
||||
case "rhmania":
|
||||
Beatmap toConvert = JsonConvert.DeserializeObject<Beatmap>(json);
|
||||
Beatmap = DynamicBeatmap.BeatmapConverter(toConvert);
|
||||
break;
|
||||
case "riq":
|
||||
Beatmap = JsonConvert.DeserializeObject<DynamicBeatmap>(json);
|
||||
break;
|
||||
default:
|
||||
NewRemix();
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -213,7 +226,7 @@ namespace HeavenStudio
|
||||
// Debug.Log("Checking Tempo Change at " + tempoChanges[currentTempoEvent] + ", current beat " + Conductor.instance.songPositionInBeats);
|
||||
if (Conductor.instance.songPositionInBeats >= tempoChanges[currentTempoEvent])
|
||||
{
|
||||
// Debug.Log("Tempo Change at " + Conductor.instance.songPositionInBeats + " of bpm " + Beatmap.tempoChanges[currentTempoEvent].tempo);
|
||||
// Debug.Log("Tempo Change at " + Conductor.instance.songPositionInBeats + " of bpm " + DynamicBeatmap.tempoChanges[currentTempoEvent].tempo);
|
||||
Conductor.instance.SetBpm(Beatmap.tempoChanges[currentTempoEvent].tempo);
|
||||
Conductor.instance.timeSinceLastTempoChange = Time.time;
|
||||
currentTempoEvent++;
|
||||
|
Reference in New Issue
Block a user