推进同化RScript
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user