浏览代码

Merge pull request #9 from Unity-Technologies/1.17.4/localPosition

add local position
/main
GitHub 4 年前
当前提交
59703709
共有 47 个文件被更改,包括 2517 次插入466 次删除
  1. 33
      com.unity.uiwidgets/Runtime/cupertino/action_sheet.cs
  2. 29
      com.unity.uiwidgets/Runtime/cupertino/dialog.cs
  3. 1
      com.unity.uiwidgets/Runtime/foundation/diagnostics.cs
  4. 2
      com.unity.uiwidgets/Runtime/gestures/binding.cs
  5. 16
      com.unity.uiwidgets/Runtime/gestures/drag_details.cs
  6. 626
      com.unity.uiwidgets/Runtime/gestures/events.cs
  7. 47
      com.unity.uiwidgets/Runtime/gestures/hit_test.cs
  8. 44
      com.unity.uiwidgets/Runtime/gestures/long_press.cs
  9. 95
      com.unity.uiwidgets/Runtime/gestures/monodrag.cs
  10. 55
      com.unity.uiwidgets/Runtime/gestures/multitap.cs
  11. 79
      com.unity.uiwidgets/Runtime/gestures/pointer_router.cs
  12. 4
      com.unity.uiwidgets/Runtime/gestures/pointer_signal_resolver.cs
  13. 100
      com.unity.uiwidgets/Runtime/gestures/recognizer.cs
  14. 6
      com.unity.uiwidgets/Runtime/gestures/tap.cs
  15. 4
      com.unity.uiwidgets/Runtime/material/chip.cs
  16. 53
      com.unity.uiwidgets/Runtime/material/input_decorator.cs
  17. 16
      com.unity.uiwidgets/Runtime/material/list_tile.cs
  18. 100
      com.unity.uiwidgets/Runtime/rendering/box.cs
  19. 21
      com.unity.uiwidgets/Runtime/rendering/box.mixin.gen.cs
  20. 2
      com.unity.uiwidgets/Runtime/rendering/custom_layout.cs
  21. 2
      com.unity.uiwidgets/Runtime/rendering/custom_paint.cs
  22. 2
      com.unity.uiwidgets/Runtime/rendering/flex.cs
  23. 5
      com.unity.uiwidgets/Runtime/rendering/layer.cs
  24. 2
      com.unity.uiwidgets/Runtime/rendering/list_body.cs
  25. 2
      com.unity.uiwidgets/Runtime/rendering/list_wheel_viewport.cs
  26. 104
      com.unity.uiwidgets/Runtime/rendering/proxy_box.cs
  27. 2
      com.unity.uiwidgets/Runtime/rendering/proxy_box.mixin.gen.cs
  28. 13
      com.unity.uiwidgets/Runtime/rendering/rotated_box.cs
  29. 22
      com.unity.uiwidgets/Runtime/rendering/shifted_box.cs
  30. 115
      com.unity.uiwidgets/Runtime/rendering/sliver.cs
  31. 6
      com.unity.uiwidgets/Runtime/rendering/sliver_multi_box_adaptor.cs
  32. 14
      com.unity.uiwidgets/Runtime/rendering/sliver_padding.cs
  33. 4
      com.unity.uiwidgets/Runtime/rendering/sliver_persistent_header.cs
  34. 82
      com.unity.uiwidgets/Runtime/rendering/stack.cs
  35. 20
      com.unity.uiwidgets/Runtime/rendering/table.cs
  36. 2
      com.unity.uiwidgets/Runtime/rendering/view.cs
  37. 25
      com.unity.uiwidgets/Runtime/rendering/viewport.cs
  38. 2
      com.unity.uiwidgets/Runtime/rendering/wrap.cs
  39. 34
      com.unity.uiwidgets/Runtime/ui/Matrix4.cs
  40. 2
      com.unity.uiwidgets/Runtime/widgets/layout_builder.cs
  41. 2
      com.unity.uiwidgets/Runtime/widgets/nested_scroll_view.cs
  42. 490
      com.unity.uiwidgets/Runtime/widgets/overlay.cs
  43. 19
      com.unity.uiwidgets/Runtime/widgets/single_child_scroll_view.cs
  44. 125
      Samples/UIWidgetsSamples_2019_4/Assets/ReduxSample/LocalPositionSample.cs
  45. 11
      Samples/UIWidgetsSamples_2019_4/Assets/ReduxSample/LocalPositionSample.cs.meta
  46. 536
      Samples/UIWidgetsSamples_2019_4/Assets/Scenes/LocalPosition.unity
  47. 7
      Samples/UIWidgetsSamples_2019_4/Assets/Scenes/LocalPosition.unity.meta

33
com.unity.uiwidgets/Runtime/cupertino/action_sheet.cs


}
class _CupertinoAlertRenderElement : RenderObjectElement {
public _CupertinoAlertRenderElement(_CupertinoAlertRenderWidget widget) : base(widget) { }
public _CupertinoAlertRenderElement(_CupertinoAlertRenderWidget widget) : base(widget) {
}
Element _contentElement;
Element _actionsElement;

);
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
bool isHit = false;
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
;
if (this.contentSection.hitTest(result, position: position - contentSectionParentData.offset)) {
isHit = true;
}
else if (this.actionsSection.hitTest(result,
position: position - actionsSectionParentData.offset)) {
isHit = true;
}
return isHit;
return result.addWithPaintOffset(
offset: contentSectionParentData.offset,
position: position,
hitTest: (BoxHitTestResult resultIn, Offset transformed) => {
D.assert(transformed == position - contentSectionParentData.offset);
return this.contentSection.hitTest(resultIn, position: transformed);
}
) || result.addWithPaintOffset(
offset: actionsSectionParentData.offset,
position: position,
hitTest: (BoxHitTestResult resultIn, Offset transformed) => {
D.assert(transformed == position - actionsSectionParentData.offset);
return this.actionsSection.hitTest(resultIn, position: transformed);
}
);
}
}

}
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
return this.defaultHitTestChildren(result, position: position);
}
}

29
com.unity.uiwidgets/Runtime/cupertino/dialog.cs


);
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null
bool isHit = false;
;
if (this.contentSection.hitTest(result, position: position - contentSectionParentData.offset)) {
isHit = true;
}
else if (this.actionsSection.hitTest(result, position: position - actionsSectionParentData.offset)) {
isHit = true;
}
return isHit;
return result.addWithPaintOffset(
offset: contentSectionParentData.offset,
position: position,
hitTest: (BoxHitTestResult resultIn, Offset transformed) => {
D.assert(transformed == position - contentSectionParentData.offset);
return this.contentSection.hitTest(resultIn, position: transformed);
}
) || result.addWithPaintOffset(
offset: actionsSectionParentData.offset,
position: position,
hitTest: (BoxHitTestResult resultIn, Offset transformed) => {
D.assert(transformed == position - actionsSectionParentData.offset);
return this.actionsSection.hitTest(resultIn, position: transformed);
}
);
}
}

}
}
protected override bool hitTestChildren(HitTestResult result,
protected override bool hitTestChildren(BoxHitTestResult result,
Offset position = null
) {
return this.defaultHitTestChildren(result, position: position);

1
com.unity.uiwidgets/Runtime/foundation/diagnostics.cs


transition,
whitespace,
singleLine,
errorProperty,
}
public class TextTreeConfiguration {

2
com.unity.uiwidgets/Runtime/gestures/binding.cs


foreach (HitTestEntry entry in hitTestResult.path) {
try {
entry.target.handleEvent(evt, entry);
entry.target.handleEvent(evt.transformed(entry.transform), entry);
}
catch (Exception ex) {
D.logError("Error while dispatching a pointer event: ", ex);

16
com.unity.uiwidgets/Runtime/gestures/drag_details.cs


namespace Unity.UIWidgets.gestures {
public class DragDownDetails {
public DragDownDetails(
Offset globalPosition = null
Offset globalPosition = null,
Offset localPosition = null
this.localPosition = localPosition ?? this.globalPosition;
public readonly Offset localPosition;
public override string ToString() {
return this.GetType() + "(" + this.globalPosition + ")";

public delegate void GestureDragDownCallback(DragDownDetails details);
public class DragStartDetails {
public DragStartDetails(TimeSpan sourceTimeStamp, Offset globalPosition = null) {
public DragStartDetails(
TimeSpan sourceTimeStamp,
Offset globalPosition = null,
Offset localPosition = null
) {
this.localPosition = localPosition ?? this.globalPosition;
public readonly Offset localPosition;
public override string ToString() {
return this.GetType() + "(" + this.globalPosition + ")";

Offset delta = null,
float? primaryDelta = null,
Offset globalPosition = null,
Offset localPosition = null,
this.localPosition = localPosition ?? this.globalPosition;
this.isScroll = isScroll;
D.assert(primaryDelta == null
|| primaryDelta == this.delta.dx && this.delta.dy == 0.0

public readonly float? primaryDelta;
public readonly Offset globalPosition;
public readonly Offset localPosition;
public readonly bool isScroll;

626
com.unity.uiwidgets/Runtime/gestures/events.cs


using System;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using UnityEngine;
using Object = UnityEngine.Object;
namespace Unity.UIWidgets.gestures {

PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = null,
Offset localPosition = null,
Offset localDelta = null,
int buttons = 0,
bool down = false,
bool obscured = false,

float orientation = 0.0f,
float tilt = 0.0f,
int platformData = 0,
bool synthesized = false
bool synthesized = false,
Matrix4 transform = null,
PointerEvent original = null
) {
this.timeStamp = timeStamp;
this.pointer = pointer;

this.localPosition = localPosition ?? this.position;
this.localDelta = delta ?? this.delta;
this.buttons = buttons;
this.down = down;
this.obscured = obscured;

this.tilt = tilt;
this.platformData = platformData;
this.synthesized = synthesized;
this.transform = transform;
this.original = original;
}
public readonly TimeSpan timeStamp;

public readonly Offset position;
public readonly Offset localPosition;
public readonly Offset localDelta;
public readonly int buttons;

public readonly bool synthesized;
public readonly Matrix4 transform;
public readonly PointerEvent original;
public abstract PointerEvent transformed(Matrix4 transform);
properties.add(new DiagnosticsProperty<Offset>("localPosition", this.localPosition));
level: DiagnosticLevel.debug));
properties.add(new DiagnosticsProperty<Offset>("localDelta", this.localDelta, defaultValue: Offset.zero,
level: DiagnosticLevel.debug));
properties.add(new DiagnosticsProperty<TimeSpan>("timeStamp", this.timeStamp, defaultValue: TimeSpan.Zero,
level: DiagnosticLevel.debug));

properties.add(new FlagProperty("synthesized", value: this.synthesized, ifTrue: "synthesized",
level: DiagnosticLevel.debug));
}
public static Offset transformPosition(Matrix4 transform, Offset position) {
if (transform == null) {
return position;
}
Vector3 position3 = new Vector3(position.dx, position.dy, 0.0f);
Vector3 transformed3 = transform.perspectiveTransform(position3);
return new Offset(transformed3.x, transformed3.y);
}
public static Offset transformDeltaViaPositions(
Offset untransformedEndPosition,
Offset untransformedDelta,
Matrix4 transform,
Offset transformedEndPosition = null
) {
if (transform == null) {
return untransformedDelta;
}
transformedEndPosition = transformedEndPosition ?? transformPosition(transform, untransformedEndPosition);
Offset transformedStartPosition =
transformPosition(transform, untransformedEndPosition - untransformedDelta);
return transformedEndPosition - transformedStartPosition;
}
public static Matrix4 removePerspectiveTransform(Matrix4 transform) {
Vector4 vector = new Vector4(0, 0, 1, 0);
var result = transform.clone();
result.setColumn(2, vector);
result.setRow(2, vector);
return result;
}
}
public class PointerAddedEvent : PointerEvent {

int device = 0,
Offset position = null,
Offset localPosition = null,
bool obscured = false,
float pressure = 0.0f,
float pressureMin = 1.0f,

float radiusMin = 0.0f,
float radiusMax = 0.0f,
float orientation = 0.0f,
float tilt = 0.0f
float tilt = 0.0f,
Matrix4 transform = null,
PointerAddedEvent original = null
localPosition: localPosition,
obscured: obscured,
pressure: pressure,
pressureMin: pressureMin,

radiusMin: radiusMin,
radiusMax: radiusMax,
orientation: orientation,
tilt: tilt
tilt: tilt,
transform: transform,
original: original
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
return new PointerAddedEvent(
timeStamp: this.timeStamp,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: PointerEvent.transformPosition(transform, this.position),
obscured: this.obscured,
pressureMin: this.pressureMin,
pressureMax: this.pressureMax,
distance: this.distance,
distanceMax: this.distanceMax,
radiusMin: this.radiusMin,
radiusMax: this.radiusMax,
orientation: this.orientation,
tilt: this.tilt,
transform: this.transform,
original: this.original as PointerAddedEvent ?? this
);
}
}
public class PointerRemovedEvent : PointerEvent {

int device = 0,
Offset position = null,
Offset localPosition = null,
bool obscured = false,
float pressure = 0.0f,
float pressureMin = 1.0f,

float radiusMax = 0.0f
float radiusMax = 0.0f,
Matrix4 transform = null,
PointerRemovedEvent original = null
position: position,
localPosition: localPosition,
device: device,
obscured: obscured,
pressure: pressure,

radiusMin: radiusMin,
radiusMax: radiusMax
radiusMax: radiusMax,
transform: transform,
original: original
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
return new PointerRemovedEvent(
timeStamp: this.timeStamp,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: PointerEvent.transformPosition(transform, this.position),
obscured: this.obscured,
pressureMin: this.pressureMin,
pressureMax: this.pressureMax,
distanceMax: this.distanceMax,
radiusMin: this.radiusMin,
radiusMax: this.radiusMax,
transform: transform,
original: this.original as PointerRemovedEvent ?? this
);
}
}
public class PointerHoverEvent : PointerEvent {

int device = 0,
Offset position = null,
Offset localPosition = null,
Offset localDelta = null,
int buttons = 0,
bool obscured = false,
float pressure = 0.0f,

float radiusMax = 0.0f,
float orientation = 0.0f,
float tilt = 0.0f,
bool synthesized = false) : base(
bool synthesized = false,
Matrix4 transform = null,
PointerHoverEvent original = null) : base(
localPosition: localDelta,
localDelta: localDelta,
buttons: buttons,
obscured: obscured,
pressure: pressure,

radiusMax: radiusMax,
orientation: orientation,
tilt: tilt,
synthesized: synthesized) {
synthesized: synthesized,
transform: transform,
original: original) {
}
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
Offset transformedPosition = PointerEvent.transformPosition(transform, this.position);
return new PointerHoverEvent(
timeStamp: this.timeStamp,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: transformedPosition,
delta: this.delta,
localDelta: PointerEvent.transformDeltaViaPositions(
transform: transform,
untransformedDelta: this.delta,
untransformedEndPosition: this.position,
transformedEndPosition: transformedPosition
),
buttons: this.buttons,
obscured: this.obscured,
pressureMin: this.pressureMin,
pressureMax: this.pressureMax,
distance: this.distance,
distanceMax: this.distanceMax,
size: this.size,
radiusMajor: this.radiusMajor,
radiusMinor: this.radiusMinor,
radiusMin: this.radiusMin,
radiusMax: this.radiusMax,
orientation: this.orientation,
tilt: this.tilt,
synthesized: this.synthesized,
transform: transform,
original: this.original as PointerHoverEvent ?? this);
}
}

PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = null,
Offset localPosition = null,
Offset localDelta = null,
int buttons = 0,
bool obscured = false,
float pressure = 0.0f,

float orientation = 0.0f,
float tilt = 0.0f,
bool synthesized = false,
bool down = false) : base(
bool down = false,
Matrix4 transform = null,
PointerEnterEvent original = null) : base(
localPosition: localPosition,
localDelta: localDelta,
buttons: buttons,
down: down,
obscured: obscured,

radiusMax: radiusMax,
orientation: orientation,
tilt: tilt,
synthesized: synthesized) {
synthesized: synthesized,
transform: transform,
original: original) {
}
public static PointerEnterEvent fromHoverEvent(PointerHoverEvent e) {

kind: hover?.kind ?? PointerDeviceKind.touch,
device: hover?.device ?? 0,
position: hover?.position,
localPosition: hover?.localPosition,
localDelta: hover?.localDelta,
buttons: hover?.buttons ?? 0,
down: hover?.down ?? false,
obscured: hover?.obscured ?? false,

radiusMax: hover?.radiusMax ?? 0.0f,
orientation: hover?.orientation ?? 0.0f,
tilt: hover?.tilt ?? 0.0f,
synthesized: hover?.synthesized ?? false
synthesized: hover?.synthesized ?? false,
transform: hover?.transform,
original: hover?.original as PointerEnterEvent
);
}
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
Offset transformedPosition = PointerEvent.transformPosition(transform, this.position);
return new PointerEnterEvent(
timeStamp: this.timeStamp,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: transformedPosition,
delta: this.delta,
localDelta: PointerEvent.transformDeltaViaPositions(
transform: transform,
untransformedDelta: this.delta,
untransformedEndPosition: this.position,
transformedEndPosition: transformedPosition
),
buttons: this.buttons,
obscured: this.obscured,
pressureMin: this.pressureMin,
pressureMax: this.pressureMax,
distance: this.distance,
distanceMax: this.distanceMax,
size: this.size,
radiusMajor: this.radiusMajor,
radiusMinor: this.radiusMinor,
radiusMin: this.radiusMin,
radiusMax: this.radiusMax,
orientation: this.orientation,
tilt: this.tilt,
down: this.down,
synthesized: this.synthesized,
transform: transform,
original: this.original as PointerEnterEvent ?? this
);
}
}

PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = null,
Offset localPosition = null,
Offset localDelta = null,
int buttons = 0,
bool obscured = false,
float pressure = 0.0f,

float orientation = 0.0f,
float tilt = 0.0f,
bool synthesized = false,
bool down = false) : base(
bool down = false,
Matrix4 transform = null,
PointerExitEvent original = null) : base(
localPosition: localPosition,
localDelta: localDelta,
buttons: buttons,
down: down,
obscured: obscured,

radiusMax: radiusMax,
orientation: orientation,
tilt: tilt,
synthesized: synthesized) {
synthesized: synthesized,
transform: transform,
original: original) {
public static PointerExitEvent fromHoverEvent(PointerHoverEvent e) {
return fromMouseEvent(e);
}

kind: hover?.kind ?? PointerDeviceKind.touch,
device: hover?.device ?? 0,
position: hover?.position,
localPosition: hover?.localPosition,
localDelta: hover?.localDelta,
buttons: hover?.buttons ?? 0,
down: hover?.down ?? false,
obscured: hover?.obscured ?? false,

radiusMax: hover?.radiusMax ?? 0.0f,
orientation: hover?.orientation ?? 0.0f,
tilt: hover?.tilt ?? 0.0f,
synthesized: hover?.synthesized ?? false
synthesized: hover?.synthesized ?? false,
transform: hover?.transform,
original: hover?.original as PointerExitEvent
);
}
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
Offset transformedPosition = PointerEvent.transformPosition(transform, this.position);
return new PointerExitEvent(
timeStamp: this.timeStamp,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: transformedPosition,
delta: this.delta,
localDelta: PointerEvent.transformDeltaViaPositions(
transform: transform,
untransformedDelta: this.delta,
untransformedEndPosition: this.position,
transformedEndPosition: transformedPosition
),
buttons: this.buttons,
obscured: this.obscured,
pressureMin: this.pressureMin,
pressureMax: this.pressureMax,
distance: this.distance,
distanceMax: this.distanceMax,
size: this.size,
radiusMajor: this.radiusMajor,
radiusMinor: this.radiusMinor,
radiusMin: this.radiusMin,
radiusMax: this.radiusMax,
orientation: this.orientation,
tilt: this.tilt,
down: this.down,
synthesized: this.synthesized,
transform: transform,
original: this.original as PointerExitEvent ?? this
);
}
}

PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = null,
Offset localPosition = null,
int buttons = 0,
bool obscured = false,
float pressure = 0.0f,

float radiusMin = 0.0f,
float radiusMax = 0.0f,
float orientation = 0.0f,
float tilt = 0.0f
float tilt = 0.0f,
Matrix4 transform = null,
PointerDownEvent original = null
) : base(
timeStamp: timeStamp,
pointer: pointer,

localPosition: localPosition,
buttons: buttons,
down: true,
obscured: obscured,

radiusMin: radiusMin,
radiusMax: radiusMax,
orientation: orientation,
tilt: tilt) {
tilt: tilt,
transform: transform,
original: original) {
}
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
return new PointerDownEvent(
timeStamp: this.timeStamp,
pointer: this.pointer,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: PointerEvent.transformPosition(transform, this.position),
buttons: this.buttons,
obscured: this.obscured,
pressure: this.pressure,
pressureMin: this.pressureMin,
pressureMax: this.pressureMax,
distanceMax: this.distanceMax,
size: this.size,
radiusMajor: this.radiusMajor,
radiusMinor: this.radiusMinor,
radiusMin: this.radiusMin,
radiusMax: this.radiusMax,
orientation: this.orientation,
tilt: this.tilt,
transform: transform,
original: this.original as PointerDownEvent ?? this
);
}
}

PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = null,
Offset localPosition = null,
Offset localDelta = null,
int buttons = 0,
bool obscured = false,
float pressure = 0.0f,

float orientation = 0.0f,
float tilt = 0.0f,
int platformdData = 0,
bool synthesized = false
bool synthesized = false,
Matrix4 transform = null,
PointerMoveEvent original = null
) : base(
timeStamp: timeStamp,
pointer: pointer,

localPosition: localPosition,
localDelta: localDelta,
buttons: buttons,
down: true,
obscured: obscured,

orientation: orientation,
tilt: tilt,
platformData: platformdData,
synthesized: synthesized) {
synthesized: synthesized,
transform: transform,
original: original) {
}
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
Offset transformedPosition = PointerEvent.transformPosition(transform, this.position);
return new PointerMoveEvent(
timeStamp: this.timeStamp,
pointer: this.pointer,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: transformedPosition,
delta: this.delta,
localDelta: PointerEvent.transformDeltaViaPositions(
transform: transform,
untransformedDelta: this.delta,
untransformedEndPosition: this.position,
transformedEndPosition: transformedPosition
),
buttons: this.buttons,
obscured: this.obscured,
pressure: this.pressure,
pressureMin: this.pressureMin,
pressureMax: this.pressureMax,
distanceMax: this.distanceMax,
size: this.size,
radiusMajor: this.radiusMajor,
radiusMinor: this.radiusMinor,
radiusMin: this.radiusMin,
radiusMax: this.radiusMax,
orientation: this.orientation,
tilt: this.tilt,
// platformData: platformData,
synthesized: this.synthesized,
transform: transform,
original: this.original as PointerMoveEvent ?? this
);
}
}

PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = null,
Offset localPosition = null,
int buttons = 0,
bool obscured = false,
float pressure = 0.0f,

float radiusMin = 0.0f,
float radiusMax = 0.0f,
float orientation = 0.0f,
float tilt = 0.0f
float tilt = 0.0f,
Matrix4 transform = null,
PointerUpEvent original = null
) : base(
timeStamp: timeStamp,
pointer: pointer,

localPosition: localPosition,
buttons: buttons,
down: false,
obscured: obscured,

radiusMin: radiusMin,
radiusMax: radiusMax,
orientation: orientation,
tilt: tilt) {
tilt: tilt,
transform: transform,
original: original) {
}
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
return new PointerUpEvent(
timeStamp: this.timeStamp,
pointer: this.pointer,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: PointerEvent.transformPosition(transform, this.position),
buttons: this.buttons,
obscured: this.obscured,
pressure: this.pressure,
pressureMin: this.pressureMin,
pressureMax: this.pressureMax,
distance: this.distance,
distanceMax: this.distanceMax,
size: this.size,
radiusMajor: this.radiusMajor,
radiusMinor: this.radiusMinor,
radiusMin: this.radiusMin,
radiusMax: this.radiusMax,
orientation: this.orientation,
tilt: this.tilt,
transform: transform,
original: this.original as PointerUpEvent ?? this
);
public class PointerSignalEvent : PointerEvent {
public abstract class PointerSignalEvent : PointerEvent {
Offset position = null
Offset position = null,
Offset localPosition = null,
Matrix4 transform = null,
PointerSignalEvent original = null
position: position
position: position,
localPosition: localPosition,
transform: transform,
original: original
) {
}
}

PointerDeviceKind kind = PointerDeviceKind.mouse,
int device = 0,
Offset position = null,
Offset scrollDelta = null)
Offset localPosition = null,
Offset scrollDelta = null,
Matrix4 transform = null,
PointerScrollEvent original = null)
position: position) {
position: position,
localPosition: localPosition,
transform: transform,
original: original) {
D.assert(position != null);
D.assert(scrollDelta != null);
this.scrollDelta = scrollDelta;

public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
return new PointerScrollEvent(
timeStamp: this.timeStamp,
pointer: this.pointer,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: PointerEvent.transformPosition(transform, this.position),
scrollDelta: this.scrollDelta,
transform: transform,
original: this.original as PointerScrollEvent ?? this
);
}
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new DiagnosticsProperty<Offset>("scrollDelta", this.scrollDelta));

PointerDeviceKind kind = PointerDeviceKind.touch,
int device = 0,
Offset position = null,
Offset localPosition = null,
int buttons = 0,
bool obscured = false,
float pressure = 0.0f,

float radiusMin = 0.0f,
float radiusMax = 0.0f,
float orientation = 0.0f,
float tilt = 0.0f
float tilt = 0.0f,
Matrix4 transform = null,
PointerCancelEvent original = null
) : base(
timeStamp: timeStamp,
pointer: pointer,

localPosition: localPosition,
buttons: buttons,
down: false,
obscured: obscured,

radiusMin: radiusMin,
radiusMax: radiusMax,
orientation: orientation,
tilt: tilt) {
tilt: tilt,
transform: transform,
original: original) {
}
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
return new PointerCancelEvent(
timeStamp: this.timeStamp,
pointer: this.pointer,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: PointerEvent.transformPosition(transform, this.position),
buttons: this.buttons,
obscured: this.obscured,
pressureMin: this.pressureMin,
pressureMax: this.pressureMax,
distance: this.distance,
distanceMax: this.distanceMax,
size: this.size,
radiusMajor: this.radiusMajor,
radiusMinor: this.radiusMinor,
radiusMin: this.radiusMin,
radiusMax: this.radiusMax,
orientation: this.orientation,
tilt: this.tilt,
transform: transform,
original: this.original as PointerCancelEvent ?? this
);
}
}

int pointer = 0,
PointerDeviceKind kind = PointerDeviceKind.mouse,
int device = 0,
Offset position = null
Offset position = null,
Offset localPosition = null,
Matrix4 transform = null,
PointerDragFromEditorEnterEvent original = null
position: position
position: position,
localPosition: localPosition,
transform: transform,
original: original
) {
}

pointer: evt.pointer,
kind: evt.kind,
device: evt.device,
position: evt.position
position: evt.position,
localPosition: evt.localPosition,
transform: evt.transform,
original: evt.original as PointerDragFromEditorEnterEvent
);
}
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
return new PointerDragFromEditorEnterEvent(
timeStamp: this.timeStamp,
pointer: this.pointer,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: PointerEvent.transformPosition(transform, this.position),
transform: transform,
original: this.original as PointerDragFromEditorEnterEvent ?? this
);
}
}

int pointer = 0,
PointerDeviceKind kind = PointerDeviceKind.mouse,
int device = 0,
Offset position = null
Offset position = null,
Offset localPosition = null,
Matrix4 transform = null,
PointerDragFromEditorExitEvent original = null
position: position
position: position,
localPosition: localPosition,
transform: transform,
original: original
) {
}

pointer: evt.pointer,
kind: evt.kind,
device: evt.device,
position: evt.position
position: evt.position,
localPosition: evt.localPosition,
transform: evt.transform,
original: evt.original as PointerDragFromEditorExitEvent
);
}
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
return new PointerDragFromEditorExitEvent(
timeStamp: this.timeStamp,
pointer: this.pointer,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: PointerEvent.transformPosition(transform, this.position),
transform: transform,
original: this.original as PointerDragFromEditorExitEvent ?? this
);
}
}

int pointer = 0,
PointerDeviceKind kind = PointerDeviceKind.mouse,
int device = 0,
Offset position = null
Offset position = null,
Offset localPosition = null,
Matrix4 transform = null,
PointerDragFromEditorHoverEvent original = null
position: position
position: position,
localPosition: localPosition,
transform: transform,
original: original
) {
}

