From 24b30054e524ee83ca8e6d7617d8f93f6bdf7eac Mon Sep 17 00:00:00 2001 From: ninemine <1371605831@qq.com> Date: Wed, 12 Nov 2025 10:18:50 +0800 Subject: [PATCH] =?UTF-8?q?SkyUpdatement=E5=B7=B2=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Environment/SkyUpdatement.cs | 11 +++++++++++ .../Framework/GameContent/GameController.cs | 3 ++- Assets/Scripts/Framework/Updatement.cs | 15 +++++++++++++-- 3 files changed, 26 insertions(+), 3 deletions(-) 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)];