修复了一些bug(包含窗口预制体中的错误与{}列表解析存在死循环的错误)
This commit is contained in:
@@ -39,8 +39,8 @@ namespace Demo.Game
|
||||
public string WhichOpenProject { get; private set; } = null;
|
||||
public ProjectDefaultFileStyle CurrentProjectDefaultFileStyle = default;
|
||||
|
||||
public float SongOffset;
|
||||
public float CurrentTime => MainAudio.CurrentTime - SongOffset;
|
||||
public float SongOffset = 0;
|
||||
public float CurrentTime = 0;
|
||||
|
||||
public Transform MainCameraTransform => MainCamera.transform;
|
||||
|
||||
@@ -122,10 +122,10 @@ namespace Demo.Game
|
||||
{
|
||||
ScriptableObject.FastScriptableObjectTypen = content.ScriptableObjectTypen;
|
||||
ScriptableObject.IsAutoPlay = content.IsAutoPlay;
|
||||
ScriptableObject.OneBarTime = (float)MainConfig.FindItem(nameof(Editor.EditorController.BPM), Editor.EditorController.instance.BPM);
|
||||
ScriptableObject.OneBarTime = 60.0f / (float)MainConfig.FindItem(nameof(Editor.EditorController.BPM), Editor.EditorController.instance.BPM);
|
||||
SongOffset = (float)MainConfig.FindItem(nameof(SongOffset), SongOffset);
|
||||
SetupSongDuration = GameContent.instance.SetupSongDuration;
|
||||
SetSongCurrentTime = GameContent.instance.SetSongCurrentTime;
|
||||
SongOffset = GameContent.instance.SongOffset;
|
||||
// Open Project
|
||||
WhichOpenProject = (string)MainConfig.FindItem(nameof(WhichOpenProject), WhichOpenProject);
|
||||
if (string.IsNullOrEmpty(WhichOpenProject) == false)
|
||||
@@ -159,7 +159,7 @@ namespace Demo.Game
|
||||
string defaultRootPath = "root" + CurrentProjectDefaultFileStyle switch
|
||||
{
|
||||
ProjectDefaultFileStyle.PY => ".py",
|
||||
_ => ".h"
|
||||
_ => ".cpp"
|
||||
};
|
||||
if (content.IsCreateNewProject)
|
||||
{
|
||||
@@ -207,7 +207,7 @@ namespace Demo.Game
|
||||
yield return null;
|
||||
IsEnableUpdate = true;
|
||||
yield return new WaitUntil(() => MainObject != null);
|
||||
MainObject.ScriptUpdate(0, Time.deltaTime, ScriptableObject.TickType.Reset);
|
||||
MainObject.ScriptUpdate(SongOffset, Time.deltaTime, ScriptableObject.TickType.Reset);
|
||||
}
|
||||
|
||||
|
||||
@@ -216,9 +216,9 @@ namespace Demo.Game
|
||||
MainAudio.Stop();
|
||||
if (IsMain)
|
||||
{
|
||||
SetSongCurrentTime(-SongOffset);
|
||||
SetSongCurrentTime(SongOffset);
|
||||
}
|
||||
MainObject.ScriptUpdate(-SongOffset, Time.deltaTime, ScriptableObject.TickType.Reset);
|
||||
MainObject.ScriptUpdate(SongOffset, Time.deltaTime, ScriptableObject.TickType.Reset);
|
||||
}
|
||||
|
||||
public void Pause()
|
||||
@@ -255,6 +255,7 @@ namespace Demo.Game
|
||||
|
||||
private void Update()
|
||||
{
|
||||
CurrentTime = MainAudio.CurrentTime + SongOffset;
|
||||
float deltaTime = Time.deltaTime;
|
||||
var currentClip = MainAudio.CurrentClip;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user