浏览代码

[Feature] Distinguish Panel&EditorWindow use cases

/main
iizzaya 5 年前
当前提交
57a5ccf9
共有 3 个文件被更改,包括 18 次插入7 次删除
  1. 10
      Runtime/editor/editor_window.cs
  2. 13
      Runtime/rendering/binding.cs
  3. 2
      Runtime/widgets/binding.cs

10
Runtime/editor/editor_window.cs


public class EditorWindowAdapter : WindowAdapter {
public readonly EditorWindow editorWindow;
public EditorWindowAdapter(EditorWindow editorWindow) {
public EditorWindowAdapter(EditorWindow editorWindow):base( true) {
this.editorWindow = editorWindow;
}

public abstract class WindowAdapter : Window {
static readonly List<WindowAdapter> _windowAdapters = new List<WindowAdapter>();
public WindowAdapter(bool inEditor = false) {
this.inEditor = inEditor;
}
public static List<WindowAdapter> windowAdapters {
get { return _windowAdapters; }

this._surface = null;
}
readonly protected bool inEditor;
this._binding = new WidgetsBinding();
this._binding = new WidgetsBinding(this.inEditor);
}
SchedulerBinding._instance = this._binding;

13
Runtime/rendering/binding.cs


set { PaintingBinding.instance = value; }
}
public RendererBinding() {
public RendererBinding(bool inEditor = false) {
this._pipelineOwner = new PipelineOwner(
onNeedVisualUpdate: this.ensureVisualUpdate
);

this.initRenderView();
D.assert(this.renderView != null);
this.addPersistentFrameCallback(this._handlePersistentFrameCallback);
this.inEditor = inEditor;
this._mouseTracker = this._createMouseTracker();
}

public MouseTracker mouseTracker {
get { return this._mouseTracker; }
}
MouseTracker _mouseTracker;
public PipelineOwner pipelineOwner {

this.drawFrame();
}
readonly protected bool inEditor;
offset
);
});
offset
);
}, this.inEditor);
}
protected virtual void drawFrame() {

2
Runtime/widgets/binding.cs


set { RendererBinding.instance = value; }
}
public WidgetsBinding() {
public WidgetsBinding(bool inEditor = false) : base(inEditor) {
this.buildOwner.onBuildScheduled = this._handleBuildScheduled;
Window.instance.onLocaleChanged += this.handleLocaleChanged;
this.widgetInspectorService = new WidgetInspectorService(this);

正在加载...
取消
保存