推进同化RScript

This commit is contained in:
2025-11-24 18:02:57 +08:00
parent fc8f48bc7e
commit 2e0d16db49
17 changed files with 400 additions and 864 deletions

View File

@@ -1,10 +1,8 @@
using Convention;
using Convention.WindowsUI.Variant;
using System;
using System.Collections;
using System.Collections.Generic;
using Convention;
using Convention.VFX;
using Convention.WindowsUI.Variant;
using Demo.Editor.UI;
using UnityEngine;
using UnityEngine.InputSystem;
@@ -16,19 +14,15 @@ namespace Demo.Game
[Content] public GameController RootGameController;
public override IEnumerator LoadScript(string script)
public string SourcePath;
protected override IEnumerator DoSomethingDuringApplyScript()
{
try
yield return base.DoSomethingDuringApplyScript();
ScriptUpdate(RootGameController.SongOffset, 0.01f, TickType.Reset);
if (RootGameController.IsMain)
{
yield return base.LoadScript(script);
}
finally
{
ScriptUpdate(RootGameController.SongOffset, 0.01f, TickType.Start);
if (RootGameController.IsMain)
{
Keyboard.current.onTextInput += InputCatchChar;
}
Keyboard.current.onTextInput += InputCatchChar;
}
}
@@ -41,14 +35,15 @@ namespace Demo.Game
yield return base.UnloadScript();
}
public void EnableScript(string sourcePath, string scriptPath, GameController parent)
public void EnableScript(string sourcePath, GameController parent)
{
AllScriptableObjectCounter = 0;
if (AllScriptableObjectCounterHierarchyItem == null)
{
AllScriptableObjectCounterHierarchyItem = HierarchyWindow.instance.CreateRootItemEntryWithBinders(typeof(ScriptableObject))[0];
}
base.EnableScript(sourcePath, scriptPath, nameof(RootObject), null);
SourcePath = sourcePath;
base.EnableScript(null);
RootGameController = parent;
}