diff --git a/Assets/Scripts/Environment/SkyUpdatement.cs b/Assets/Scripts/Environment/SkyUpdatement.cs index 870e000..657fb4f 100644 --- a/Assets/Scripts/Environment/SkyUpdatement.cs +++ b/Assets/Scripts/Environment/SkyUpdatement.cs @@ -73,5 +73,16 @@ namespace Demo.Game { ManualAddEntry(time, sky, default); } + + /// + /// 在指定时刻切换天空 + /// + /// + /// + [Convention.RScript.Variable.Attr.Method] + public void Add(float time, string sky) + { + ManualAddEntry(time, sky, default); + } } } diff --git a/Assets/Scripts/Framework/GameContent/GameController.cs b/Assets/Scripts/Framework/GameContent/GameController.cs index 10eb149..22e9e02 100644 --- a/Assets/Scripts/Framework/GameContent/GameController.cs +++ b/Assets/Scripts/Framework/GameContent/GameController.cs @@ -364,7 +364,8 @@ namespace Demo.Game } finally { - Destroy(MainObject.gameObject); + if (MainObject) + Destroy(MainObject.gameObject); if (Editor.EditorController.instance.MainGameController == this) { Editor.EditorController.instance.MainGameController = null; diff --git a/Assets/Scripts/Framework/Updatement.cs b/Assets/Scripts/Framework/Updatement.cs index 2bc3d67..5e2add9 100644 --- a/Assets/Scripts/Framework/Updatement.cs +++ b/Assets/Scripts/Framework/Updatement.cs @@ -30,16 +30,27 @@ namespace Demo.Game /// /// /// - public void ManualAddEntry(string time, DataType position, MathExtension.EaseCurveType curveType) + public void ManualAddEntry(float time, DataType position, MathExtension.EaseCurveType curveType) { Entries.Add(new() { - TimePoint = Parse(time), + TimePoint = time, Position = position, easeCurveType = curveType }); } + /// + /// 添加数据 + /// + /// + /// + /// + public void ManualAddEntry(string time, DataType position, MathExtension.EaseCurveType curveType) + { + ManualAddEntry(time, position, curveType); + } + private void UpdateEntry(int start, float percent) { UpdatementEntry head = Entries[start], tail = Entries[Mathf.Min(start + 1, Entries.Count - 1)];