浏览代码

[Format] Code clean up

/main
iizzaya 6 年前
当前提交
9b0be843
共有 4 个文件被更改,包括 30 次插入29 次删除
  1. 2
      Runtime/editor/editor_window.cs
  2. 5
      Runtime/editor/widgets/unity_object_detector.cs
  3. 30
      Runtime/gestures/events.cs
  4. 22
      Runtime/rendering/proxy_box.cs

2
Runtime/editor/editor_window.cs


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

5
Runtime/editor/widgets/unity_object_detector.cs


using System;
using System.Collections.Generic;
using System.Linq;
using Object = UnityEngine.Object;
namespace Unity.UIWidgets.editor {
public delegate void DragFromEditorEnterCallback();

return result;
}
}
}

30
Runtime/gestures/events.cs


delta: delta) {
}
}
public class PointerDragFromEditorEnterEvent : PointerEvent {
public PointerDragFromEditorEnterEvent(
TimeSpan timeStamp,

kind: kind,
device: device,
position: position
) { }
) {
}
public static PointerDragFromEditorEnterEvent fromDragFromEditorEvent(PointerEvent evt) {
return new PointerDragFromEditorEnterEvent(
timeStamp: evt.timeStamp,

);
}
}
public class PointerDragFromEditorExitEvent : PointerEvent {
public PointerDragFromEditorExitEvent(
TimeSpan timeStamp,

kind: kind,
device: device,
position: position
) { }
) {
}
public static PointerDragFromEditorExitEvent fromDragFromEditorEvent(PointerEvent evt) {
return new PointerDragFromEditorExitEvent(
timeStamp: evt.timeStamp,

kind: kind,
device: device,
position: position
) { }
) {
}
public static PointerDragFromEditorHoverEvent fromDragFromEditorEvent(PointerEvent evt) {
return new PointerDragFromEditorHoverEvent(
timeStamp: evt.timeStamp,

);
}
}
public class PointerDragFromEditorReleaseEvent : PointerEvent {
public PointerDragFromEditorReleaseEvent(
TimeSpan timeStamp,

}
public Object[] objectReferences;
public static PointerDragFromEditorReleaseEvent fromDragFromEditorEvent(PointerEvent evt, Object[] objectReferences) {
public static PointerDragFromEditorReleaseEvent fromDragFromEditorEvent(PointerEvent evt,
Object[] objectReferences) {
return new PointerDragFromEditorReleaseEvent(
timeStamp: evt.timeStamp,
pointer: evt.pointer,

position: position,
down: false) {
}
public static PointerHoverEvent fromHoverEvent(PointerEvent hover) {
return new PointerHoverEvent(
timeStamp: hover.timeStamp,

kind: hover.kind,
device: hover.device,
position: hover.position
);
);
}
}

position: position,
down: false) {
}
public static PointerExitEvent fromHoverEvent(PointerEvent hover) {
return new PointerExitEvent(
timeStamp: hover.timeStamp,

22
Runtime/rendering/proxy_box.cs


get { return Offset.zero & this.size; }
}
public override bool hitTest(HitTestResult result,
public override bool hitTest(HitTestResult result,
Offset position = null
) {
this._updateClip();

this._onPointerEnter = onPointerEnter;
this._onPointerHover = onPointerHover;
this._onPointerExit = onPointerExit;
this._onPointerDragFromEditorEnter = onPointerDragFromEditorEnter;
this._onPointerDragFromEditorHover = onPointerDragFromEditorHover;
this._onPointerDragFromEditorExit = onPointerDragFromEditorExit;

);
}
}
PointerDragFromEditorEnterEventListener _onPointerDragFromEditorEnter;
public PointerDragFromEditorEnterEventListener onPointerDragFromEditorEnter {

void _updateAnnotations() {
D.assert(this._onPointerEnter != this._hoverAnnotation.onEnter ||
this._onPointerHover != this._hoverAnnotation.onHover ||
this._onPointerExit != this._hoverAnnotation.onExit
this._onPointerExit != this._hoverAnnotation.onExit
|| this._onPointerDragFromEditorEnter != this._hoverAnnotation.onDragFromEditorEnter
|| this._onPointerDragFromEditorHover != this._hoverAnnotation.onDragFromEditorHover
|| this._onPointerDragFromEditorExit != this._hoverAnnotation.onDragFromEditorExit
|| this._onPointerDragFromEditorEnter != this._hoverAnnotation.onDragFromEditorEnter
|| this._onPointerDragFromEditorHover != this._hoverAnnotation.onDragFromEditorHover
|| this._onPointerDragFromEditorExit != this._hoverAnnotation.onDragFromEditorExit
|| this._onPointerDragFromEditorRelease != this._hoverAnnotation.onDragFromEditorRelease
#endif
, () => "Shouldn't call _updateAnnotations if nothing has changed.");

if (this._onPointerEnter != null ||
this._onPointerHover != null ||
this._onPointerExit != null
this._onPointerExit != null
|| this._onPointerDragFromEditorEnter != null
|| this._onPointerDragFromEditorHover != null
|| this._onPointerDragFromEditorExit != null
|| this._onPointerDragFromEditorEnter != null
|| this._onPointerDragFromEditorHover != null
|| this._onPointerDragFromEditorExit != null
|| this._onPointerDragFromEditorRelease != null
#endif
) {

正在加载...
取消
保存