pointer: evt.pointer,
kind: evt.kind,
device: evt.device,
position: evt.position
position: evt.position,
localPosition: evt.localPosition,
transform: evt.transform,
original: evt.original as PointerDragFromEditorHoverEvent
);
}
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
return new PointerDragFromEditorHoverEvent(
timeStamp: this.timeStamp,
pointer: this.pointer,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: PointerEvent.transformPosition(transform, this.position),
transform: this.transform,
original: this.original as PointerDragFromEditorHoverEvent ?? this
);
}
}

PointerDeviceKind kind = PointerDeviceKind.mouse,
int device = 0,
Offset position = null,
Object[] objectReferences = null
Offset localPosition = null,
Object[] objectReferences = null,
Matrix4 transform = null,
PointerDragFromEditorReleaseEvent original = null
position: position
position: position,
localPosition: localPosition,
transform: transform,
original: original
) {
this.objectReferences = objectReferences;
}

kind: evt.kind,
device: evt.device,
position: evt.position,
objectReferences: objectReferences
localPosition: evt.localPosition,
objectReferences: objectReferences,
transform: evt.transform,
original: evt.original as PointerDragFromEditorReleaseEvent
);
}
public override PointerEvent transformed(Matrix4 transform) {
if (transform == null || transform == this.transform) {
return this;
}
return new PointerDragFromEditorReleaseEvent(
timeStamp: this.timeStamp,
pointer: this.pointer,
kind: this.kind,
device: this.device,
position: this.position,
localPosition: PointerEvent.transformPosition(transform, this.position),
objectReferences: this.objectReferences,
transform: this.transform,
original: this.original as PointerDragFromEditorReleaseEvent ?? this
);
}
}

47
com.unity.uiwidgets/Runtime/gestures/hit_test.cs


using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.rendering;
using UnityEngine;
namespace Unity.UIWidgets.gestures {
public interface HitTestable {

public override string ToString() {
return this._target.ToString();
}
public Matrix4 transform {
get { return this._transform; }
}
internal Matrix4 _transform;
public HitTestResult(List<HitTestEntry> path = null) {
this._path = path ?? new List<HitTestEntry>();
public HitTestResult() {
this._path = new List<HitTestEntry>();
this._transforms = new LinkedList<Matrix4>();
}
public HitTestResult(HitTestResult result) {
this._path = result._path;
this._transforms = result._transforms;
}
public IList<HitTestEntry> path {

readonly List<HitTestEntry> _path;
readonly LinkedList<Matrix4> _transforms;
D.assert(entry.transform == null);
entry._transform = this._transforms.isEmpty() ? null : this._transforms.Last();
}
protected void pushTransform(Matrix4 transform) {
D.assert(transform != null);
D.assert(
this._debugVectorMoreOrLessEquals(transform.getRow(2), new Vector4(0, 0, 1, 0)) &&
this._debugVectorMoreOrLessEquals(transform.getColumn(2), new Vector4(0, 0, 1, 0))
);
this._transforms.AddLast(this._transforms.isEmpty()
? transform
: (transform * this._transforms.Last() as Matrix4));
}
protected void popTransform() {
D.assert(this._transforms.isNotEmpty);
this._transforms.RemoveLast();
}
bool _debugVectorMoreOrLessEquals(Vector4 a, Vector4 b,
double epsilon = SliverGeometry.precisionErrorTolerance) {
bool result = true;
D.assert(() => {
Vector4 difference = a - b;
return difference.SqrMagnitude() < epsilon;
});
return result;
}
public override string ToString() {

44
com.unity.uiwidgets/Runtime/gestures/long_press.cs


public class LongPressStartDetails {
public LongPressStartDetails(
Offset globalPosition = null
Offset globalPosition = null,
Offset localPosition = null
this.localPosition = localPosition ?? this.globalPosition;
public readonly Offset localPosition;
Offset offsetFromOrigin = null
Offset localPosition = null,
Offset offsetFromOrigin = null,
Offset localOffsetFromOrigin = null
this.localPosition = localPosition ?? this.globalPosition;
this.localOffsetFromOrigin = localOffsetFromOrigin ?? this.offsetFromOrigin;
public readonly Offset localPosition;
public readonly Offset localOffsetFromOrigin;
Offset globalPosition = null
Offset globalPosition = null,
Offset localPosition = null
this.localPosition = localPosition ?? this.globalPosition;
this.velocity = Velocity.zero;
public readonly Offset localPosition;
public readonly Velocity velocity;
TimeSpan? duration = null,
deadline: Constants.kLongPressTimeout,
deadline: duration ?? Constants.kLongPressTimeout,
postAcceptSlopTolerance: postAcceptSlopTolerance,
kind: kind,
debugOwner: debugOwner) { }

Offset _longPressOrigin;
OffsetPair _longPressOrigin;
int _initialButtons;
public GestureLongPressCallback onLongPress;

public GestureLongPressEndCallback onLongPressEnd;
VelocityTracker _velocityTracker;
protected override void didExceedDeadline() {
this.resolve(GestureDisposition.accepted);
this._longPressAccepted = true;

if (this.onLongPressStart != null) {
this.invokeCallback<object>("onLongPressStart",
() => {
this.onLongPressStart(new LongPressStartDetails(globalPosition: this._longPressOrigin));
this.onLongPressStart(new LongPressStartDetails(
globalPosition: this._longPressOrigin.global,
localPosition:this._longPressOrigin.local
));
return null;
});
}

if (this.onLongPressEnd != null) {
this.invokeCallback<object>("onLongPressEnd", () => {
this.onLongPressEnd(new LongPressEndDetails(globalPosition: evt.position));
this.onLongPressEnd(new LongPressEndDetails(
globalPosition: evt.position,
localPosition: evt.localPosition));
return null;
});
}

}
else if (evt is PointerDownEvent || evt is PointerCancelEvent) {
this._longPressAccepted = false;
this._longPressOrigin = evt.position;
this._longPressOrigin = OffsetPair.fromEventPosition(evt);
offsetFromOrigin: evt.position - this._longPressOrigin
localPosition: evt.localPosition,
offsetFromOrigin: evt.position - this._longPressOrigin.global,
localOffsetFromOrigin: evt.localPosition - this._longPressOrigin.local
));
return null;
});

95
com.unity.uiwidgets/Runtime/gestures/monodrag.cs


public float? maxFlingVelocity;
_DragState _state = _DragState.ready;
Offset _initialPosition;
protected Offset _pendingDragOffset;
OffsetPair _initialPosition;
protected OffsetPair _pendingDragOffset;
Matrix4 _lastTransform;
protected float _globalDistanceMoved;
protected abstract bool _hasSufficientPendingDragDeltaToAccept { get; }
protected abstract bool _hasSufficientGlobalDistanceToAccept { get; }
readonly Dictionary<int, VelocityTracker> _velocityTrackers = new Dictionary<int, VelocityTracker>();

this._state = _DragState.possible;
this._initialPosition = evt.position;
this._initialPosition = new OffsetPair(global: evt.position, local: evt.localPosition);
globalPosition: this._initialPosition
globalPosition: this._initialPosition.global,
localPosition: this._initialPosition.local
));
return null;
});

public override void addAllowedPointer(PointerDownEvent evt) {
this.startTrackingPointer(evt.pointer);
this.startTrackingPointer(evt.pointer, evt.transform);
this._initialPosition = evt.position;
this._pendingDragOffset = Offset.zero;
this._initialPosition = new OffsetPair(global: evt.position, local: evt.localPosition);
this._pendingDragOffset = OffsetPair.zero;
this._globalDistanceMoved = 0f;
this._lastTransform = evt.transform;
this.onDown(new DragDownDetails(globalPosition: this._initialPosition));
this.onDown(new DragDownDetails(
globalPosition: this._initialPosition.global,
localPosition: this._initialPosition.local));
return null;
});
}

delta: this._getDeltaForDetails(delta),
primaryDelta: this._getPrimaryValueFromOffset(delta),
globalPosition: evt.position,
localPosition: evt.localPosition,
isScroll: true
));
return null;

&& (evt is PointerDownEvent || evt is PointerMoveEvent)) {
var tracker = this._velocityTrackers[evt.pointer];
D.assert(tracker != null);
tracker.addPosition(evt.timeStamp, evt.position);
tracker.addPosition(evt.timeStamp, evt.localPosition);
Offset delta = evt.delta;
delta: this._getDeltaForDetails(delta),
primaryDelta: this._getPrimaryValueFromOffset(delta),
globalPosition: evt.position
delta: this._getDeltaForDetails(evt.localDelta),
primaryDelta: this._getPrimaryValueFromOffset(evt.localDelta),
globalPosition: evt.position,
localPosition: evt.localPosition
));
return null;
});

this._pendingDragOffset += delta;
this._pendingDragOffset += new OffsetPair(local: evt.localDelta, global: evt.delta);
if (this._hasSufficientPendingDragDeltaToAccept) {
this._lastTransform = evt.transform;
Offset movedLocally = this._getDeltaForDetails(evt.localDelta);
Matrix4 localToGlobalTransform = evt.transform == null ? null : Matrix4.tryInvert(evt.transform);
this._globalDistanceMoved += PointerEvent.transformDeltaViaPositions(
transform: localToGlobalTransform,
untransformedDelta: movedLocally,
untransformedEndPosition: evt.localPosition
).distance * (this._getPrimaryValueFromOffset(movedLocally) ?? 1).sign();
if (this._hasSufficientGlobalDistanceToAccept) {
this.resolve(GestureDisposition.accepted);
}
}

public override void acceptGesture(int pointer) {
if (this._state != _DragState.accepted) {
this._state = _DragState.accepted;
Offset delta = this._pendingDragOffset;
OffsetPair delta = this._pendingDragOffset;
Matrix4 transform = this._lastTransform;
Offset updateDelta = null;
Offset localUpdateDelta = null;
updateDelta = Offset.zero;
localUpdateDelta = Offset.zero;
updateDelta = this._getDeltaForDetails(delta);
localUpdateDelta = this._getDeltaForDetails(delta.local);
D.assert(updateDelta != null);
D.assert(localUpdateDelta != null);
this._pendingDragOffset = Offset.zero;
this._pendingDragOffset = OffsetPair.zero;
this._lastTransform = null;
globalPosition: this._initialPosition
globalPosition: this._initialPosition.global,
localPosition: this._initialPosition.local
if (updateDelta != Offset.zero && this.onUpdate != null) {
if (localUpdateDelta != Offset.zero && this.onUpdate != null) {
Matrix4 localToGlobal = transform != null ? Matrix4.tryInvert(transform) : null;
Offset correctedLocalPosition = this._initialPosition.local + localUpdateDelta;
Offset globalUpdateDelta = PointerEvent.transformDeltaViaPositions(
untransformedEndPosition: correctedLocalPosition,
untransformedDelta: localUpdateDelta,
transform: localToGlobal
);
OffsetPair updateDelta = new OffsetPair(local: localUpdateDelta, global: globalUpdateDelta);
OffsetPair correctedPosition = this._initialPosition + updateDelta; // Only adds delta for down behaviour
delta: updateDelta,
primaryDelta: this._getPrimaryValueFromOffset(updateDelta),
globalPosition: this._initialPosition + updateDelta
delta: localUpdateDelta,
primaryDelta: this._getPrimaryValueFromOffset(localUpdateDelta),
globalPosition: this._initialPosition.global,
localPosition: this._initialPosition.local
));
return null;
});

