Preventing even more code re-use

Editor.NewRemix() from my last commit is now Editor.LoadRemix(json) and is called within Editor.LoadRemix(). The "New" button new calls Editor.LoadRemix("");
This commit is contained in:
Carson Kompon 2022-02-25 22:48:44 -05:00
parent 027a6cddbe
commit e2ee02775a
2 changed files with 5 additions and 8 deletions

View file

@ -16386,8 +16386,8 @@ MonoBehaviour:
m_Calls: m_Calls:
- m_Target: {fileID: 1423699437} - m_Target: {fileID: 1423699437}
m_TargetAssemblyTypeName: RhythmHeavenMania.Editor.Editor, Assembly-CSharp m_TargetAssemblyTypeName: RhythmHeavenMania.Editor.Editor, Assembly-CSharp
m_MethodName: NewRemix m_MethodName: LoadRemix
m_Mode: 1 m_Mode: 5
m_Arguments: m_Arguments:
m_ObjectArgument: {fileID: 0} m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine

View file

@ -319,9 +319,9 @@ namespace RhythmHeavenMania.Editor
} }
} }
public void NewRemix() public void LoadRemix(string json = "")
{ {
GameManager.instance.LoadRemix(""); GameManager.instance.LoadRemix(json);
Timeline.instance.LoadRemix(); Timeline.instance.LoadRemix();
Timeline.instance.TempoInfo.UpdateStartingBPMText(); Timeline.instance.TempoInfo.UpdateStartingBPMText();
Timeline.instance.TempoInfo.UpdateOffsetText(); Timeline.instance.TempoInfo.UpdateOffsetText();
@ -356,10 +356,7 @@ namespace RhythmHeavenMania.Editor
stream.CopyTo(ms); stream.CopyTo(ms);
bytes = ms.ToArray(); bytes = ms.ToArray();
string json = Encoding.Default.GetString(bytes); string json = Encoding.Default.GetString(bytes);
GameManager.instance.LoadRemix(json); LoadRemix(json);
Timeline.instance.LoadRemix();
Timeline.instance.TempoInfo.UpdateStartingBPMText();
Timeline.instance.TempoInfo.UpdateOffsetText();
} }
} }
} }