void InitViews(Scene scene, LoadSceneMode mode) { switch (scene.buildIndex) { case 0: var factory = new GeneralParameterViewFactory(); var view = factory.View; if (GeneralParameterController == null) { var model = GlobalSettingsModel.GeneralParameterModel; GeneralParameterController = new GeneralParameterController(model, view); } else { GeneralParameterController.SubscribeView(view); GeneralParameterController.ReloadView(); } if (EditorController != null) { EditorController.UnsubscribeView(); } if (EditorUIController != null) { EditorUIController.UnsubscribeView(); } break; case 1: if (EditorUIController == null) { var editorUIViewFactory = new EditorUIViewFactory(); EditorUIController = new EditorUIController(GlobalSettingsModel.EditorUIModel, editorUIViewFactory.View); } else { var editorUIViewFactory = new EditorUIViewFactory(); EditorUIController.subscribeView(editorUIViewFactory.View); } if (EditorController == null) { var editorViewFactory = new EditorViewFactory(); EditorController = new EditorController(GlobalSettingsModel.EditorModel, editorViewFactory.View); EditorController.OnDisplaySceneObjectParameter += EditorUIController.DisplaySceneObjectParameter; EditorController.OnHideSceneObjectParameter += EditorUIController.HideSceneObjectParameter; } else { var editorViewFactory = new EditorViewFactory(); EditorController.SubscribeView(editorViewFactory.View); EditorController.Init(!IsGeneratingImages); } if (IsGeneratingImages) { StartCoroutine(GenerateImages()); } break; } }
public EmbeddingWrapper(EditorViewFactory factory, string id) { ID = id; this.factory = factory; }