return Mathf.Abs(estimate.pixelsPerSecond.dy) > minVelocity && Mathf.Abs(estimate.offset.dy) > minDistance;
}
protected override bool _hasSufficientPendingDragDeltaToAccept {
get { return Mathf.Abs(this._pendingDragOffset.dy) > Constants.kTouchSlop; }
protected override bool _hasSufficientGlobalDistanceToAccept {
get { return Mathf.Abs(this._globalDistanceMoved) > Constants.kTouchSlop; }
}
protected override Offset _getDeltaForDetails(Offset delta) {

return Mathf.Abs(estimate.pixelsPerSecond.dx) > minVelocity && Mathf.Abs(estimate.offset.dx) > minDistance;
}
protected override bool _hasSufficientPendingDragDeltaToAccept {
get { return Mathf.Abs(this._pendingDragOffset.dx) > Constants.kTouchSlop; }
protected override bool _hasSufficientGlobalDistanceToAccept {
get { return Mathf.Abs(this._globalDistanceMoved) > Constants.kTouchSlop; }
}
protected override Offset _getDeltaForDetails(Offset delta) {

&& estimate.offset.distanceSquared > minDistance * minDistance;
}
protected override bool _hasSufficientPendingDragDeltaToAccept {
get { return this._pendingDragOffset.distance > Constants.kPanSlop; }
protected override bool _hasSufficientGlobalDistanceToAccept {
get { return Math.Abs(this._globalDistanceMoved) > Constants.kPanSlop; }
}
protected override Offset _getDeltaForDetails(Offset delta) {

55
com.unity.uiwidgets/Runtime/gestures/multitap.cs


GestureArenaEntry entry = null
) {
this.pointer = evt.pointer;
this._initialPosition = evt.position;
this._initialGlobalPosition = evt.position;
this._doubleTapMinTimeCountdown = new _CountdownZoned(duration: doubleTapMinTime);
this.entry = entry;
}

internal readonly Offset _initialPosition;
internal readonly Offset _initialGlobalPosition;
public void startTrackingPointer(PointerRoute route) {
public void startTrackingPointer(PointerRoute route, Matrix4 transform) {
GestureBinding.instance.pointerRouter.addRoute(this.pointer, route);
GestureBinding.instance.pointerRouter.addRoute(this.pointer, route, transform);
}
}

}
}
public bool isWithinTolerance(PointerEvent evt, float tolerance) {
Offset offset = evt.position - this._initialPosition;
public bool isWithinGlobalTolerance(PointerEvent evt, float tolerance) {
Offset offset = evt.position - this._initialGlobalPosition;
return offset.distance <= tolerance;
}

public class DoubleTapGestureRecognizer : GestureRecognizer {
public DoubleTapGestureRecognizer(object debugOwner = null, PointerDeviceKind? kind = null)
: base(debugOwner: debugOwner, kind: kind) { }
: base(debugOwner: debugOwner, kind: kind) {
}
public GestureDoubleTapCallback onDoubleTap;

public override void addAllowedPointer(PointerDownEvent evt) {
if (this._firstTap != null &&
!this._firstTap.isWithinTolerance(evt, Constants.kDoubleTapSlop)) {
!this._firstTap.isWithinGlobalTolerance(evt, Constants.kDoubleTapSlop)) {
return;
}

doubleTapMinTime: Constants.kDoubleTapMinTime
);
this._trackers[evt.pointer] = tracker;
tracker.startTrackingPointer(this._handleEvent);
tracker.startTrackingPointer(this._handleEvent, evt.transform);
}
void _handleEvent(PointerEvent evt) {

}
}
else if (evt is PointerMoveEvent) {
if (!tracker.isWithinTolerance(evt, Constants.kDoubleTapTouchSlop)) {
if (!tracker.isWithinGlobalTolerance(evt, Constants.kDoubleTapTouchSlop)) {
this._reject(tracker);
}
}

}
public override void acceptGesture(int pointer) { }
public override void acceptGesture(int pointer) {
}
public override void rejectGesture(int pointer) {
_TapTracker tracker;

}
void _registerSecondTap(_TapTracker tracker) {
var initialPosition = tracker._initialPosition;
var initialPosition = tracker._initialGlobalPosition;
this._firstTap.entry.resolve(GestureDisposition.accepted);
tracker.entry.resolve(GestureDisposition.accepted);
this._freezeTracker(tracker);

doubleTapMinTime: Constants.kDoubleTapMinTime
) {
this.gestureRecognizer = gestureRecognizer;
this._lastPosition = evt.position;
this.startTrackingPointer(this.handleEvent);
this._lastPosition = OffsetPair.fromEventPosition(evt);
this.startTrackingPointer(this.handleEvent, evt.transform);
if (longTapDelay > TimeSpan.Zero) {
this._timer = Window.instance.run(longTapDelay, () => {
this._timer = null;

bool _wonArena = false;
Timer _timer;
Offset _lastPosition;
Offset _finalPosition;
OffsetPair _lastPosition;
OffsetPair _finalPosition;
if (!this.isWithinTolerance(evt, Constants.kTouchSlop)) {
if (!this.isWithinGlobalTolerance(evt, Constants.kTouchSlop)) {
this._lastPosition = evt.position;
this._lastPosition = OffsetPair.fromEventPosition(evt);
}
}
else if (evt is PointerCancelEvent) {

this.stopTrackingPointer(this.handleEvent);
this._finalPosition = evt.position;
this._finalPosition = OffsetPair.fromEventPosition(evt);
this._check();
}
}

);
if (this.onTapDown != null) {
this.invokeCallback<object>("onTapDown", () => {
this.onTapDown(evt.pointer, new TapDownDetails(globalPosition: evt.position));
this.onTapDown(evt.pointer, new TapDownDetails(
globalPosition: evt.position,
localPosition: evt.localPosition,
kind: evt.kind));
return null;
});
}

}
}
public void _dispatchTap(int pointer, Offset globalPosition) {
public void _dispatchTap(int pointer, OffsetPair position) {
this.onTapUp(pointer, new TapUpDetails(globalPosition: globalPosition));
this.onTapUp(pointer, new TapUpDetails(globalPosition: position.global, localPosition: position.local));
return null;
});
}

}
}
public void _dispatchLongTap(int pointer, Offset lastPosition) {
public void _dispatchLongTap(int pointer, OffsetPair lastPosition) {
this.onLongTapDown(pointer, new TapDownDetails(globalPosition: lastPosition));
this.onLongTapDown(pointer, new TapDownDetails(
globalPosition: lastPosition.global,
localPosition: lastPosition.local));
return null;
});
}

79
com.unity.uiwidgets/Runtime/gestures/pointer_router.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using UnityEngine;
namespace Unity.UIWidgets.gestures {

readonly Dictionary<int, HashSet<PointerRoute>> _routeMap = new Dictionary<int, HashSet<PointerRoute>>();
readonly Dictionary<int, Dictionary<PointerRoute, Matrix4>> _routeMap = new Dictionary<int, Dictionary<PointerRoute, Matrix4>>();
readonly HashSet<PointerRoute> _globalRoutes = new HashSet<PointerRoute>();
readonly Dictionary<PointerRoute, Matrix4> _globalRoutes = new Dictionary<PointerRoute, Matrix4>();
public void addRoute(int pointer, PointerRoute route) {
var routes = this._routeMap.putIfAbsent(pointer, () => new HashSet<PointerRoute>());
D.assert(!routes.Contains(route));
routes.Add(route);
public void addRoute(int pointer, PointerRoute route, Matrix4 transform = null) {
var routes = this._routeMap.putIfAbsent(
pointer,
() => new Dictionary<PointerRoute, Matrix4>()
);
D.assert(!routes.ContainsKey(route));
routes[route] = transform;
public void removeRoute(int pointer, PointerRoute route) {
D.assert(this._routeMap.ContainsKey(pointer));
var routes = this._routeMap[pointer];

}
}
public void addGlobalRoute(PointerRoute route, Matrix4 transform = null) {
D.assert(!this._globalRoutes.ContainsKey(route));
this._globalRoutes[route] = transform;
}
public void removeGlobalRoute(PointerRoute route) {
D.assert(this._globalRoutes.ContainsKey(route));
this._globalRoutes.Remove(route);
}
public bool acceptScroll() {
return this._routeMap.Count == 0;
}

}
}
public void addGlobalRoute(PointerRoute route) {
D.assert(!this._globalRoutes.Contains(route));
this._globalRoutes.Add(route);
}
public void removeGlobalRoute(PointerRoute route) {
D.assert(this._globalRoutes.Contains(route));
this._globalRoutes.Remove(route);
}
void _dispatch(PointerEvent evt, PointerRoute route) {
void _dispatch(PointerEvent evt, PointerRoute route, Matrix4 transform) {
evt = evt.transformed(transform);
route(evt);
}
catch (Exception ex) {

public void route(PointerEvent evt) {
HashSet<PointerRoute> routes;
// TODO: update this to latest version
Dictionary<PointerRoute, Matrix4> routes;
Dictionary<PointerRoute, Matrix4> copiedGlobalRoutes = new Dictionary<PointerRoute, Matrix4>(this._globalRoutes);
foreach (PointerRoute route in new List<PointerRoute>(routes)) {
if (routes.Contains(route)) {
this._dispatch(evt, route);
}
}
this._dispatchEventToRoutes(
evt,
routes,
new Dictionary<PointerRoute, Matrix4>(routes)
);
foreach (PointerRoute route in new List<PointerRoute>(this._globalRoutes)) {
if (this._globalRoutes.Contains(route)) {
this._dispatch(evt, route);
this._dispatchEventToRoutes(evt, this._globalRoutes, copiedGlobalRoutes);
}
public void _dispatchEventToRoutes(
PointerEvent evt,
Dictionary<PointerRoute, Matrix4> referenceRoutes,
Dictionary<PointerRoute, Matrix4> copiedRoutes
) {
foreach (var item in copiedRoutes) {
var route = item.Key;
var transform = item.Value;
if (referenceRoutes.ContainsKey(route)) {
this._dispatch(evt, route, transform);
}
}
// TODO: FlutterErrorDetailsForPointerRouter

4
com.unity.uiwidgets/Runtime/gestures/pointer_signal_resolver.cs


return;
}
D.assert(this._currentEvent == evt);
D.assert((_currentEvent.original ?? this._currentEvent) == evt);
this._firstRegisteredCallback(evt);
this._firstRegisteredCallback(_currentEvent);
}
catch (Exception exception) {
UIWidgetsError.reportError(new UIWidgetsErrorDetails(

100
com.unity.uiwidgets/Runtime/gestures/recognizer.cs


public abstract class GestureRecognizer : DiagnosticableTree, GestureArenaMember {
protected GestureRecognizer(object debugOwner = null, PointerDeviceKind? kind = null) {
this.debugOwner = debugOwner;
this._kind = kind;
this._kindFilter = kind;
readonly PointerDeviceKind? _kind;
readonly PointerDeviceKind? _kindFilter;
readonly Dictionary<int, PointerDeviceKind> _pointerToKind = new Dictionary<int, PointerDeviceKind>{};
this._pointerToKind[evt.pointer] = evt.kind;
if (this.isPointerAllowed(evt)) {
this.addAllowedPointer(evt);
}

}
protected virtual bool isPointerAllowed(PointerDownEvent evt) {
return this._kind == null || this._kind == evt.kind;
return this._kindFilter == null || this._kindFilter == evt.kind;
}
protected virtual PointerDeviceKind getKindForPointer(int pointer) {
D.assert(this._pointerToKind.ContainsKey(pointer));
return this._pointerToKind[pointer];
}
public virtual void addScrollPointer(PointerScrollEvent evt) {

}
}
protected virtual void resolvePointer(int pointer, GestureDisposition disposition) {
GestureArenaEntry entry = _entries[pointer];
if (entry != null) {
entry.resolve(disposition);
_entries.Remove(pointer);
}
}
public override void dispose() {
this.resolve(GestureDisposition.rejected);
foreach (int pointer in this._trackedPointers) {

}
}
protected void startTrackingPointer(int pointer) {
GestureBinding.instance.pointerRouter.addRoute(pointer, this.handleEvent);
protected void startTrackingPointer(int pointer, Matrix4 transform = null) {
GestureBinding.instance.pointerRouter.addRoute(pointer, this.handleEvent, transform);
this._trackedPointers.Add(pointer);
D.assert(!this._entries.ContainsKey(pointer));
this._entries[pointer] = this._addPointerToArena(pointer);

public int primaryPointer;
public Offset initialPosition;
public OffsetPair initialPosition;
this.startTrackingPointer(evt.pointer);
this.startTrackingPointer(evt.pointer, evt.transform);
this.initialPosition = evt.position;
this.initialPosition = new OffsetPair(local: evt.localPosition, global: evt.position);
this._timer = Window.instance.run(this.deadline.Value, this.didExceedDeadline);
this._timer = Window.instance.run(this.deadline.Value, () => didExceedDeadlineWithEvent(evt));
}
}
}

if (evt.pointer == this.primaryPointer) {
bool isPreAcceptSlopPastTolerance = this.state == GestureRecognizerState.possible &&
this.preAcceptSlopTolerance != null &&
this._getDistance(evt) > this.preAcceptSlopTolerance;
this._getGlobalDistance(evt) > this.preAcceptSlopTolerance;
this._getDistance(evt) > this.postAcceptSlopTolerance;
this._getGlobalDistance(evt) > this.postAcceptSlopTolerance;
if (evt is PointerMoveEvent && (isPreAcceptSlopPastTolerance || isPostAcceptSlopPastTolerance)) {
this.resolve(GestureDisposition.rejected);

D.assert(this.deadline == null);
}
protected virtual void didExceedDeadlineWithEvent(PointerDownEvent evt) {
this.didExceedDeadline();
}
this._stopTimer();
this.state = GestureRecognizerState.accepted;
}
}

}
}
float _getDistance(PointerEvent evt) {
Offset offset = evt.position - this.initialPosition;
float _getGlobalDistance(PointerEvent evt) {
Offset offset = evt.position - this.initialPosition.global;
return offset.distance;
}

}
}
public class OffsetPair {
/// Creates a [OffsetPair] combining a [local] and [global] [Offset].
public OffsetPair(
Offset local = null,
Offset global = null
) {
this.local = local;
this.global = global;
}
/// Creates a [OffsetPair] from [PointerEvent.localPosition] and
/// [PointerEvent.position].
public static OffsetPair fromEventPosition(PointerEvent evt) {
return new OffsetPair(local: evt.localPosition, global: evt.position);
}
/// Creates a [OffsetPair] from [PointerEvent.localDelta] and
/// [PointerEvent.delta].
public static OffsetPair fromEventDelta(PointerEvent evt) {
return new OffsetPair(local: evt.localDelta, global: evt.delta);
}
/// A [OffsetPair] where both [Offset]s are [Offset.zero].
public readonly static OffsetPair zero = new OffsetPair(local: Offset.zero, global: Offset.zero);
/// The [Offset] in the local coordinate space.
public readonly Offset local;
/// The [Offset] in the global coordinate space after conversion to logical
/// pixels.
public readonly Offset global;
/// Adds the `other.global` to [global] and `other.local` to [local].
public static OffsetPair operator +(OffsetPair current, OffsetPair other) {
return new OffsetPair(
local: current.local + other.local,
global: current.global + other.global
);
}
/// Subtracts the `other.global` from [global] and `other.local` from [local].
public static OffsetPair operator -(OffsetPair current, OffsetPair other) {
return new OffsetPair(
local: current.local - other.local,
global: current.global - other.global
);
}
public override string ToString() {
return $"runtimeType(local: ${this.local}, global: ${this.global})";
}
}
}

6
com.unity.uiwidgets/Runtime/gestures/tap.cs


using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using UnityEngine;
namespace Unity.UIWidgets.gestures {
public class TapDownDetails {

}
protected override void handleTapDown(PointerDownEvent down) {
globalPosition: down.position,
globalPosition: down.position,
localPosition: down.localPosition,
kind: down.kind,
device: down.device
);

protected override void handleTapUp(PointerDownEvent down, PointerUpEvent up) {
TapUpDetails details = new TapUpDetails(
globalPosition: up.position,
localPosition: up.localPosition,
kind: up.kind,
device: up.device
);

4
com.unity.uiwidgets/Runtime/material/chip.cs


additionalConstraints: additionalConstraints) {
}
public override bool hitTest(HitTestResult result, Offset position = null) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
if (!this.size.contains(position)) {
return false;
}

return new Size(deleteIconWidth, deleteIconHeight);
}
public override bool hitTest(HitTestResult result, Offset position = null) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
if (!this.size.contains(position)) {
return false;
}

53
com.unity.uiwidgets/Runtime/material/input_decorator.cs


