protected override void AfterInitialize() { // this is called right after the Base-Classes Initialize-Method. _eventManager and disposableManager are set rxViews = new ReactiveCollection <DevUIView>(); // TODO: get rid of EveryUpdate Observable.EveryUpdate().Subscribe(_ => { if (UnityEngine.Input.GetKeyDown(KeyCode.F8)) { ToggleScriptingConsole(); } }).AddTo(disposables); OnEvent <Events.UIViewRenamed>().Subscribe(evt => { if (evt.view.currentFilename != null) { // there is already an representation! delete it and create it new fileSystem.RemoveFile(evt.view.currentFilename); // save to default-location but force a new name SaveViewToPath(evt.view, false, true); } }).AddTo(disposables); // on startup create some sample data ReactivePriorityExecutionList rxStartup = Kernel.Instance.rxStartup; rxStartup.Add(UtilsObservable.LoadScene(developmentSceneID), Priorities.PRIORITY_EARLY); //TODO: This is a workaround to close the dev console on start. Usually the loadDevelopmentConsole command published above should load the scene deactivated (makeActive set to false) which doesn't seem to work. // To Ensure that the rxStartup.Add(() => { CloseScriptingConsole(); }, Priorities.PRIORITY_DEFAULT); // with using PRIORITY_DEFAULT which is called after the PRIORITY_EARLY-Block it is ensured that the scene is fully loaded, before this block is executed rxStartup.Add(LoadViews().Do(pr => { logging.Info("progress:" + pr); }).Last().Select(_ => true) , Priorities.PRIORITY_DEFAULT); // Default Priority // on shutdown persist the current views Kernel.Instance.rxShutDown.Add(() => { SaveViews(); }); OnEvent <Events.PickedEntity>().Subscribe(evt => { DevUIView view = CreateViewFromEntity(evt.entity); }).AddTo(disposables); }