推进同化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

@@ -17,46 +17,17 @@ namespace Demo.Game
[Content, SerializeField] private string project;
[Content, SerializeField] private GameController SubWorldGameController;
public override IEnumerator LoadScript(string script)
protected override IEnumerator DoSomethingDuringApplyScript()
{
yield return base.LoadScript(script);
/*
// Load
var content = GameContent.instance;
// Always
content.IsCreateNewProject = false;
// Push Content
var oldContentRootSourceDir = content.RootSourceDir;
var oldSetupSongDuration = content.SetupSongDuration;
var oldSetSongCurrentTime = content.SetSongCurrentTime;
// Setting New
content.RootSourceDir = Path.Combine(PlatformIndicator.StreamingAssetsPath, project) + "/";
content.SetupSongDuration = (x, y) => { };
content.SetSongCurrentTime = x => { };
yield return base.DoSomethingDuringApplyScript();
var ir = SceneManager.LoadSceneAsync(Editor.EditorController.SceneName, LoadSceneMode.Additive);
ir.completed += x =>
{
SubWorldGameController = (from controller in FindObjectsOfType<GameController>()
where controller.RootSourcePath == project
select controller).First();
ConventionUtility.StartCoroutine(SubWorldGameController.GameInitBySubWorld(GetRoot().InputCatch));
};
yield return ir;
// Pull Content
content.RootSourceDir = oldContentRootSourceDir;
content.SetupSongDuration = oldSetupSongDuration;
content.SetSongCurrentTime = oldSetSongCurrentTime;
*/
var ir = SceneManager.LoadSceneAsync(Editor.EditorController.SceneName, LoadSceneMode.Additive);
IEnumerator after = null;
ir.completed += x =>
{
SubWorldGameController = (from controller in FindObjectsOfType<GameController>()
where controller.RootSourcePath == project
select controller).First();
after = SubWorldGameController.GameInitBySubWorld(GetRoot().InputCatch);
};
yield return ir;
yield return after;
}
public override IEnumerator UnloadScript()