if (this.prefix != null) {
boxToBaseline[this.prefix] = this._layoutLineBox(this.prefix, boxConstraints);
}
_boxSize(this.icon).width
+ this.contentPadding.left
+ _boxSize(this.prefixIcon).width
+ _boxSize(this.prefix).width
+ _boxSize(this.suffix).width
+ _boxSize(this.suffixIcon).width
+ this.contentPadding.right));
_boxSize(this.icon).width
+ this.contentPadding.left
+ _boxSize(this.prefixIcon).width
+ _boxSize(this.prefix).width
+ _boxSize(this.suffix).width
+ _boxSize(this.suffixIcon).width
+ this.contentPadding.right));
if (this.label != null) {
boxToBaseline[this.label] = this._layoutLineBox(this.label,
boxConstraints.copyWith(maxWidth: inputWidth)

height = layout.containerHeight ?? 0.0f;
baseline = (this.decoration.isCollapsed || !this.decoration.border.isOutline
? layout.inputBaseline
: layout.outlineBaseline) ?? 0.0f;
? layout.inputBaseline
: layout.outlineBaseline) ?? 0.0f;
if (this.icon != null) {
float x = 0.0f;

return true;
}
protected override bool hitTestChildren(HitTestResult result, Offset position) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position) {
if (child.hitTest(result, position: position - _boxParentData(child).offset)) {
Offset offset = _boxParentData(child).offset;
bool isHit = result.addWithPaintOffset(
offset: offset,
position: position,
hitTest: (BoxHitTestResult resultIn, Offset transformed) => {
D.assert(transformed == position - offset);
return child.hitTest(resultIn, position: transformed);
}
);
if (isHit) {
return true;
}
}

public readonly TextAlign? textAlign;
public readonly bool isFocused;
public readonly bool expands;
public readonly bool isEmpty;

public InputDecoration decoration {
get {
this._effectiveDecoration = this._effectiveDecoration ?? this.widget.decoration.applyDefaults(
Theme.of(this.context).inputDecorationTheme
);
Theme.of(this.context).inputDecorationTheme
);
return this._effectiveDecoration;
}
}

(4.0f + 0.75f * inlineLabelStyle.fontSize) * MediaQuery.textScaleFactorOf(context);
if (this.decoration.filled == true) {
contentPadding = decorationContentPadding ?? (decorationIsDense
? EdgeInsets.fromLTRB(12.0f, 8.0f, 12.0f, 8.0f)
: EdgeInsets.fromLTRB(12.0f, 12.0f, 12.0f, 12.0f));
? EdgeInsets.fromLTRB(12.0f, 8.0f, 12.0f, 8.0f)
: EdgeInsets.fromLTRB(12.0f, 12.0f, 12.0f, 12.0f));
? EdgeInsets.fromLTRB(0.0f, 8.0f, 0.0f, 8.0f)
: EdgeInsets.fromLTRB(0.0f, 12.0f, 0.0f, 12.0f));
? EdgeInsets.fromLTRB(0.0f, 8.0f, 0.0f, 8.0f)
: EdgeInsets.fromLTRB(0.0f, 12.0f, 0.0f, 12.0f));
? EdgeInsets.fromLTRB(12.0f, 20.0f, 12.0f, 12.0f)
: EdgeInsets.fromLTRB(12.0f, 24.0f, 12.0f, 16.0f));
? EdgeInsets.fromLTRB(12.0f, 20.0f, 12.0f, 12.0f)
: EdgeInsets.fromLTRB(12.0f, 24.0f, 12.0f, 16.0f));
}
return new _Decorator(

16
com.unity.uiwidgets/Runtime/material/list_tile.cs


bool isTwoLine = !this.isThreeLine && hasSubtitle;
bool isOneLine = !this.isThreeLine && !hasSubtitle;
BoxConstraints maxIconHeightConstrains = new BoxConstraints(
maxHeight: this.isDense ? 48.0f: 56.0f
maxHeight: this.isDense ? 48.0f : 56.0f
);
BoxConstraints looseConstraints = this.constraints.loosen();
BoxConstraints iconConstraints = looseConstraints.enforce(maxIconHeightConstrains);

return true;
}
protected override bool hitTestChildren(HitTestResult result, Offset position) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position) {
BoxParentData parentData = (BoxParentData) child.parentData;
if (child.hitTest(result, position: position - parentData.offset)) {
BoxParentData parentData = child.parentData as BoxParentData;
bool isHit = result.addWithPaintOffset(
offset: parentData.offset,
position: position,
hitTest: (BoxHitTestResult resultIn, Offset transformed) => {
D.assert(transformed == position - parentData.offset);
return child.hitTest(resultIn, position: transformed);
}
);
if (isHit) {
return true;
}
}

100
com.unity.uiwidgets/Runtime/rendering/box.cs


}
}
public delegate bool BoxHitTest(BoxHitTestResult result, Offset position);
public class BoxHitTestResult : HitTestResult {
public BoxHitTestResult() : base() {
}
public BoxHitTestResult(HitTestResult result) : base(result) {
}
public bool addWithPaintTransform(
Matrix4 transform,
Offset position,
BoxHitTest hitTest
) {
D.assert(hitTest != null);
if (transform != null) {
transform = Matrix4.tryInvert(PointerEvent.removePerspectiveTransform(transform));
if (transform == null) {
// Objects are not visible on screen and cannot be hit-tested.
return false;
}
}
return this.addWithRawTransform(
transform: transform,
position: position,
hitTest: hitTest
);
}
public bool addWithPaintOffset(
Offset offset,
Offset position,
BoxHitTest hitTest
) {
D.assert(hitTest != null);
return this.addWithRawTransform(
transform: offset != null ? new Matrix4().translationValues(-offset.dx, -offset.dy, 0) : null,
position: position,
hitTest: hitTest
);
}
public bool addWithRawTransform(
Matrix4 transform,
Offset position,
BoxHitTest hitTest
) {
D.assert(hitTest != null);
Offset transformedPosition = position == null || transform == null
? position
: MatrixUtils.transformPoint(transform, position);
if (transform != null) {
this.pushTransform(transform);
}
bool isHit = hitTest(this, transformedPosition);
if (transform != null) {
this.popTransform();
}
return isHit;
}
}
public Offset offset = Offset.zero;
public Offset offset {
get { return this._offset; }
set { this._offset = value; }
}
Offset _offset = Offset.zero;
public override string ToString() {
return "offset=" + this.offset;

public float? getDistanceToBaseline(TextBaseline baseline, bool onlyReal = false) {
D.assert(!_debugDoingBaseline,
() => "Please see the documentation for computeDistanceToActualBaseline for the required calling conventions of this method.");
() =>
"Please see the documentation for computeDistanceToActualBaseline for the required calling conventions of this method.");
D.assert(!this.debugNeedsLayout);
D.assert(() => {
RenderObject parent = (RenderObject) this.parent;

public virtual float? getDistanceToActualBaseline(TextBaseline baseline) {
D.assert(_debugDoingBaseline,
() => "Please see the documentation for computeDistanceToActualBaseline for the required calling conventions of this method.");
() =>
"Please see the documentation for computeDistanceToActualBaseline for the required calling conventions of this method.");
this._cachedBaselines = this._cachedBaselines ?? new Dictionary<TextBaseline, float?>();
return this._cachedBaselines.putIfAbsent(baseline, () => this.computeDistanceToActualBaseline(baseline));

D.assert(_debugDoingBaseline,
() => "Please see the documentation for computeDistanceToActualBaseline for the required calling conventions of this method.");
() =>
"Please see the documentation for computeDistanceToActualBaseline for the required calling conventions of this method.");
return null;
}

});
}
public virtual bool hitTest(HitTestResult result, Offset position = null) {
public virtual bool hitTest(BoxHitTestResult result, Offset position = null) {
D.assert(position != null);
D.assert(() => {
if (!this.hasSize) {

return false;
}
protected virtual bool hitTestChildren(HitTestResult result, Offset position = null) {
protected virtual bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
return false;
}

if (det == 0) {
return Offset.zero;
}
Vector3 n = new Vector3(0, 0, 1);
Vector3 i = transform.perspectiveTransform(new Vector3(0, 0, 0));
Vector3 d = transform.perspectiveTransform(new Vector3(0, 0, 1)) - i;

return result;
}
public bool defaultHitTestChildren(HitTestResult result, Offset position = null) {
public bool defaultHitTestChildren(BoxHitTestResult result, Offset position = null) {
ParentDataType childParentData = (ParentDataType) child.parentData;
if (child.hitTest(result, position: position - childParentData.offset)) {
ParentDataType childParentData = child.parentData as ParentDataType;
bool isHit = result.addWithPaintOffset(
offset: childParentData.offset,
position: position,
hitTest: (BoxHitTestResult resultIn, Offset transformed) => {
D.assert(transformed == position - childParentData.offset);
return child.hitTest(resultIn, position: transformed);
}
);
if (isHit) {
return true;
}

21
com.unity.uiwidgets/Runtime/rendering/box.mixin.gen.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using UnityEngine;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.ui;

}
}
public bool defaultHitTestChildren(HitTestResult result, Offset position) {
// the x, y parameters have the top left of the node's box as the origin
public bool defaultHitTestChildren(BoxHitTestResult result, Offset position) {
// the x, y parameters have the top left of the node's box as the origin4
while (child != null)
{
ParentDataType childParentData = (ParentDataType) child.parentData;
if (child.hitTest(result, position: position - childParentData.offset)) {
return true;
while (child != null) {
ParentDataType childParentData = child.parentData as ParentDataType;
bool isHit = result.addWithPaintOffset(
offset: childParentData.offset,
position: position,
hitTest: (BoxHitTestResult boxHitTestResult, Offset transformed) => {
D.assert(transformed == position - childParentData.offset);
return child.hitTest(boxHitTestResult, position: transformed);
);
if (isHit)
return true;
child = childParentData.previousSibling;
}
return false;

2
com.unity.uiwidgets/Runtime/rendering/custom_layout.cs


this.defaultPaint(context, offset);
}
protected override bool hitTestChildren(HitTestResult result, Offset position) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position) {
return this.defaultHitTestChildren(result, position: position);
}
}

2
com.unity.uiwidgets/Runtime/rendering/custom_paint.cs


base.detach();
}
protected override bool hitTestChildren(HitTestResult result, Offset position) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position) {
if (this._foregroundPainter != null && ((this._foregroundPainter.hitTest(position)) ?? false)) {
return true;
}

2
com.unity.uiwidgets/Runtime/rendering/flex.cs


});
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
return this.defaultHitTestChildren(result, position: position);
}
}

5
com.unity.uiwidgets/Runtime/rendering/layer.cs


using System.Linq;
using System.Text;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using UnityEngine;

internal override S find<S>(Offset regionOffset) {
if (this._inverseDirty) {
this._invertedTransform = Matrix4.tryInvert(this.transform);
this._invertedTransform = Matrix4.tryInvert(
PointerEvent.removePerspectiveTransform(this.transform)
);
this._inverseDirty = false;
}

2
com.unity.uiwidgets/Runtime/rendering/list_body.cs


}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
return this.defaultHitTestChildren(result, position: position);
}
}

2
com.unity.uiwidgets/Runtime/rendering/list_wheel_viewport.cs


return null;
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null
) {
return false;
}

104
com.unity.uiwidgets/Runtime/rendering/proxy_box.cs


