public MainGameObject(UIContext uiContext, ZGameObject renderSubject) { this.uiContext = uiContext; this.renderSubject = renderSubject; RegisterListener(new InputListener(Trigger.E, x => { editMode = true; uiContext.Camera = new EditorCamera(uiContext.Camera.GetPosition(), uiContext.Camera.GetTarget()); renderSubject.Focus(); renderSubject.RegisterListener(new InputListener(Trigger.Escape, y => { this.Focus(); renderSubject.UnregisterListener(y); editMode = false; uiContext.Camera = new FPSCamera(uiContext.Camera.GetPosition(), uiContext.Camera.GetTarget()); })); })); RegisterGlobalListener(new InputListener(Trigger.CtrlS, x => { TemplateManager.Save("zdata.txt"); })); RegisterListener(new InputListener(Trigger.Escape, x => { uiContext.Exit(); })); }