public HitTestBehavior behavior;
public override bool hitTest(HitTestResult result, Offset position = null) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
bool hitTarget = false;
if (this.size.contains(position)) {
hitTarget = this.hitTestChildren(result, position: position) || this.hitTestSelf(position);

get { return Offset.zero & this.size; }
}
public override bool hitTest(HitTestResult result, Offset position = null) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
if (this._clipper != null) {
this._updateClip();
D.assert(this._clip != null);

get { return this._borderRadius.toRRect(Offset.zero & this.size); }
}
public override bool hitTest(HitTestResult result, Offset position = null) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
if (this._clipper != null) {
this._updateClip();
D.assert(this._clip != null);

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

}
}
public override bool hitTest(HitTestResult result, Offset position = null) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
D.assert(position != null);
if (this._clipper != null) {

}
}
public override bool hitTest(HitTestResult result, Offset position = null) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
if (this._clipper != null) {
this._updateClip();
D.assert(this._clip != null);

}
}
public override bool hitTest(HitTestResult result, Offset position = null) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
if (this._clipper != null) {
this._updateClip();
D.assert(this._clip != null);

}
}
public override bool hitTest(HitTestResult result, Offset position = null) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
if (this.transformHitTests) {
var transform = this._effectiveTransform;
var inverse = Matrix4.tryInvert(transform);
if (inverse == null) {
return false;
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
D.assert(!this.transformHitTests || this._effectiveTransform != null);
return result.addWithPaintTransform(
transform: this.transformHitTests ? this._effectiveTransform : null,
position: position,
hitTest: (BoxHitTestResult resultIn, Offset positionIn) => {
return base.hitTestChildren(resultIn, position: positionIn);
position = MatrixUtils.transformPoint(inverse, position);
}
return base.hitTestChildren(result, position: position);
);
}
public override void paint(PaintingContext context, Offset offset) {

}
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
if (this.size.isEmpty) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
if (this.size.isEmpty || this.child?.size?.isEmpty == true)
}
Matrix4 inverse = Matrix4.tryInvert(this._transform);
if (inverse == null) {
return false;
}
position = MatrixUtils.transformPoint(inverse, position);
return base.hitTestChildren(result, position: position);
return result.addWithPaintTransform(
transform: this._transform,
position: position,
hitTest: (BoxHitTestResult resultIn, Offset positionIn) => {
return base.hitTestChildren(resultIn, position: positionIn);
}
);
}
public override void applyPaintTransform(RenderObject child, Matrix4 transform) {

Offset _translation;
public override bool hitTest(HitTestResult result, Offset position) {
public override bool hitTest(BoxHitTestResult result, Offset position) {
protected override bool hitTestChildren(HitTestResult result, Offset position) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position) {
if (this.transformHitTests) {
position = new Offset(
position.dx - this.translation.dx * this.size.width,
position.dy - this.translation.dy * this.size.height
);
}
return base.hitTestChildren(result, position: position);
return result.addWithPaintOffset(
offset: this.transformHitTests
? new Offset(this.translation.dx * this.size.width, this.translation.dy * this.size.height)
: null,
position: position,
hitTest: (BoxHitTestResult resultIn, Offset positionIn) => {
return base.hitTestChildren(resultIn, position: positionIn);
}
);
}
public override void paint(PaintingContext context, Offset offset) {

this.onPointerSignal((PointerSignalEvent) evt);
return;
}
if (this.onPointerScroll != null && evt is PointerScrollEvent) {
this.onPointerScroll((PointerScrollEvent) evt);
}

bool _ignoring;
public override bool hitTest(HitTestResult result, Offset position = null) {
public override bool hitTest(BoxHitTestResult result, Offset position = null) {
return this.ignoring ? false : base.hitTest(result, position: position);
}

}
}
public override bool hitTest(HitTestResult result, Offset position) {
public override bool hitTest(BoxHitTestResult result, Offset position) {
return !this.offstage && base.hitTest(result, position: position);
}

bool _absorbing;
public override bool hitTest(HitTestResult result, Offset position) {
public override bool hitTest(BoxHitTestResult result, Offset position) {
return this.absorbing
? this.size.contains(position)
: base.hitTest(result, position: position);

return this._layer?.getLastTransform() ?? new Matrix4().identity();
}
public override bool hitTest(HitTestResult result, Offset position) {
public override bool hitTest(BoxHitTestResult result, Offset position) {
protected override bool hitTestChildren(HitTestResult result, Offset position) {
Matrix4 inverse = Matrix4.tryInvert(this.getCurrentTransform());
if (inverse == null) {
return false;
}
position = MatrixUtils.transformPoint(inverse, position);
return base.hitTestChildren(result, position: position);
protected override bool hitTestChildren(BoxHitTestResult result, Offset position) {
return result.addWithPaintTransform(
transform: this.getCurrentTransform(),
position: position,
hitTest: (BoxHitTestResult resultIn, Offset positionIn) => {
return base.hitTestChildren(resultIn, position: positionIn);
}
);
}
public override void paint(PaintingContext context, Offset offset) {

2
com.unity.uiwidgets/Runtime/rendering/proxy_box.mixin.gen.cs


}
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
if (this.child != null) {
return this.child.hitTest(result, position);
}

13
com.unity.uiwidgets/Runtime/rendering/rotated_box.cs


}
protected override bool hitTestChildren(
HitTestResult result,
BoxHitTestResult result,
Offset position = null
) {
D.assert(this._paintTransform != null || this.debugNeedsLayout || this.child == null);

var inverse = new Matrix4().inverted(this._paintTransform);
return this.child.hitTest(result, position:MatrixUtils.transformPoint(inverse, position));
return result.addWithPaintTransform(
transform: this._paintTransform,
position: position,
hitTest: (BoxHitTestResult resultIn, Offset positionIn) => {
return this.child.hitTest(resultIn, position: positionIn);
}
);
}
void _paintChild(PaintingContext context, Offset offset) {

22
com.unity.uiwidgets/Runtime/rendering/shifted_box.cs


}
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
return this.child.hitTest(result, position - childParentData.offset);
return result.addWithPaintOffset(
offset: childParentData.offset,
position: position,
hitTest: (BoxHitTestResult resultIn, Offset transformed) => {
D.assert(transformed == position - childParentData.offset);
return this.child.hitTest(resultIn, position: transformed);
}
);
}
return false;

}
protected override void debugPaintSize(PaintingContext context, Offset offset) {
base.debugPaintSize(context, offset);
base.debugPaintSize(context, offset);
D.assert(() => {
Paint paint;
if (this.child != null && !this.child.size.isEmpty) {

}
if (childParentData.offset.dx > 0.0) {
float headSize = Mathf.Min(childParentData.offset.dx * 0.2f, 10.0f);
float x = offset.dx;
float y = offset.dy + this.size.height / 2.0f;

path.lineTo(x += headSize, y += -headSize);
path.lineTo(x += -headSize, y += -headSize);
path.lineTo(x += 0.0f, y += headSize);
path.moveTo(x = offset.dx + this.size.width, y = offset.dy + this.size.height / 2.0f);
path.lineTo(x += -childParentData.offset.dx + headSize, y += 0.0f);
path.lineTo(x += 0.0f, y += headSize);

path.close();
context.canvas.drawPath(path, paint);
}
} else {
}
else {
paint = new Paint {
color = new ui.Color(0x90909090),
};

context.pushClipRect(this.needsCompositing, offset, Offset.zero & this.size, base.paint);
D.assert(() => {
DebugOverflowIndicatorMixin.paintOverflowIndicator(this, context, offset, this._overflowContainerRect, this._overflowChildRect);
DebugOverflowIndicatorMixin.paintOverflowIndicator(this, context, offset, this._overflowContainerRect,
this._overflowChildRect);
return true;
});
}

115
com.unity.uiwidgets/Runtime/rendering/sliver.cs


}
}
public class SliverHitTestResult : HitTestResult {
public delegate bool SliverHitTest(SliverHitTestResult result, float mainAxisPosition, float crossAxisPosition);
public SliverHitTestResult() : base() {
}
public SliverHitTestResult(HitTestResult result) : base(result) {
}
public bool addWithAxisOffset(
Offset paintOffset,
float mainAxisOffset,
float crossAxisOffset,
float mainAxisPosition,
float crossAxisPosition,
SliverHitTest hitTest
) {
D.assert(mainAxisOffset != null);
D.assert(crossAxisOffset != null);
D.assert(mainAxisPosition != null);
D.assert(crossAxisPosition != null);
D.assert(hitTest != null);
if (paintOffset != null) {
this.pushTransform(new Matrix4().translationValues(-paintOffset.dx, -paintOffset.dy, 0));
}
bool isHit = hitTest(
this,
mainAxisPosition: mainAxisPosition - mainAxisOffset,
crossAxisPosition: crossAxisPosition - crossAxisOffset
);
if (paintOffset != null) {
this.popTransform();
}
return isHit;
}
}
public class SliverHitTestEntry : HitTestEntry {
public SliverHitTestEntry(RenderSliver target,
float mainAxisPosition = 0.0f,

this.crossAxisPosition = crossAxisPosition;
}
public new RenderSliver target {
get { return (RenderSliver) base.target; }
}

get { return 0.0f; }
}
public bool hitTest(HitTestResult result, float mainAxisPosition = 0, float crossAxisPosition = 0) {
public bool hitTest(SliverHitTestResult result, float mainAxisPosition = 0, float crossAxisPosition = 0) {
if (mainAxisPosition >= 0.0f && mainAxisPosition < this.geometry.hitTestExtent &&
crossAxisPosition >= 0.0f && crossAxisPosition < this.constraints.crossAxisExtent) {
if (this.hitTestChildren(result, mainAxisPosition: mainAxisPosition,

return false;
}
protected virtual bool hitTestChildren(HitTestResult result, float mainAxisPosition = 0,
protected virtual bool hitTestChildren(SliverHitTestResult result, float mainAxisPosition = 0,
float crossAxisPosition = 0) {
return false;
}

return null;
}
protected Size getAbsoluteSize() {
D.assert(this.geometry != null);
D.assert(!this.debugNeedsLayout);
switch (this.constraints.axisDirection) {
case AxisDirection.up:
case AxisDirection.down:
return new Size(this.constraints.crossAxisExtent, this.geometry.paintExtent);
case AxisDirection.right:
case AxisDirection.left:
return new Size(this.geometry.paintExtent, this.constraints.crossAxisExtent);
}
return null;
}
void _debugDrawArrow(Canvas canvas, Paint paint, Offset p0, Offset p1, GrowthDirection direction) {
D.assert(() => {
if (p0 == p1) {

return rightWayUp;
}
public static bool hitTestBoxChild(this RenderSliver it, HitTestResult result, RenderBox child,
public static bool hitTestBoxChild(this RenderSliver it, BoxHitTestResult result, RenderBox child,
float absolutePosition = mainAxisPosition - it.childMainAxisPosition(child);
float absoluteCrossAxisPosition = crossAxisPosition - it.childCrossAxisPosition(child);
float delta = it.childMainAxisPosition(child);
float crossAxisDelta = it.childCrossAxisPosition(child);
float absolutePosition = mainAxisPosition - delta;
float absoluteCrossAxisPosition = crossAxisPosition - crossAxisDelta;
Offset paintOffset = null;
Offset transformedPosition = null;
D.assert(it.constraints.axis != null);
case Axis.horizontal:
if (!rightWayUp) {
absolutePosition = child.size.width - absolutePosition;
}
return child.hitTest(result,
position: new Offset(absolutePosition, absoluteCrossAxisPosition));
case Axis.vertical:
if (!rightWayUp) {
absolutePosition = child.size.height - absolutePosition;
}
return child.hitTest(result,
position: new Offset(absoluteCrossAxisPosition, absolutePosition));
case Axis.horizontal:
if (!rightWayUp) {
absolutePosition = child.size.width - absolutePosition;
delta = it.geometry.paintExtent - child.size.width - delta;
}
paintOffset = new Offset(delta, crossAxisDelta);
transformedPosition = new Offset(absolutePosition, absoluteCrossAxisPosition);
break;
case Axis.vertical:
if (!rightWayUp) {
absolutePosition = child.size.height - absolutePosition;
delta = it.geometry.paintExtent - child.size.height - delta;
}
paintOffset = new Offset(crossAxisDelta, delta);
transformedPosition = new Offset(absoluteCrossAxisPosition, absolutePosition);
break;
return false;
D.assert(paintOffset != null);
D.assert(transformedPosition != null);
return result.addWithPaintOffset(
offset: paintOffset,
position: null, // Manually adapting from sliver to box position above.
hitTest: (BoxHitTestResult boxHitTestResult, Offset _) => {
return child.hitTest(boxHitTestResult, position: transformedPosition);
}
);
}
public static void applyPaintTransformForBoxChild(this RenderSliver it, RenderBox child,

}
}
protected override bool hitTestChildren(HitTestResult result, float mainAxisPosition = 0.0f,
protected override bool hitTestChildren(SliverHitTestResult result, float mainAxisPosition = 0.0f,
return this.hitTestBoxChild(result, this.child, mainAxisPosition: mainAxisPosition,
return this.hitTestBoxChild(new BoxHitTestResult(result), this.child, mainAxisPosition: mainAxisPosition,
crossAxisPosition: crossAxisPosition);
}

6
com.unity.uiwidgets/Runtime/rendering/sliver_multi_box_adaptor.cs


return 0.0f;
}
protected override bool hitTestChildren(HitTestResult result, float mainAxisPosition = 0.0f,
protected override bool hitTestChildren(SliverHitTestResult result, float mainAxisPosition = 0.0f,
BoxHitTestResult boxResult = new BoxHitTestResult(result);
if (this.hitTestBoxChild(result, child, mainAxisPosition: mainAxisPosition,
if (this.hitTestBoxChild(boxResult, child, mainAxisPosition: mainAxisPosition,
crossAxisPosition: crossAxisPosition)) {
return true;
}

14
com.unity.uiwidgets/Runtime/rendering/sliver_padding.cs


D.assert(crossAxisPadding == this.crossAxisPadding);
}
protected override bool hitTestChildren(HitTestResult result, float mainAxisPosition = 0.0f,
protected override bool hitTestChildren(SliverHitTestResult result, float mainAxisPosition = 0.0f,
return this.child.hitTest(result,
mainAxisPosition: mainAxisPosition - this.childMainAxisPosition(this.child),
crossAxisPosition: crossAxisPosition - this.childCrossAxisPosition(this.child));
SliverPhysicalParentData childParentData = this.child.parentData as SliverPhysicalParentData;
result.addWithAxisOffset(
mainAxisPosition: mainAxisPosition,
crossAxisPosition: crossAxisPosition,
mainAxisOffset: this.childMainAxisPosition(this.child),
crossAxisOffset: this.childCrossAxisPosition(this.child),
paintOffset: childParentData.paintOffset,
hitTest: this.child.hitTest
);
}
return false;

4
com.unity.uiwidgets/Runtime/rendering/sliver_persistent_header.cs


return base.childMainAxisPosition(this.child);
}
protected override bool hitTestChildren(HitTestResult result, float mainAxisPosition, float crossAxisPosition) {
protected override bool hitTestChildren(SliverHitTestResult result, float mainAxisPosition, float crossAxisPosition) {
return RenderSliverHelpers.hitTestBoxChild(this, result, this.child, mainAxisPosition: mainAxisPosition,
return RenderSliverHelpers.hitTestBoxChild(this, new BoxHitTestResult(result), this.child, mainAxisPosition: mainAxisPosition,
crossAxisPosition: crossAxisPosition);
}

82
com.unity.uiwidgets/Runtime/rendering/stack.cs


}
}
public static float getIntrinsicDimension(RenderBox firstChild, mainChildSizeGetter getter) {
float extent = 0;
RenderBox child = firstChild;
while (child != null) {
StackParentData childParentData = child.parentData as StackParentData;
if (!childParentData.isPositioned)
extent = Math.Max(extent, getter(child));
D.assert(child.parentData == childParentData);
child = childParentData.nextSibling;
}
return extent;
}
public delegate float mainChildSizeGetter(RenderBox child);
float _getIntrinsicDimension(mainChildSizeGetter getter) {

return this.defaultComputeDistanceToHighestActualBaseline(baseline);
}
public static bool layoutPositionedChild(RenderBox child, StackParentData childParentData, Size size,
Alignment alignment) {
D.assert(childParentData.isPositioned);
D.assert(child.parentData == childParentData);
bool hasVisualOverflow = false;
BoxConstraints childConstraints = new BoxConstraints();
if (childParentData.left != null && childParentData.right != null)
childConstraints =
childConstraints.tighten(width: size.width - childParentData.right - childParentData.left);
else if (childParentData.width != null)
childConstraints = childConstraints.tighten(width: childParentData.width);
if (childParentData.top != null && childParentData.bottom != null)
childConstraints =
childConstraints.tighten(height: size.height - childParentData.bottom - childParentData.top);
else if (childParentData.height != null)
childConstraints = childConstraints.tighten(height: childParentData.height);
child.layout(childConstraints, parentUsesSize: true);
float? x;
if (childParentData.left != null) {
x = childParentData.left;
}
else if (childParentData.right != null) {
x = size.width - childParentData.right - child.size.width;
}
else {
x = alignment.alongOffset(size - child.size as Offset).dx;
}
if (x < 0.0 || x + child.size.width > size.width)
hasVisualOverflow = true;
float? y;
if (childParentData.top != null) {
y = childParentData.top;
}
else if (childParentData.bottom != null) {
y = size.height - childParentData.bottom - child.size.height;
}
else {
y = alignment.alongOffset(size - child.size as Offset).dy;
}
if (y < 0.0 || y + child.size.height > size.height)
hasVisualOverflow = true;
childParentData.offset = new Offset(x ?? 0, y ?? 0);
return hasVisualOverflow;
}
protected override void performLayout() {
this._hasVisualOverflow = false;
bool hasNonPositionedChildren = false;

}
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
return this.defaultHitTestChildren(result, position: position);
}

return child;
}
protected override bool hitTestChildren(HitTestResult result, Offset position) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position) {
if (this.firstChild == null || this.index == null) {
return false;
}

StackParentData childParentData = (StackParentData) child.parentData;
return child.hitTest(result, position: position - childParentData.offset);
return result.addWithPaintOffset(
offset: childParentData.offset,
position: position,
hitTest: (BoxHitTestResult resultIn, Offset transformed) => {
D.assert(transformed == position - childParentData.offset);
return child.hitTest(resultIn, position: transformed);
}
);
}
public override void paintStack(PaintingContext context, Offset offset) {

20
com.unity.uiwidgets/Runtime/rendering/table.cs


float deficit = tableWidth - maxWidthConstraint;
int availableColumns = this.columns;
//(Xingwei Zhu) this deficit is double and set to be 0.00000001f in flutter.
//since we use float by default, making it larger should make sense in most cases
float minimumDeficit = 0.0001f;

if (flexes[x] != null) {
//(Xingwei Zhu) in case deficit * flexes[x].Value / totalFlex => 0 if deficit is really small, leading to dead loop,
//we amend it with a default larger value to ensure that this loop will eventually end
float newWidth = widths[x] - Mathf.Max(minimumDeficit, deficit * flexes[x].Value / totalFlex);
float newWidth =
widths[x] - Mathf.Max(minimumDeficit, deficit * flexes[x].Value / totalFlex);
D.assert(newWidth.isFinite());
if (newWidth <= minWidths[x]) {
deficit -= widths[x] - minWidths[x];

D.assert(this._rowTops.Count == rows + 1);
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
if (child.hitTest(result, position: position - childParentData.offset)) {
bool isHit = result.addWithPaintOffset(
offset: childParentData.offset,
position: position,
hitTest: (BoxHitTestResult resultIn, Offset transformed) => {
D.assert(transformed == position - childParentData.offset);
return child.hitTest(resultIn, position: transformed);
}
);
if (isHit) {
return true;
}
}

D.assert(this._rows == this._rowTops.Count - 1);
D.assert(this._columns == this._columnLefts.Count);
if (this.border != null) {
Rect borderRect = Rect.fromLTWH(offset.dx, offset.dy, this.size.width, this._rowTops[this._rowTops.Count - 1]);
Rect borderRect = Rect.fromLTWH(offset.dx, offset.dy, this.size.width,
this._rowTops[this._rowTops.Count - 1]);
List<float> rows = this._rowTops.GetRange(1, this._rowTops.Count - 2);
List<float> columns = this._columnLefts.GetRange(1, this._columnLefts.Count - 1);
this.border.paint(context.canvas, borderRect, rows: rows, columns: columns);

2
com.unity.uiwidgets/Runtime/rendering/view.cs


public bool hitTest(HitTestResult result, Offset position = null) {
if (this.child != null) {
this.child.hitTest(result, position: position);
this.child.hitTest(new BoxHitTestResult(result), position: position);
}
result.add(new HitTestEntry(this));

25
com.unity.uiwidgets/Runtime/rendering/viewport.cs


});
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
D.assert(position != null);
float mainAxisPosition = 0, crossAxisPosition = 0;

break;
}
SliverHitTestResult sliverResult = new SliverHitTestResult(result);
if (child.geometry.visible && child.hitTest(
result,
mainAxisPosition: this.computeChildMainAxisPosition(child, mainAxisPosition),
crossAxisPosition: crossAxisPosition
)) {
if (!child.geometry.visible) {
continue;
}
Matrix4 transform = new Matrix4().identity();
this.applyPaintTransform(child, transform);
bool isHit = result.addWithPaintTransform(
transform: transform,
position: null, // Manually adapting from box to sliver position below.
hitTest: (BoxHitTestResult resultIn, Offset _) => {
return child.hitTest(
sliverResult,
mainAxisPosition: this.computeChildMainAxisPosition(child, mainAxisPosition),
crossAxisPosition: crossAxisPosition
);
}
);
if (isHit) {
return true;
}
}

2
com.unity.uiwidgets/Runtime/rendering/wrap.cs


}
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
return this.defaultHitTestChildren(result, position: position);
}

34
com.unity.uiwidgets/Runtime/ui/Matrix4.cs


return this;
}
public void setColumn(int column, Vector4 arg) {
int entry = column * 4;
this._m4storage[entry + 3] = arg[3];
this._m4storage[entry + 2] = arg[2];
this._m4storage[entry + 1] = arg[1];
this._m4storage[entry + 0] = arg[0];
}
public Vector4 getColumn(int column) {
Vector4 r = new Vector4();
int entry = column * 4;
r[3] = this._m4storage[entry + 3];
r[2] = this._m4storage[entry + 2];
r[1] = this._m4storage[entry + 1];
r[0] = this._m4storage[entry + 0];
return r;
}
public void setRow(int row, Vector4 arg) {
this._m4storage[this.index(row, 0)] = arg[0];
this._m4storage[this.index(row, 1)] = arg[1];
this._m4storage[this.index(row, 2)] = arg[2];
this._m4storage[this.index(row, 3)] = arg[3];
}
public Vector4 getRow(int row) {
Vector4 r = new Vector4();
r[0] = this._m4storage[this.index(row, 0)];
r[1] = this._m4storage[this.index(row, 1)];
r[2] = this._m4storage[this.index(row, 2)];
r[3] = this._m4storage[this.index(row, 3)];
return r;
}
public Matrix4 clone() => new Matrix4().copy(this);
public static Matrix4 operator *(Matrix4 a, Matrix4 b) {

2
com.unity.uiwidgets/Runtime/widgets/layout_builder.cs


}
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
return this.child?.hitTest(result, position: position) ?? false;
}

2
com.unity.uiwidgets/Runtime/widgets/nested_scroll_view.cs


}
protected override bool hitTestChildren(
HitTestResult result,
SliverHitTestResult result,
float mainAxisPosition = 0,
float crossAxisPosition = 0
) {

490
com.unity.uiwidgets/Runtime/widgets/overlay.cs


using System.Collections.Generic;
using System;
using System.Collections.Generic;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.widgets {
public class OverlayEntry {

}
this._opaque = value;
D.assert(this._overlay != null);
this._overlay._didChangeEntryOpacity();
this._overlay?._didChangeEntryOpacity();
}
}

internal OverlayState _overlay;
internal readonly GlobalKey<_OverlayEntryState> _key = new LabeledGlobalKey<_OverlayEntryState>();
internal readonly GlobalKey<_OverlayEntryWidgetState> _key = new LabeledGlobalKey<_OverlayEntryWidgetState>();
public void remove() {
D.assert(this._overlay != null);

}
class _OverlayEntry : StatefulWidget {
internal _OverlayEntry(OverlayEntry entry) : base(key: entry._key) {
class _OverlayEntryWidget : StatefulWidget {
internal _OverlayEntryWidget(Key key, OverlayEntry entry, bool tickerEnabled = true) : base(key: key) {
D.assert(key != null);
this.tickerEnabled = tickerEnabled;
public readonly bool tickerEnabled;
return new _OverlayEntryState();
return new _OverlayEntryWidgetState();
class _OverlayEntryState : State<_OverlayEntry> {
class _OverlayEntryWidgetState : State<_OverlayEntryWidget> {
public override Widget build(BuildContext context) {
return this.widget.entry.builder(context);
}

entry._overlay = this;
}
this.setState(() => {
this._entries.InsertRange(this._insertionIndex(below, above), entries);
});
this.setState(() => { this._entries.InsertRange(this._insertionIndex(below, above), entries); });
public void rearrange(IEnumerable<OverlayEntry> newEntries, OverlayEntry below = null, OverlayEntry above = null) {
public void rearrange(IEnumerable<OverlayEntry> newEntries, OverlayEntry below = null,
OverlayEntry above = null) {
newEntries is List<OverlayEntry> ?(newEntries as List<OverlayEntry>) : newEntries.ToList();
newEntries is List<OverlayEntry> ? (newEntries as List<OverlayEntry>) : newEntries.ToList();
D.assert(above == null || below == null, () => "Only one of `above` and `below` may be specified.");
D.assert(above == null || (above._overlay == this && this._entries.Contains(above)),
() => "The provided entry for `above` is not present in the Overlay.");

}
HashSet<OverlayEntry> old = new HashSet<OverlayEntry>(this._entries);
foreach(OverlayEntry entry in newEntriesList) {
foreach (OverlayEntry entry in newEntriesList) {
this.setState(() => {
this._entries.Clear();
this._entries.AddRange(newEntriesList);

}
public override Widget build(BuildContext context) {
var onstageChildren = new List<Widget>();
var offstageChildren = new List<Widget>();
var children = new List<Widget>();
int onstageCount = 0;
onstageChildren.Add(new _OverlayEntry(entry));
onstageCount += 1;
children.Add(new _OverlayEntryWidget(entry._key, entry));
offstageChildren.Add(new TickerMode(enabled: false, child: new _OverlayEntry(entry)));
children.Add(new _OverlayEntryWidget(
key: entry._key,
entry: entry,
tickerEnabled: false
));
onstageChildren.Reverse();
children.Reverse();
onstage: new Stack(
fit: StackFit.expand,
children: onstageChildren
),
offstage: offstageChildren
skipCount: children.Count - onstageCount,
children: children.ToList()
// onstage: new Stack(
// fit: StackFit.expand,
// children: onstageChildren
// ),
// offstage: offstageChildren
class _Theatre : RenderObjectWidget {
internal _Theatre(Stack onstage = null, List<Widget> offstage = null) {
D.assert(offstage != null);
D.assert(!offstage.Any((child) => child == null));
this.onstage = onstage;
this.offstage = offstage;
class _Theatre : MultiChildRenderObjectWidget {
internal _Theatre(Key key = null,
int skipCount = 0,
List<Widget> children = null) : base(key, children) {
D.assert(skipCount != null);
D.assert(skipCount >= 0);
D.assert(children != null);
D.assert(children.Count() >= skipCount);
this.skipCount = skipCount;
public readonly int skipCount;
public readonly Stack onstage;

}
public override RenderObject createRenderObject(BuildContext context) {
return new _RenderTheatre();
return new _RenderTheatre(
skipCount: this.skipCount,
textDirection: Directionality.of(context));
}
public void updateRenderObject(BuildContext context, _RenderTheatre renderObject) {
renderObject.skipCount = this.skipCount;
renderObject.textDirection = Directionality.of(context);
class _TheatreElement : RenderObjectElement {
public _TheatreElement(RenderObjectWidget widget) : base(widget) {
D.assert(!WidgetsD.debugChildrenHaveDuplicateKeys(widget, ((_Theatre) widget).offstage));
class _TheatreElement : MultiChildRenderObjectElement {
public _TheatreElement(_Theatre widget) : base(widget) {
}
public new _Theatre widget {

get { return (_RenderTheatre) base.renderObject; }
}
Element _onstage;
static readonly object _onstageSlot = new object();
public override void debugVisitOnstageChildren(ElementVisitor visitor) {
D.assert(this.children.Count() >= this.widget.skipCount);
foreach (var item in this.children.Skip(this.widget.skipCount)) {
visitor(item);
}
}
}
// Element _onstage;
// static readonly object _onstageSlot = new object();
//
// List<Element> _offstage;
// readonly HashSet<Element> _forgottenOffstageChildren = new HashSet<Element>();
//
// protected override void insertChildRenderObject(RenderObject child, object slot) {
// D.assert(this.renderObject.debugValidateChild(child));
// if (slot == _onstageSlot) {
// D.assert(child is RenderStack);
// this.renderObject.child = (RenderStack) child;
// }
// else {
// D.assert(slot == null || slot is Element);
// this.renderObject.insert((RenderBox) child, after: (RenderBox) ((Element) slot)?.renderObject);
// }
// }
//
// protected override void moveChildRenderObject(RenderObject child, object slot) {
// if (slot == _onstageSlot) {
// this.renderObject.remove((RenderBox) child);
// D.assert(child is RenderStack);
// this.renderObject.child = (RenderStack) child;
// }
// else {
// D.assert(slot == null || slot is Element);
// if (this.renderObject.child == child) {
// this.renderObject.child = null;
// this.renderObject.insert((RenderBox) child, after: (RenderBox) ((Element) slot)?.renderObject);
// }
// else {
// this.renderObject.move((RenderBox) child, after: (RenderBox) ((Element) slot)?.renderObject);
// }
// }
// }
//
// protected override void removeChildRenderObject(RenderObject child) {
// if (this.renderObject.child == child) {
// this.renderObject.child = null;
// }
// else {
// this.renderObject.remove((RenderBox) child);
// }
// }
//
// public override void visitChildren(ElementVisitor visitor) {
// if (this._onstage != null) {
// visitor(this._onstage);
// }
//
// foreach (var child in this._offstage) {
// if (!this._forgottenOffstageChildren.Contains(child)) {
// visitor(child);
// }
// }
// }
//
// // public override void debugVisitOnstageChildren(ElementVisitor visitor) {
// // if (this._onstage != null) {
// // visitor(this._onstage);
// // }
// // }
//
//
// protected override void forgetChild(Element child) {
// if (child == this._onstage) {
// this._onstage = null;
// }
// else {
// D.assert(this._offstage.Contains(child));
// D.assert(!this._forgottenOffstageChildren.Contains(child));
// this._forgottenOffstageChildren.Add(child);
// }
// }
//
// public override void mount(Element parent, object newSlot) {
// base.mount(parent, newSlot);
// this._onstage = this.updateChild(this._onstage, this.widget.onstage, _onstageSlot);
// this._offstage = new List<Element>(this.widget.offstage.Count);
// Element previousChild = null;
// for (int i = 0; i < this._offstage.Count; i += 1) {
// var newChild = this.inflateWidget(this.widget.offstage[i], previousChild);
// this._offstage[i] = newChild;
// previousChild = newChild;
// }
// }
//
// public override void update(Widget newWidget) {
// base.update(newWidget);
// D.assert(Equals(this.widget, newWidget));
// this._onstage = this.updateChild(this._onstage, this.widget.onstage, _onstageSlot);
// this._offstage = this.updateChildren(this._offstage, this.widget.offstage,
// forgottenChildren: this._forgottenOffstageChildren);
// this._forgottenOffstageChildren.Clear();
// }
// }
List<Element> _offstage;
readonly HashSet<Element> _forgottenOffstageChildren = new HashSet<Element>();
class _RenderTheatre :
ContainerRenderObjectMixinRenderProxyBoxMixinRenderObjectWithChildMixinRenderBoxRenderStack<
RenderBox, StackParentData> {
internal _RenderTheatre(
TextDirection textDirection,
List<RenderBox> children = null,
int skipCount = 0
) {
D.assert(skipCount != null);
D.assert(skipCount >= 0);
D.assert(textDirection != null);
this._textDirection = textDirection;
this._skipCount = skipCount;
this.addAll(children);
}
bool _hasVisualOverflow = false;
Alignment _resolvedAlignment;
protected override void insertChildRenderObject(RenderObject child, object slot) {
D.assert(this.renderObject.debugValidateChild(child));
if (slot == _onstageSlot) {
D.assert(child is RenderStack);
this.renderObject.child = (RenderStack) child;
}
else {
D.assert(slot == null || slot is Element);
this.renderObject.insert((RenderBox) child, after: (RenderBox) ((Element) slot)?.renderObject);
void _resolve() {
if (this._resolvedAlignment != null)
return;
// TODO: AlignmentDirectional
Alignment al = Alignment.topLeft;
switch (this.textDirection) {
case TextDirection.rtl:
this._resolvedAlignment = new Alignment(-1, -1);
break;
case TextDirection.ltr:
this._resolvedAlignment = new Alignment(1, -1);
break;
protected override void moveChildRenderObject(RenderObject child, object slot) {
if (slot == _onstageSlot) {
this.renderObject.remove((RenderBox) child);
D.assert(child is RenderStack);
this.renderObject.child = (RenderStack) child;
}
else {
D.assert(slot == null || slot is Element);
if (this.renderObject.child == child) {
this.renderObject.child = null;
this.renderObject.insert((RenderBox) child, after: (RenderBox) ((Element) slot)?.renderObject);
}
else {
this.renderObject.move((RenderBox) child, after: (RenderBox) ((Element) slot)?.renderObject);
}
}
void _markNeedResolution() {
this._resolvedAlignment = null;
this.markNeedsLayout();
protected override void removeChildRenderObject(RenderObject child) {
if (this.renderObject.child == child) {
this.renderObject.child = null;
}
else {
this.renderObject.remove((RenderBox) child);
public TextDirection textDirection {
get { return this._textDirection; }
set {
if (this._textDirection == value)
return;
this._textDirection = value;
this._markNeedResolution();
public override void visitChildren(ElementVisitor visitor) {
if (this._onstage != null) {
visitor(this._onstage);
}
TextDirection _textDirection;
foreach (var child in this._offstage) {
if (!this._forgottenOffstageChildren.Contains(child)) {
visitor(child);
public int skipCount {
get { return this._skipCount; }
set {
D.assert(value != null);
if (this._skipCount != value) {
this._skipCount = value;
this.markNeedsLayout();
public override void debugVisitOnstageChildren(ElementVisitor visitor) {
if (this._onstage != null) {
visitor(this._onstage);
}
}
int _skipCount;
RenderBox _firstOnstageChild {
get {
if (this.skipCount == base.childCount) {
return null;
}
protected override void forgetChild(Element child) {
if (child == this._onstage) {
this._onstage = null;
}
else {
D.assert(this._offstage.Contains(child));
D.assert(!this._forgottenOffstageChildren.Contains(child));
this._forgottenOffstageChildren.Add(child);
}
}
RenderBox child = base.firstChild;
for (int toSkip = this.skipCount; toSkip > 0; toSkip--) {
StackParentData childParentData = child.parentData as StackParentData;
child = childParentData.nextSibling;
D.assert(child != null);
}
public override void mount(Element parent, object newSlot) {
base.mount(parent, newSlot);
this._onstage = this.updateChild(this._onstage, this.widget.onstage, _onstageSlot);
this._offstage = new List<Element>(this.widget.offstage.Count);
Element previousChild = null;
for (int i = 0; i < this._offstage.Count; i += 1) {
var newChild = this.inflateWidget(this.widget.offstage[i], previousChild);
this._offstage[i] = newChild;
previousChild = newChild;
return child;
public override void update(Widget newWidget) {
base.update(newWidget);
D.assert(Equals(this.widget, newWidget));
this._onstage = this.updateChild(this._onstage, this.widget.onstage, _onstageSlot);
this._offstage = this.updateChildren(this._offstage, this.widget.offstage,
forgottenChildren: this._forgottenOffstageChildren);
this._forgottenOffstageChildren.Clear();
}
}
class _RenderTheatre :
ContainerRenderObjectMixinRenderProxyBoxMixinRenderObjectWithChildMixinRenderBoxRenderStack<
RenderBox, StackParentData> {
public override void setupParentData(RenderObject child) {
if (!(child.parentData is StackParentData)) {
child.parentData = new StackParentData();

}
return children;
}
RenderBox _lastOnstageChild {
get { return this.skipCount == this.childCount ? null : this.lastChild; }
}
int _onstageChildCount {
get { return this.childCount - this.skipCount; }
}
protected override float computeMinIntrinsicWidth(float height) {
return RenderStack.getIntrinsicDimension(this._firstOnstageChild,
(RenderBox child) => child.getMinIntrinsicWidth(height));
}
protected override float computeMaxIntrinsicWidth(float height) {
return RenderStack.getIntrinsicDimension(this._firstOnstageChild,
(RenderBox child) => child.getMaxIntrinsicWidth(height));
}
protected override float computeMinIntrinsicHeight(float width) {
return RenderStack.getIntrinsicDimension(this._firstOnstageChild,
(RenderBox child) => child.getMinIntrinsicHeight(width));
}
protected internal override float computeMaxIntrinsicHeight(float width) {
return RenderStack.getIntrinsicDimension(this._firstOnstageChild,
(RenderBox child) => child.getMaxIntrinsicHeight(width));
}
protected override float? computeDistanceToActualBaseline(TextBaseline baseline) {
D.assert(!this.debugNeedsLayout);
float? result = null;
RenderBox child = this._firstOnstageChild;
while (child != null) {
D.assert(!child.debugNeedsLayout);
StackParentData childParentData = child.parentData as StackParentData;
float? candidate = child.getDistanceToActualBaseline(baseline);
if (candidate != null) {
candidate += childParentData.offset.dy;
if (result != null) {
result = Math.Min(result.Value, candidate.Value);
}
else {
result = candidate;
}
}
child = childParentData.nextSibling;
}
return result;
}
protected override bool sizedByParent {
get { return true; }
}
protected override void performResize() {
this.size = this.constraints.biggest;
D.assert(this.size.isFinite);
}
protected override void performLayout() {
this._hasVisualOverflow = false;
if (this._onstageChildCount == 0) {
return;
}
this._resolve();
D.assert(this._resolvedAlignment != null);
// Same BoxConstraints as used by RenderStack for StackFit.expand.
BoxConstraints nonPositionedConstraints = BoxConstraints.tight(this.constraints.biggest);
RenderBox child = this._firstOnstageChild;
while (child != null) {
StackParentData childParentData = child.parentData as StackParentData;
if (!childParentData.isPositioned) {
child.layout(nonPositionedConstraints, parentUsesSize: true);
childParentData.offset = this._resolvedAlignment.alongOffset(this.size - child.size as Offset);
}
else {
this._hasVisualOverflow =
RenderStack.layoutPositionedChild(child, childParentData, this.size, this._resolvedAlignment) ||
_hasVisualOverflow;
}
D.assert(child.parentData == childParentData);
child = childParentData.nextSibling;
}
}
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
RenderBox child = this._lastOnstageChild;
for (int i = 0; i < this._onstageChildCount; i++) {
D.assert(child != null);
StackParentData childParentData = child.parentData as StackParentData;
if (childParentData.offset.dx != 0 || childParentData.offset.dy != 0) {
i = i;
}
bool isHit = result.addWithPaintOffset(
offset: childParentData.offset,
position: position,
hitTest: (BoxHitTestResult resultIn, Offset transformed) => {
D.assert(transformed == position - childParentData.offset);
return child.hitTest(resultIn, position: transformed);
}
);
if (isHit)
return true;
child = childParentData.previousSibling;
}
return false;
}
void paintStack(PaintingContext context, Offset offset) {
RenderBox child = this._firstOnstageChild;
while (child != null) {
StackParentData childParentData = child.parentData as StackParentData;
context.paintChild(child, childParentData.offset + offset);
child = childParentData.nextSibling;
}
}
public override void paint(PaintingContext context, Offset offset) {
if (this._hasVisualOverflow) {
context.pushClipRect(this.needsCompositing, offset, Offset.zero & this.size, this.paintStack);
}
else {
this.paintStack(context, offset);
}
}
void visitChildrenForSemantics(RenderObjectVisitor visitor) {
RenderBox child = this._firstOnstageChild;
while (child != null) {
visitor(child);
StackParentData childParentData = child.parentData as StackParentData;
child = childParentData.nextSibling;
}
}
public override Rect describeApproximatePaintClip(RenderObject child) =>
this._hasVisualOverflow ? Offset.zero & this.size : null;
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties);
properties.add(new IntProperty("skipCount", this.skipCount));
properties.add(new EnumProperty<TextDirection>("textDirection", this.textDirection));
}
}
}

19
com.unity.uiwidgets/Runtime/widgets/single_child_scroll_view.cs


DragStartBehavior dragStartBehavior = DragStartBehavior.start
) : base(key: key) {
D.assert(!(controller != null && primary == true),
() => "Primary ScrollViews obtain their ScrollController via inheritance from a PrimaryScrollController widget. " +
"You cannot both set primary to true and pass an explicit controller.");
() =>
"Primary ScrollViews obtain their ScrollController via inheritance from a PrimaryScrollController widget. " +
"You cannot both set primary to true and pass an explicit controller.");
this.scrollDirection = scrollDirection;
this.reverse = reverse;
this.padding = padding;

AxisDirection _getDirection(BuildContext context) {
return AxisDirectionUtils.getAxisDirectionFromAxisReverseAndDirectionality(context, this.scrollDirection,
this.reverse) ?? AxisDirection.down;
this.reverse) ?? AxisDirection.down;
}
public override Widget build(BuildContext context) {

return null;
}
protected override bool hitTestChildren(HitTestResult result, Offset position = null) {
protected override bool hitTestChildren(BoxHitTestResult result, Offset position = null) {
Offset transformed = position + (-this._paintOffset);
return this.child.hitTest(result, position: transformed);
return result.addWithPaintOffset(
offset: this._paintOffset,
position: position,
hitTest: (BoxHitTestResult resultIn, Offset transformed) => {
D.assert(transformed == position + (-this._paintOffset));
return this.child.hitTest(result, position: transformed);
}
);
}
return false;

125
Samples/UIWidgetsSamples_2019_4/Assets/ReduxSample/LocalPositionSample.cs


using System;
using System.Collections;
using System.Collections.Generic;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using UnityEngine;
public class LocalPositionSample : UIWidgetsPanel
{
protected override void OnEnable()
{
base.OnEnable();
}
protected override Widget createWidget()
{
{
return new MaterialApp(
title: "Flutter Demo",
theme: new ThemeData(
primarySwatch: Colors.blue
),
home: new MyHomePage(title: "Local Position Test"));
}
}
public class MyHomePage : StatefulWidget
{
public MyHomePage(string title, Key key = null) : base(key: key)
{
this.title = title;
}
public readonly string title;
public override State createState()
{
return new _MyHomePageState();
}
}
public class _MyHomePageState : State<MyHomePage>
{
Offset _globalPostion = Offset.zero;
Offset _localPostion = Offset.zero;
void _checkPosition(TapUpDetails tapUpDetails)
{
setState(() =>
{
_globalPostion = tapUpDetails.globalPosition;
_localPostion = tapUpDetails.localPosition;
});
}
void _checkPosition(TapDownDetails tapUpDetails)
{
setState(() =>
{
_globalPostion = tapUpDetails.globalPosition;
_localPostion = tapUpDetails.localPosition;
});
}
public override Widget build(BuildContext context)
{
return new Scaffold(
appBar: new AppBar(
title: new Text(widget.title)
),
body: new Center(
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
children: new List<Widget>()
{
new Text(
"Tap to get global position and local position:"
),
new Text(
$"global position: {_globalPostion}",
style: Theme.of(context).textTheme.headline
),
new Text(
$"local position: {_localPostion}",
style: Theme.of(context).textTheme.headline
),
new GestureDetector(
onTapUp: _checkPosition,
child: new Container(
margin: EdgeInsets.all(10),
padding: EdgeInsets.all(10),
decoration: new BoxDecoration(color: Colors.red),
child: new Text("On Tap Up")
)
),
new GestureDetector(
onTapDown: _checkPosition,
child: new Container(
margin: EdgeInsets.all(10),
padding: EdgeInsets.all(30),
decoration: new BoxDecoration(Colors.orange),
child: new Text("on Tap Down")
)
),
new GestureDetector(
onTapDown: _checkPosition,
child: new Container(
padding: EdgeInsets.all(30),
decoration: new BoxDecoration(Colors.pink),
child: new Text("on Tap Down with 0 margin")
)
)
}
)
)
);
}
}
}

11
Samples/UIWidgetsSamples_2019_4/Assets/ReduxSample/LocalPositionSample.cs.meta


fileFormatVersion: 2
guid: 4c6d96aaa15e54a47a53543e4c7ab81b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

536
Samples/UIWidgetsSamples_2019_4/Assets/Scenes/LocalPosition.unity


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &166246262
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 166246265}
- component: {fileID: 166246264}
- component: {fileID: 166246263}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &166246263
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 166246262}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &166246264
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 166246262}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 10
--- !u!4 &166246265
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 166246262}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1173156216
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1173156217}
- component: {fileID: 1173156219}
- component: {fileID: 1173156218}
m_Layer: 5
m_Name: RawImage
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1173156217
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1173156216}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1656596898}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 626.3, y: 431.9}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1173156218
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1173156216}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4c6d96aaa15e54a47a53543e4c7ab81b, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 0}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
devicePixelRatioOverride: 0
hardwareAntiAliasing: 0
--- !u!222 &1173156219
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1173156216}
m_CullTransparentMesh: 0
--- !u!1 &1514114434
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1514114436}
- component: {fileID: 1514114435}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &1514114435
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1514114434}
m_Enabled: 1
serializedVersion: 10
m_Type: 1
m_Shape: 0
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &1514114436
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1514114434}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &1656596894
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1656596898}
- component: {fileID: 1656596897}
- component: {fileID: 1656596896}
- component: {fileID: 1656596895}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1656596895
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1656596894}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &1656596896
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1656596894}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
--- !u!223 &1656596897
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1656596894}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 0
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!224 &1656596898
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1656596894}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 1173156217}
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!1 &1824294904
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1824294907}
- component: {fileID: 1824294906}
- component: {fileID: 1824294905}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &1824294905
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1824294904}
m_Enabled: 1
--- !u!20 &1824294906
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1824294904}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &1824294907
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1824294904}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

7
Samples/UIWidgetsSamples_2019_4/Assets/Scenes/LocalPosition.unity.meta


fileFormatVersion: 2
guid: 16f587e6d84ea4240b2a20ef51388ade
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存