浏览代码

Merge branch 'master' into siyaoH/1.17/rawTouches

/siyaoH-1.17-rawTouches
siyao 3 年前
当前提交
098e6ee0
共有 146 个文件被更改,包括 3397 次插入1254 次删除
  1. 10
      README-ZH.md
  2. 10
      README.md
  3. 5
      Samples/UIWidgetsSamples_2019_4/Assets/Script/CountTest.cs
  4. 13
      Samples/UIWidgetsSamples_2019_4/Assets/Script/ImageTest.cs
  5. 2
      Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/MobileTouchSample.cs.meta
  6. 19
      com.unity.uiwidgets/Editor/UIWidgetsEditorPanel.cs
  7. 2
      com.unity.uiwidgets/Editor/UIWidgetsPanelEditor.cs
  8. 3
      com.unity.uiwidgets/Runtime/Plugins/Android/libUIWidgets.so.meta
  9. 2
      com.unity.uiwidgets/Runtime/Plugins/osx/libUIWidgets.dylib.meta
  10. 8
      com.unity.uiwidgets/Runtime/async/future.cs
  11. 8
      com.unity.uiwidgets/Runtime/async/zone.cs
  12. 2
      com.unity.uiwidgets/Runtime/cupertino/action_Sheet.cs
  13. 855
      com.unity.uiwidgets/Runtime/cupertino/date_picker.cs
  14. 2
      com.unity.uiwidgets/Runtime/cupertino/dialog.cs
  15. 2
      com.unity.uiwidgets/Runtime/cupertino/route.cs
  16. 3
      com.unity.uiwidgets/Runtime/engine/UIWidgetsGlobalConfiguration.cs
  17. 89
      com.unity.uiwidgets/Runtime/engine/UIWidgetsPanel.cs
  18. 21
      com.unity.uiwidgets/Runtime/engine/UIWidgetsPanelWrapper.cs
  19. 10
      com.unity.uiwidgets/Runtime/engine/raycastable/RaycastManager.cs
  20. 4
      com.unity.uiwidgets/Runtime/engine/raycastable/RaycastableContainer.cs
  21. 20
      com.unity.uiwidgets/Runtime/external/SplayTree.cs
  22. 14
      com.unity.uiwidgets/Runtime/foundation/assertions.cs
  23. 9
      com.unity.uiwidgets/Runtime/foundation/debug.cs
  24. 8
      com.unity.uiwidgets/Runtime/gestures/converter.cs
  25. 2
      com.unity.uiwidgets/Runtime/material/chip.cs
  26. 2
      com.unity.uiwidgets/Runtime/material/input_decorator.cs
  27. 2
      com.unity.uiwidgets/Runtime/material/list_tile.cs
  28. 1
      com.unity.uiwidgets/Runtime/material/slider.cs
  29. 1
      com.unity.uiwidgets/Runtime/material/tooltip.cs
  30. 12
      com.unity.uiwidgets/Runtime/painting/alignment.cs
  31. 31
      com.unity.uiwidgets/Runtime/painting/colors.cs
  32. 393
      com.unity.uiwidgets/Runtime/rendering/mouse_tracking.cs
  33. 8
      com.unity.uiwidgets/Runtime/rendering/paragraph.cs
  34. 2
      com.unity.uiwidgets/Runtime/rendering/tweens.cs
  35. 1
      com.unity.uiwidgets/Runtime/scheduler/binding.cs
  36. 7
      com.unity.uiwidgets/Runtime/services/keyboard.cs
  37. 67
      com.unity.uiwidgets/Runtime/services/keyboard_key.cs
  38. 3
      com.unity.uiwidgets/Runtime/ui/hooks.cs
  39. 18
      com.unity.uiwidgets/Runtime/ui/painting.cs
  40. 11
      com.unity.uiwidgets/Runtime/ui/pointer.cs
  41. 20
      com.unity.uiwidgets/Runtime/ui/text.cs
  42. 7
      com.unity.uiwidgets/Runtime/ui/window.cs
  43. 116
      com.unity.uiwidgets/Runtime/widgets/LottiePainter.cs
  44. 12
      com.unity.uiwidgets/Runtime/widgets/actions.cs
  45. 2
      com.unity.uiwidgets/Runtime/widgets/binding.cs
  46. 22
      com.unity.uiwidgets/Runtime/widgets/framework.cs
  47. 2
      com.unity.uiwidgets/Runtime/widgets/inherited_notifier.cs
  48. 2
      com.unity.uiwidgets/Runtime/widgets/layout_builder.cs
  49. 396
      com.unity.uiwidgets/Runtime/widgets/list_wheel_scroll_view.cs
  50. 2
      com.unity.uiwidgets/Runtime/widgets/page_view.cs
  51. 16
      com.unity.uiwidgets/Runtime/widgets/routes.cs
  52. 51
      com.unity.uiwidgets/Runtime/widgets/scroll_metrics.cs
  53. 4
      com.unity.uiwidgets/Runtime/widgets/scroll_position.cs
  54. 31
      com.unity.uiwidgets/Runtime/widgets/shortcuts.cs
  55. 4
      com.unity.uiwidgets/Runtime/widgets/sliver.cs
  56. 2
      com.unity.uiwidgets/Runtime/widgets/sliver_persistent_header.cs
  57. 2
      com.unity.uiwidgets/Runtime/widgets/table.cs
  58. 4
      com.unity.uiwidgets/Runtime/widgets/title.cs
  59. 2
      com.unity.uiwidgets/Runtime/widgets/widget_span.cs
  60. 307
      engine/Build.bee.cs
  61. 2
      engine/README.md
  62. 59
      engine/Scripts/lib_build.py
  63. 15
      engine/Scripts/lib_build_android.sh
  64. 2
      engine/src/lib/ui/painting/picture.cc
  65. 22
      engine/src/lib/ui/painting/skottie.cc
  66. 3
      engine/src/lib/ui/window/pointer_data.h
  67. 1
      engine/src/lib/ui/window/pointer_data_packet_converter.cc
  68. 1
      engine/src/lib/ui/window/window.cc
  69. 1
      engine/src/shell/platform/embedder/embedder.cc
  70. 1
      engine/src/shell/platform/embedder/embedder.h
  71. 8
      engine/src/shell/platform/unity/android/uiwidgets_panel.cc
  72. 2
      engine/src/shell/platform/unity/android/uiwidgets_panel.h
  73. 2
      engine/src/shell/platform/unity/darwin/ios/uiwidgets_panel.h
  74. 7
      engine/src/shell/platform/unity/darwin/ios/uiwidgets_panel.mm
  75. 2
      engine/src/shell/platform/unity/darwin/ios/uiwidgets_system.mm
  76. 24
      engine/src/shell/platform/unity/darwin/ios/unity_surface_manager.h
  77. 44
      engine/src/shell/platform/unity/darwin/ios/unity_surface_manager.mm
  78. 2
      engine/src/shell/platform/unity/darwin/macos/uiwidgets_panel.h
  79. 8
      engine/src/shell/platform/unity/darwin/macos/uiwidgets_panel.mm
  80. 2
      engine/src/shell/platform/unity/darwin/macos/uiwidgets_system.mm
  81. 24
      engine/src/shell/platform/unity/darwin/macos/unity_surface_manager.h
  82. 84
      engine/src/shell/platform/unity/darwin/macos/unity_surface_manager.mm
  83. 7
      engine/src/shell/platform/unity/windows/uiwidgets_panel.cc
  84. 2
      engine/src/shell/platform/unity/windows/uiwidgets_panel.h
  85. 8
      Samples/UIWidgetsSamples_2019_4/Assets/Editor/tests.meta
  86. 3
      Samples/UIWidgetsSamples_2019_4/Assets/RecastablePanelSample.meta
  87. 808
      Samples/UIWidgetsSamples_2019_4/Assets/Scene/RecastableTest.unity
  88. 7
      Samples/UIWidgetsSamples_2019_4/Assets/Scene/RecastableTest.unity.meta
  89. 581
      Samples/UIWidgetsSamples_2019_4/Assets/Scene/StreamTest.unity
  90. 7
      Samples/UIWidgetsSamples_2019_4/Assets/Scene/StreamTest.unity.meta
  91. 157
      Samples/UIWidgetsSamples_2019_4/Assets/Script/StreamTest.cs
  92. 58
      Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/StreamBuilderSample.cs
  93. 3
      Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/StreamBuilderSample.cs.meta
  94. 8
      com.unity.uiwidgets/Runtime/Plugins/Android/arm64.meta

10
README-ZH.md


| -----------------------------------------------| ------------------------- | ------------------------- |
| 1.5.4 及以下 | 2019.4.10f1 及以上 | N\A |
| 2.0.1 | 2019.4.26f1c1 | N\A |
| 2.0.2 及以上 | 2019.4.26f1c1 及以上 | N\A |
| 2.0.2 及以上 | 2019.4.26f1c1 ~ 2019.4.29f1c1 | N\A |
#### UIWidgets包

namespace UIWidgetsSample
{
public class CountDemo : UIWidgetsPanel
public class UIWidgetsExample : UIWidgetsPanel
{
protected void OnEnable()
{

## 调试UIWidgets应用程序
在编辑器菜单栏选择```UIWidgets->EnableDebug```
Editor模式下,编辑器菜单栏选择```UIWidgets->EnableDebug```
如果想在runtime开启debug模式,请在项目代码中设置```UIWidgetsGlobalConfiguration.EnableDebugAtRuntime = true```。在默认情况下debug模式为关闭状态
在Runtime模式下,Debug/Development build会自动开启Debug,Release build则会自动关闭Debug
## 使用Window Scope保护外部调用
如果您在调试时遇到 `AssertionError: Window.instance is null` 或者在调用 `Window.instance` 时得到空指针, 那么您需要

#### Wiki
目前开发团队仍在改进UIWidgets Wiki。 由于UIWidgets主要来源于Flutter,你也可以参考Flutter Wiki中与UIWidgets API对应部分的详细描述。
同时,你可以加入我们的讨论组( https://learn.unity.com/g/uiwidgets )
同时,你也可以加入我们的[讨论组](https://unity.cn/plate/uiwidgets)来和大家交流使用心得
#### 常问问题解答

10
README.md


| -----------------------------------------------| ------------------------- | ------------------------- |
| 1.5.4 and below | 2019.4.10f1 and above | N\A |
| 2.0.1 | 2019.4.26f1c1 | N\A |
| 2.0.2 and above | 2019.4.26f1c1 and above | N\A |
| 2.0.2 and above | 2019.4.26f1c1 ~ 2019.4.29f1c1 | N\A |
#### UIWidgets Package
Visit our Github repository https://github.com/Unity-Technologies/com.unity.uiwidgets

namespace UIWidgetsSample
{
public class CountDemo : UIWidgetsPanel
public class UIWidgetsExample : UIWidgetsPanel
{
protected void OnEnable()
{

## Debug UIWidgets Application
In Unity editor, you can switch debug/release mode by “UIWidgets->EnableDebug”.
In the Editor, you can switch debug/release mode by “UIWidgets->EnableDebug”.
You can also enable debug mode in runtime by setting ```UIWidgetsGlobalConfiguration.EnableDebugAtRuntime = true``` in your project. Note that this value is set to false by default.
In the Player, the debug/development build will enable debug mode. The release build will disable debug mode automatically.
## Using Window Scope
If you see the error `AssertionError: Window.instance is null` or null pointer error of `Window.instance`,

The develop team is still working on the UIWidgets Wiki. However, since UIWidgets is mainly derived from Flutter,
you can refer to Flutter Wiki to access detailed descriptions of UIWidgets APIs
from those of their Flutter counterparts.
Meanwhile, you can join the discussion channel at (https://learn.unity.com/g/uiwidgets)
Meanwhile, you can join our [discussion channel](https://unity.cn/plate/uiwidgets) to keep in touch with the community.
#### FAQ

5
Samples/UIWidgetsSamples_2019_4/Assets/Script/CountTest.cs


{
public class CountTest : UIWidgetsPanel
{
protected void OnEnable()
{
base.OnEnable();
}
protected override void main()
{
ui_.runApp(new MyApp());

13
Samples/UIWidgetsSamples_2019_4/Assets/Script/ImageTest.cs


class ExampleState : State<ExampleApp>
{
private float frame = 0;
public override Widget build(BuildContext context)
{
return new Container(

AnimatedLottie.file("wine.json", frame: frame, curve: Curves.linear),
new Lottie("wine.json", size: new Size(100, 100)),
new Container(
width: 100,
height: 100,

child: Image.network(
"https://unity-cn-cms-prd-1254078910.cos.ap-shanghai.myqcloud.com/assetstore-cms-media/img-7dfe215f-0075-4f9c-9b5a-be5ee88b866b",
gaplessPlayback: true)
),
new GestureDetector(
onTap: () => { setState(() => { frame += 1; }); },
child: new Container(
color: Color.black,
padding: EdgeInsets.symmetric(20, 20),
child: new Text("Click Me",
style: new TextStyle(fontWeight: FontWeight.w700))
)
)
}
)

2
Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/MobileTouchSample.cs.meta


fileFormatVersion: 2
guid: a5573cb4e607a9e48983cecf7876926e
guid: 925efb3da7848c24a84e0306cdd8de3c
MonoImporter:
externalObjects: {}
serializedVersion: 2

19
com.unity.uiwidgets/Editor/UIWidgetsEditorPanel.cs


get { return Mathf.RoundToInt(f: position.size.y); }
}
protected float? devicePixelRatioEditorOnlyOverride = null;
get { return EditorGUIUtility.pixelsPerPoint; }
get {
return devicePixelRatioEditorOnlyOverride ?? EditorGUIUtility.pixelsPerPoint; }
}
protected virtual void OnUpdate() {
OnUpdate();
//enable listener to MouseMoveEvents by default
//user can disable it in onEnable() if needed
wantsMouseMove = true;
_configurations = new Configurations();
_wrapper = new UIWidgetsPanelWrapper();
onEnable();

delta.y /= 3f;
var pos = _getPointerPosition(position: evt.mousePosition);
_wrapper.OnMouseScroll(delta: delta, pos: pos);
}
else if (evt.isKey) {
_wrapper.OnKeyDown(e: evt);
Event.current.Use();
}
}

2
com.unity.uiwidgets/Editor/UIWidgetsPanelEditor.cs


using Unity.UIWidgets.engine;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using UnityEditor;

public override void OnInspectorGUI() {
base.OnInspectorGUI();
EditorGUILayout.PropertyField(serializedObject.FindProperty("fonts"), true);
EditorGUILayout.PropertyField(serializedObject.FindProperty("devicePixelRatioEditorOnlyOverride"), new GUIContent(text: "[EditorOnly]DPR Override"), false);
EditorGUI.BeginChangeCheck();
UIWidgetsPanel panel = (UIWidgetsPanel)target;
serializedObject.ApplyModifiedProperties();

3
com.unity.uiwidgets/Runtime/Plugins/Android/libUIWidgets.so.meta


fileFormatVersion: 2
guid: 983c1f57f6a4847638f514f55f79c8b4
guid: 44a73cced101346fcadd6be5304e117d
PluginImporter:
externalObjects: {}
serializedVersion: 2

Exclude Editor: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
Exclude iOS: 1

2
com.unity.uiwidgets/Runtime/Plugins/osx/libUIWidgets.dylib.meta


fileFormatVersion: 2
guid: 70f8ceca890db46af80df52d443eb11c
guid: 254931c60ed1242219bc572777ab7f31
PluginImporter:
externalObjects: {}
serializedVersion: 2

8
com.unity.uiwidgets/Runtime/async/future.cs


}
public abstract class Future {
static readonly _Future _nullFuture = _Future.zoneValue(null, Zone.root);
internal static readonly _Future _nullFuture = _Future.zoneValue(null, Zone.root);
static readonly _Future _falseFuture = _Future.zoneValue(false, Zone.root);
internal static readonly _Future _falseFuture = _Future.zoneValue(false, Zone.root);
public static Future create(Func<FutureOr> computation) {
_Future result = new _Future();

future.then((object value) => {
remaining--;
if (values != null) {
values.Insert(pos, (T)value);
values[pos] = (T)value;
if (remaining == 0) {
result._completeWithValue(values);
}

return value(FutureOr.value(new List<T>()));
}
values = new List<T>(remaining);
values = new List<T>(new T[remaining]);
}
catch (Exception e) {
// The error must have been thrown while iterating over the futures

8
com.unity.uiwidgets/Runtime/async/zone.cs


public AsyncError(Exception innerException) : base(null, innerException) {
}
public static string defaultStackTrace(object error) {
if (error is Exception ex) {
return ex.StackTrace;
}
return "";
}
}
struct _ZoneFunction<T> where T : Delegate {

2
com.unity.uiwidgets/Runtime/cupertino/action_Sheet.cs


_AlertSections.actionsSection);
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(child == _contentElement || child == _actionsElement);
if (_contentElement == child) {
_contentElement = null;

855
com.unity.uiwidgets/Runtime/cupertino/date_picker.cs
文件差异内容过多而无法显示
查看文件

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


_AlertDialogSections.actionsSection);
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(child == _contentElement || child == _actionsElement);
if (_contentElement == child) {
_contentElement = null;

2
com.unity.uiwidgets/Runtime/cupertino/route.cs


}
public string barrierLabel {
public override string barrierLabel {
get { return null; }
}

3
com.unity.uiwidgets/Runtime/engine/UIWidgetsGlobalConfiguration.cs


//disable incremental gc by default
public static bool EnableIncrementalGC = false;
//disable debug at runtime by default
public static bool EnableDebugAtRuntime = false;
}
}

89
com.unity.uiwidgets/Runtime/engine/UIWidgetsPanel.cs


using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Profiling;
using UnityEngine.Rendering;
using UnityEngine.Scripting;
using UnityEngine.UI;
using Path = System.IO.Path;

}
}
[ExecuteInEditMode]
public partial class UIWidgetsPanel : RawImage, IUIWidgetsWindow {
static List<UIWidgetsPanel> panels = new List<UIWidgetsPanel>();

panels.Remove(panel);
}
float _devicePixelRatioOverride;
public bool hardwareAntiAliasing;
public float devicePixelRatioEditorOnlyOverride;
protected UIWidgetsPanelWrapper wrapper {
get { return _wrapper; }
}
int _currentWidth {
get { return Mathf.RoundToInt(rectTransform.rect.width * canvas.scaleFactor); }

get { return Mathf.RoundToInt(rectTransform.rect.height * canvas.scaleFactor); }
}
float _currentDevicePixelRatio {
protected float _currentDevicePixelRatio {
if (devicePixelRatioEditorOnlyOverride > 0) {
return devicePixelRatioEditorOnlyOverride;
}
var currentDpi = Screen.dpi;
if (currentDpi == 0) {
currentDpi = canvas.GetComponent<CanvasScaler>().fallbackScreenDPI;

void _handleViewMetricsChanged(string method, List<JSONNode> args) {
using (Isolate.getScope(anyIsolate)) {
if (_wrapper == null) {
return;
}
_wrapper.displayMetrics.onViewMetricsChanged();
Window.instance.updateSafeArea();
Window.instance.onMetricsChanged?.Invoke();

#endregion
IEnumerator ReEnableUIWidgetsNextFrame() {
yield return null;
enabled = true;
}
IEnumerator DoInitAndroid() {
yield return new WaitForEndOfFrame();
AndroidPlatformUtil.Init();
yield return new WaitForEndOfFrame();
enabled = true;
}
startCoroutine(DoInitAndroid());
AndroidPlatformUtil.Init();
startCoroutine(ReEnableUIWidgetsNextFrame());
static bool UIWidgetsDisabled;
void DisableUIWidgets() {
Debug.Log("Please change graphic api for UIWidgets.\n" +
"Metal for iOS and MacOS.\n" +
"Direct3D11 for Windows\n" +
"Vulkan for Android\n");
UIWidgetsDisabled = true;
enabled = false;
}
protected void OnEnable() {
protected override void OnEnable() {
if (UIWidgetsDisabled) {
enabled = false;
return;
}
var type = SystemInfo.graphicsDeviceType;
if(type != GraphicsDeviceType.OpenGLES2 && type != GraphicsDeviceType.OpenGLES3){
DisableUIWidgets();
return;
}
#if UNITY_IOS || UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX
if (type != GraphicsDeviceType.Metal) {
DisableUIWidgets();
return;
}
#endif
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
if (type != GraphicsDeviceType.Direct3D11) {
DisableUIWidgets();
return;
}
#endif
// If user duplicates uiwidgets gameobject in scene, canvas could be null during OnEnable, which results in error. Skip to avoid error.
// More explanation: during duplication, editor wakes and enables behaviors in certain order. GameObject behaviors are enabled before canvas.
if (canvas == null) {
enabled = false;
startCoroutine(ReEnableUIWidgetsNextFrame());
return;
}
#if !UNITY_EDITOR && UNITY_IOS
//the hook API cannot be automatically called on IOS, so we need try hook it here
Hooks.tryHook();

}
protected override void OnDisable() {
unregisterPanel(this);
D.assert(_wrapper != null);
_wrapper?.Destroy();
if (_wrapper != null) {
unregisterPanel(this);
_wrapper.Destroy();
}
_wrapper = null;
texture = null;
Input_OnDisable();

return new Offset(dx: screenPos.x, Screen.height - screenPos.y);
}
public void mainEntry() {
public virtual void mainEntry() {
main();
}

}
Vector2? _getPointerPosition(Vector2 position) {
var worldCamera = canvas.worldCamera;
var worldCamera = canvas.renderMode == RenderMode.ScreenSpaceOverlay ? null : canvas.worldCamera;
if (RectTransformUtility.ScreenPointToLocalPointInRectangle(
rect: rectTransform, screenPoint: position, cam: worldCamera, out var localPoint)) {
var scaleFactor = canvas.scaleFactor;

21
com.unity.uiwidgets/Runtime/engine/UIWidgetsPanelWrapper.cs


int width, int height, float dpi, string streamingAssetsPath, string font_settings);
[DllImport(NativeBindings.dllName)]
[return: MarshalAs(UnmanagedType.U1)]
static extern bool UIWidgetsPanel_releaseNativeTexture(IntPtr ptr);
[DllImport(NativeBindings.dllName)]

}
}
public void Destroy() {
UIWidgetsPanel_onDisable(ptr: _ptr);
UIWidgetsPanel_dispose(ptr: _ptr);
_ptr = IntPtr.Zero;
if (_ptr != IntPtr.Zero) {
UIWidgetsPanel_onDisable(ptr: _ptr);
UIWidgetsPanel_dispose(ptr: _ptr);
_ptr = IntPtr.Zero;
}
_handle.Free();
_handle = default;

}
public void OnKeyDown(Event e) {
UIWidgetsPanel_onKey(ptr: _ptr, keyCode: e.keyCode, e.type == EventType.KeyDown);
int modifier = 0;
#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
modifier |= e.shift ? (1 << (int) FunctionKey.shift) : 0;
modifier |= e.alt ? (1 << (int) FunctionKey.alt) : 0;
modifier |= e.command ? (1 << (int) FunctionKey.command) : 0;
modifier |= e.control ? (1 << (int) FunctionKey.control) : 0;
#endif
UIWidgetsPanel_onKey(ptr: _ptr, keyCode: e.keyCode, e.type == EventType.KeyDown, modifier);
if (e.character != 0 || e.keyCode == KeyCode.Backspace) {
PointerEventConverter.KeyEvent.Enqueue(new Event(other: e));
// TODO: add on char

static extern void UIWidgetsPanel_onChar(IntPtr ptr, char c);
[DllImport(dllName: NativeBindings.dllName)]
static extern void UIWidgetsPanel_onKey(IntPtr ptr, KeyCode keyCode, bool isKeyDown);
static extern void UIWidgetsPanel_onKey(IntPtr ptr, KeyCode keyCode, bool isKeyDown, int modifier);
[DllImport(dllName: NativeBindings.dllName)]
static extern void UIWidgetsPanel_onMouseDown(IntPtr ptr, float x, float y, int button);

10
com.unity.uiwidgets/Runtime/engine/raycastable/RaycastManager.cs


using Unity.UIWidgets.ui;
using UnityEngine;
namespace Unity.UIWidgets.engine.raycast {
namespace Unity.UIWidgets.engine {
public class RaycastableRect {
bool _isDirty = true;

$"Raycast Handler Map already contains Widget {widgetHashCode} at Window {windowHashCode}");
instance.raycastHandlerMap[windowHashCode][widgetHashCode] = new RaycastableRect();
}
public static void OnScreenSizeChanged(int windowHashCode) {
if (!instance.raycastHandlerMap.ContainsKey(windowHashCode)) return;
Dictionary<int, RaycastableRect> raycastableWidgets = RaycastManager.instance.raycastHandlerMap[windowHashCode];
foreach (var item in raycastableWidgets) {
MarkDirty(item.Key, windowHashCode);
}
}
public static void MarkDirty(int widgetHashCode, int windowHashCode) {

4
com.unity.uiwidgets/Runtime/engine/raycastable/RaycastableContainer.cs


using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
namespace Unity.UIWidgets.engine.raycast {
namespace Unity.UIWidgets.engine {
windowHashCode = Window.instance.GetHashCode();
windowHashCode = Isolate.current.GetHashCode();
}
readonly int windowHashCode;

20
com.unity.uiwidgets/Runtime/external/SplayTree.cs


using System.Collections.Generic;
using System.Linq;
namespace Unity.UIWidgets.external {
class SplayTree<TKey, TValue> : IDictionary<TKey, TValue> where TKey : IComparable<TKey> {
namespace Unity.UIWidgets.external {
public class SplayTree<TKey, TValue> : IDictionary<TKey, TValue> where TKey : IComparable<TKey> {
SplayTreeNode root;
int count;
int version = 0;

if (key == null) throw new Exception("should input null");
if (root == null) throw new Exception("root is null");
int comp = Splay(key);
if (comp < 0) return root.Key;
if (comp > 0) return root.Key;
SplayTreeNode node = root.LeftChild;
if (node == null) throw new Exception("does not exist");
while (node.RightChild != null) {

}
public TKey firstKey() {
if (root == null) return default; // TODO: this is suppose to be null
var first = First().Value;
return first.Key;
}
public TKey lastKey() {
if (root == null) return default; // TODO: this is suppose to be null
var last = Last().Value;
return last.Key;
}
if (comp > 0) return root.Key;
if (comp < 0) return root.Key;
SplayTreeNode node = root.LeftChild;
if (node == null) throw new Exception("does not exist");
while (node.LeftChild != null) {

14
com.unity.uiwidgets/Runtime/foundation/assertions.cs


public delegate IEnumerable<DiagnosticsNode> DiagnosticPropertiesTransformer(IEnumerable<DiagnosticsNode> properties);
public delegate IEnumerable<DiagnosticsNode> InformationCollector();
internal abstract class _ErrorDiagnostic : DiagnosticsProperty<List<object>> {
public abstract class _ErrorDiagnostic : DiagnosticsProperty<List<object>> {
internal _ErrorDiagnostic(
string message,
DiagnosticsTreeStyle style = DiagnosticsTreeStyle.flat,

return string.Join("", value);
}
}
internal class ErrorDescription : _ErrorDiagnostic {
public class ErrorDescription : _ErrorDiagnostic {
public ErrorDescription(string message) : base(message, level: DiagnosticLevel.info) {
}

internal class ErrorSummary : _ErrorDiagnostic {
public class ErrorSummary : _ErrorDiagnostic {
public ErrorSummary(string message) : base(message, level: DiagnosticLevel.summary) {
}

details.toDiagnosticsNode(style: DiagnosticsTreeStyle.error)).TrimEnd(), details.exception);
}
D.logError($"Another exception was thrown: ${details.summary}");
D.logError($"Another exception was thrown: ${details.summary}", details.exception);
_errorCount += 1;
}

9
com.unity.uiwidgets/Runtime/foundation/debug.cs


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Unity.UIWidgets.engine;

throw new AssertionError(message != null ? message() : "");
}
}
[Conditional("UNITY_ASSERTIONS")]
public static void assert(bool result, Func<string> message = null) {
if ( enableDebug && !result ) {

#if UNITY_EDITOR
static bool? _enableDebug = null;
public static bool enableDebug {
get {
if (_enableDebug == null) {

}
}
#else
public static bool enableDebug => UIWidgetsGlobalConfiguration.EnableDebugAtRuntime;
//In the runtime, we use the Conditional decorator instead of this to enable/disable debug mode
//The rule is simple: the debug mode is on for Debug/Development build, and is off for Release build
public static bool enableDebug => true;
#endif
public static void _debugDrawDoubleRect(Canvas canvas, Rect outerRect, Rect innerRect, Color color) {

public AssertionError(string message) : base(message: message) {
}
public AssertionError(string message, Exception innerException = null) : base(message: message) {
public AssertionError(string message, Exception innerException) : base(message: message) {
this.innerException = innerException;
}

8
com.unity.uiwidgets/Runtime/gestures/converter.cs


}else if (datum.change == PointerChange.kMouseUp) {
keyBoardEvent.type = EventType.KeyUp;
}
#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX || UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
keyBoardEvent.shift = (datum.modifier & (1 << (int) FunctionKey.shift)) > 0;
keyBoardEvent.alt = (datum.modifier & (1 << (int) FunctionKey.alt)) > 0;
keyBoardEvent.command = (datum.modifier & (1 << (int) FunctionKey.command)) > 0;
keyBoardEvent.control = (datum.modifier & (1 << (int) FunctionKey.control)) > 0;
#endif
RawKeyboard.instance._handleKeyEvent(keyBoardEvent);
TextInput.OnGUI();
}

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


slotToChild.Values.Each((value) => { visitor(value); });
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(slotToChild.ContainsValue(child));
D.assert(childToSlot.ContainsKey(child));
_ChipSlot slot = childToSlot[child];

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


slotToChild.Values.Each((child) => { visitor(child); });
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(slotToChild.ContainsValue(child));
D.assert(childToSlot.ContainsKey(child));
_DecorationSlot slot = childToSlot[child];

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


}
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(slotToChild.Values.Contains(child));
D.assert(childToSlot.Keys.Contains(child));
_ListTileSlot slot = childToSlot[child];

1
com.unity.uiwidgets/Runtime/material/slider.cs


using uiwidgets;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;

1
com.unity.uiwidgets/Runtime/material/tooltip.cs


using uiwidgets;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;

12
com.unity.uiwidgets/Runtime/painting/alignment.cs


return b * t;
if (b == null)
return a * (1.0f - t);
if (a is Alignment && b is Alignment)
return Alignment.lerp(a, b, t);
if (a is AlignmentDirectional && b is AlignmentDirectional)
return AlignmentDirectional.lerp(a, b, t);
if (a is Alignment _a && b is Alignment _b)
return Alignment.lerpAlignment(_a, _b, t);
if (a is AlignmentDirectional _ad && b is AlignmentDirectional _bd)
return AlignmentDirectional.lerpAlignmentDirectional(_ad, _bd, t);
return new _MixedAlignment(
MathUtils.lerpNullableFloat(a._x, b._x, t),
MathUtils.lerpNullableFloat(a._start, b._start, t),

);
}
public static Alignment lerp(Alignment a, Alignment b, float t) {
public static Alignment lerpAlignment(Alignment a, Alignment b, float t) {
if (a == null && b == null) {
return null;
}

return new AlignmentDirectional(start % other, y % other);
}
static AlignmentDirectional lerp(AlignmentDirectional a, AlignmentDirectional b, float t) {
public static AlignmentDirectional lerpAlignmentDirectional(AlignmentDirectional a, AlignmentDirectional b, float t) {
D.assert(t != null);
if (a == null && b == null)
return null;

31
com.unity.uiwidgets/Runtime/painting/colors.cs


public partial class painting_ {
internal static float _getHue(float red, float green, float blue, float max, float delta) {
float hue = 0;
if (max == 0.0f) {
if (max == 0.0f || delta == 0.0f) {
hue = 0.0f;
}
else if (max == red) {

public static HSVColor fromAHSV(float alpha, float hue, float saturation, float value) {
return new HSVColor(alpha, hue, saturation, value);
}
public static HSVColor fromColor(Color color) {
float red = color.red / 0xFF;
float green = color.green / 0xFF;
float blue = color.blue / 0xFF;
float max = Mathf.Max(red, Mathf.Max(green, blue));
float min = Mathf.Min(red, Mathf.Min(green, blue));
float delta = max - min;
float alpha = color.alpha / 0xFF;
float hue = painting_._getHue(red, green, blue, max, delta);
float saturation = max == 0.0f ? 0.0f : delta / max;
return new HSVColor(alpha, hue, saturation, max);
}
public HSVColor withAlpha(float alpha) {
return fromAHSV(alpha, hue, saturation, value);

return HSLColor.fromAHSL(alpha, hue, saturation, lightness);
}
readonly float alpha;
public readonly float alpha;
readonly float hue;
public readonly float hue;
readonly float saturation;
public readonly float saturation;
readonly float lightness;
public readonly float lightness;
HSLColor withAlpha(float alpha) {
return HSLColor.fromAHSL(alpha, hue, saturation, lightness);

return HSLColor.fromAHSL(alpha, hue, saturation, lightness);
}
HSLColor withSaturation(float saturation) {
public HSLColor withSaturation(float saturation) {
HSLColor withLightness(float lightness) {
public HSLColor withLightness(float lightness) {
Color toColor() {
public Color toColor() {
float chroma = Mathf.Abs(1.0f - (2.0f * lightness - 1.0f) * saturation);
float secondary = chroma * (1.0f - Mathf.Abs(((hue / 60.0f) % 2.0f) - 1.0f));
float match = lightness - chroma / 2.0f;

393
com.unity.uiwidgets/Runtime/rendering/mouse_tracking.cs


using System;
using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.foundation;

public delegate void PointerExitEventListener(PointerExitEvent evt);
public delegate void PointerDragFromEditorEnterEventListener(PointerDragFromEditorEnterEvent evt);
public delegate void PointerDragFromEditorHoverEventListener(PointerDragFromEditorHoverEvent evt);
public delegate void PointerDragFromEditorExitEventListener(PointerDragFromEditorExitEvent evt);
public delegate void _UpdatedDeviceHandler(_MouseState mouseState,
HashSet<MouseTrackerAnnotation> previousAnnotations);
public delegate void PointerDragFromEditorReleaseEventListener(PointerDragFromEditorReleaseEvent evt);
public delegate void _UpdatedDeviceHandler(_MouseState mouseState, HashSet<MouseTrackerAnnotation> previousAnnotations);
public class _MouseState {
PointerEvent _latestEvent;
public class _MouseState {
public _MouseState(PointerEvent initialEvent = null
) {
D.assert(initialEvent != null);

public HashSet<MouseTrackerAnnotation> annotations {
get { return _annotations;}
}
HashSet<MouseTrackerAnnotation> _annotations = new HashSet<MouseTrackerAnnotation>();
public HashSet<MouseTrackerAnnotation> replaceAnnotations(HashSet<MouseTrackerAnnotation> value) {
HashSet<MouseTrackerAnnotation> previous = _annotations;
_annotations = value;
return previous;
}
public HashSet<MouseTrackerAnnotation> annotations { get; private set; } =
new HashSet<MouseTrackerAnnotation>();
// The most recently processed mouse event observed from this device.
public PointerEvent latestEvent {

_latestEvent = value;
}
}
PointerEvent _latestEvent;
get { return latestEvent.device;}
get { return latestEvent.device; }
}
public HashSet<MouseTrackerAnnotation> replaceAnnotations(HashSet<MouseTrackerAnnotation> value) {
var previous = annotations;
annotations = value;
return previous;
return Event == null ? "null" : describeIdentity(Event);
return Event == null ? "null" : describeIdentity(Object: Event);
string describeLatestEvent = $"latestEvent: {describeEvent(latestEvent)}";
string describeAnnotations = $"annotations: [list of {annotations.Count}]";
return $"{describeIdentity(this)}"+$"({describeLatestEvent}, {describeAnnotations})";
var describeLatestEvent = $"latestEvent: {describeEvent(Event: latestEvent)}";
var describeAnnotations = $"annotations: [list of {annotations.Count}]";
return $"{describeIdentity(this)}" + $"({describeLatestEvent}, {describeAnnotations})";
public class MouseTrackerAnnotation {
public class MouseTrackerAnnotation : Diagnosticable {
public readonly PointerEnterEventListener onEnter;
public readonly PointerExitEventListener onExit;
public readonly PointerHoverEventListener onHover;
PointerExitEventListener onExit = null,
PointerDragFromEditorEnterEventListener onDragFromEditorEnter = null,
PointerDragFromEditorHoverEventListener onDragFromEditorHover = null,
PointerDragFromEditorExitEventListener onDragFromEditorExit = null,
PointerDragFromEditorReleaseEventListener onDragFromEditorRelease = null
PointerExitEventListener onExit = null
this.onDragFromEditorEnter = onDragFromEditorEnter;
this.onDragFromEditorHover = onDragFromEditorHover;
this.onDragFromEditorExit = onDragFromEditorExit;
this.onDragFromEditorRelease = onDragFromEditorRelease;
public readonly PointerEnterEventListener onEnter;
public readonly PointerHoverEventListener onHover;
public readonly PointerExitEventListener onExit;
public readonly PointerDragFromEditorEnterEventListener onDragFromEditorEnter;
public readonly PointerDragFromEditorHoverEventListener onDragFromEditorHover;
public readonly PointerDragFromEditorExitEventListener onDragFromEditorExit;
public readonly PointerDragFromEditorReleaseEventListener onDragFromEditorRelease;
public override void debugFillProperties(DiagnosticPropertiesBuilder properties) {
base.debugFillProperties(properties: properties);
properties.add(new FlagsSummary<Delegate>(
"callbacks",
new Dictionary<string, Delegate> {
{"enter", onEnter},
{"hover", onHover},
{"exit", onExit}
},
"<none>"
));
}
public readonly MouseTrackerAnnotation annotation;
public HashSet<int> activeDevices = new HashSet<int>();
}
public delegate IEnumerable<MouseTrackerAnnotation> MouseDetectorAnnotationFinder(Offset offset);
public class MouseTracker : ChangeNotifier {
public readonly Dictionary<int, _MouseState> _mouseStates = new Dictionary<int, _MouseState>();
readonly PointerRouter _router;
public readonly MouseTrackerAnnotation annotation;
public readonly Dictionary<MouseTrackerAnnotation, _TrackedAnnotation> _trackedAnnotations =
new Dictionary<MouseTrackerAnnotation, _TrackedAnnotation>();
public HashSet<int> activeDevices = new HashSet<int>();
}
public readonly MouseDetectorAnnotationFinder annotationFinder;
public delegate IEnumerable<MouseTrackerAnnotation> MouseDetectorAnnotationFinder(Offset offset);
bool _duringDeviceUpdate;
public bool _hasScheduledPostFrameCheck;
public class MouseTracker : ChangeNotifier{
router.addGlobalRoute(_handleEvent);
router.addGlobalRoute(route: _handleEvent);
public bool mouseIsConnected {
get { return _mouseStates.isNotEmpty(); }
}
public static bool _duringBuildPhase {
get { return SchedulerBinding.instance.schedulerPhase == SchedulerPhase.persistentCallbacks; }
}
_router.removeGlobalRoute(_handleEvent);
_router.removeGlobalRoute(route: _handleEvent);
public readonly MouseDetectorAnnotationFinder annotationFinder;
readonly Dictionary<int, PointerEvent> _lastMouseEvent = new Dictionary<int, PointerEvent>();
readonly PointerRouter _router;
public readonly Dictionary<int, _MouseState> _mouseStates = new Dictionary<int, _MouseState>();
public bool mouseIsConnected {
get { return _lastMouseEvent.isNotEmpty(); }
}
if (state == null)
if (state == null) {
}
PointerEvent lastEvent = state.latestEvent;
var lastEvent = state.latestEvent;
D.assert((value is PointerAddedEvent) == (lastEvent is PointerRemovedEvent));
if (value is PointerSignalEvent)
D.assert(value is PointerAddedEvent == lastEvent is PointerRemovedEvent);
if (value is PointerSignalEvent) {
}
public readonly Dictionary<MouseTrackerAnnotation, _TrackedAnnotation> _trackedAnnotations =
new Dictionary<MouseTrackerAnnotation, _TrackedAnnotation>();
if (Event.kind != PointerDeviceKind.mouse)
if (Event.kind != PointerDeviceKind.mouse) {
if (Event is PointerSignalEvent)
}
if (Event is PointerSignalEvent) {
int device = Event.device;
_MouseState existingState = _mouseStates.getOrDefault(device);
if (!_shouldMarkStateDirty(existingState, Event))
}
var device = Event.device;
var existingState = _mouseStates.getOrDefault(key: device);
if (!_shouldMarkStateDirty(state: existingState, value: Event)) {
PointerEvent previousEvent = existingState?.latestEvent;
}
var previousEvent = existingState?.latestEvent;
handleUpdatedDevice: (_MouseState mouseState, HashSet<MouseTrackerAnnotation> previousAnnotations) =>{
D.assert(mouseState.device == Event.device);
_dispatchDeviceCallbacks(
(mouseState, previousAnnotations) => {
D.assert(mouseState.device == Event.device);
_dispatchDeviceCallbacks(
lastAnnotations: previousAnnotations,
nextAnnotations: mouseState.annotations,
previousEvent: previousEvent,

);
}
public HashSet<MouseTrackerAnnotation> _findAnnotations(_MouseState state) {
var globalPosition = state.latestEvent.position;
var device = state.device;
var result = new HashSet<MouseTrackerAnnotation>();
foreach (var values in annotationFinder(offset: globalPosition)) {
result.Add(item: values);
}
return _mouseStates.ContainsKey(key: device)
? result
: new HashSet<MouseTrackerAnnotation>();
}
public void _updateAllDevices() {
_updateDevices(
handleUpdatedDevice: (mouseState, previousAnnotations) => {
_dispatchDeviceCallbacks(
lastAnnotations: previousAnnotations,
nextAnnotations: mouseState.annotations,
previousEvent: mouseState.latestEvent
);
}
);
}
void _updateDevices(
PointerEvent targetEvent = null,
_UpdatedDeviceHandler handleUpdatedDevice = null) {
D.assert(handleUpdatedDevice != null);
D.assert(result: !_duringBuildPhase);
D.assert(result: !_duringDeviceUpdate);
var mouseWasConnected = mouseIsConnected;
_MouseState targetState = null;
if (targetEvent != null) {
targetState = _mouseStates.getOrDefault(key: targetEvent.device);
if (targetState == null) {
targetState = new _MouseState(initialEvent: targetEvent);
_mouseStates[key: targetState.device] = targetState;
}
else {
D.assert(!(targetEvent is PointerAddedEvent));
targetState.latestEvent = targetEvent;
if (targetEvent is PointerRemovedEvent) {
_mouseStates.Remove(key: targetEvent.device);
}
}
}
D.assert(targetState == null == (targetEvent == null));
D.assert(() => {
_duringDeviceUpdate = true;
return true;
});
var dirtyStates = targetEvent == null
? (IEnumerable<_MouseState>) _mouseStates.Values
: new List<_MouseState> {targetState};
foreach (var dirtyState in dirtyStates) {
var nextAnnotations = _findAnnotations(state: dirtyState);
var lastAnnotations = dirtyState.replaceAnnotations(value: nextAnnotations);
handleUpdatedDevice(mouseState: dirtyState, previousAnnotations: lastAnnotations);
}
D.assert(() => {
_duringDeviceUpdate = false;
return true;
});
if (mouseWasConnected != mouseIsConnected) {
notifyListeners();
}
}
) {
) {
PointerEvent latestEvent = unhandledEvent ?? previousEvent;
var latestEvent = unhandledEvent ?? previousEvent;
var exiting = new List<MouseTrackerAnnotation>();
if (!nextAnnotations.Contains(lastAnnotation)) {
exitingAnnotations.Append(lastAnnotation);
if (!nextAnnotations.Contains(item: lastAnnotation)) {
exiting.Add(item: lastAnnotation);
foreach ( MouseTrackerAnnotation annotation in exitingAnnotations) {
exitingAnnotations = exiting;
foreach (var annotation in exitingAnnotations) {
annotation.onExit(PointerExitEvent.fromMouseEvent(latestEvent));
annotation.onExit(PointerExitEvent.fromMouseEvent(hover: latestEvent));
List<MouseTrackerAnnotation> entering = new List<MouseTrackerAnnotation>();
var entering = new List<MouseTrackerAnnotation>();
if (!lastAnnotations.Contains(nextAnnotation)) {
entering.Add(nextAnnotation);
if (!lastAnnotations.Contains(item: nextAnnotation)) {
entering.Add(item: nextAnnotation);
}
}
foreach ( MouseTrackerAnnotation annotation in enteringAnnotations) {
foreach (var annotation in enteringAnnotations) {
annotation.onEnter(PointerEnterEvent.fromMouseEvent(latestEvent));
annotation.onEnter(PointerEnterEvent.fromMouseEvent(hover: latestEvent));
if (unhandledEvent is PointerHoverEvent) {
Offset lastHoverPosition = previousEvent is PointerHoverEvent ? previousEvent.position : null;
bool pointerHasMoved = lastHoverPosition == null || lastHoverPosition != unhandledEvent.position;
nextAnnotations.ToList().Reverse();
IEnumerable<MouseTrackerAnnotation> hoveringAnnotations = pointerHasMoved ? nextAnnotations : enteringAnnotations;
foreach ( MouseTrackerAnnotation annotation in hoveringAnnotations) {
if (annotation.onHover != null) {
annotation.onHover((PointerHoverEvent)unhandledEvent);
}
}
}
}
public HashSet<MouseTrackerAnnotation> _findAnnotations(_MouseState state) {
Offset globalPosition = state.latestEvent.position;
int device = state.device;
HashSet<MouseTrackerAnnotation> result = new HashSet<MouseTrackerAnnotation>();
foreach (var values in annotationFinder(globalPosition)) {
result.Add(values);
if (unhandledEvent is PointerHoverEvent) {
var lastHoverPosition = previousEvent is PointerHoverEvent ? previousEvent.position : null;
var pointerHasMoved = lastHoverPosition == null || lastHoverPosition != unhandledEvent.position;
nextAnnotations.ToList().Reverse();
var hoveringAnnotations = pointerHasMoved ? nextAnnotations : enteringAnnotations;
foreach (var annotation in hoveringAnnotations) {
if (annotation.onHover != null) {
annotation.onHover((PointerHoverEvent) unhandledEvent);
}
}
return (_mouseStates.ContainsKey(device))
? result
: new HashSet<MouseTrackerAnnotation>{} as HashSet<MouseTrackerAnnotation>;
public static bool _duringBuildPhase {
get {
return SchedulerBinding.instance.schedulerPhase == SchedulerPhase.persistentCallbacks;
}
}
public void _updateAllDevices() {
_updateDevices(
handleUpdatedDevice: (_MouseState mouseState, HashSet<MouseTrackerAnnotation> previousAnnotations)=> {
_dispatchDeviceCallbacks(
lastAnnotations: previousAnnotations,
nextAnnotations: mouseState.annotations,
previousEvent: mouseState.latestEvent,
unhandledEvent: null
);
}
);
}
bool _duringDeviceUpdate = false;
void _updateDevices(
PointerEvent targetEvent = null,
_UpdatedDeviceHandler handleUpdatedDevice = null) {
D.assert(handleUpdatedDevice != null);
D.assert(!_duringBuildPhase);
D.assert(!_duringDeviceUpdate);
bool mouseWasConnected = mouseIsConnected;
_MouseState targetState = null;
if (targetEvent != null) {
targetState = _mouseStates.getOrDefault(targetEvent.device);
if (targetState == null) {
targetState = new _MouseState(initialEvent: targetEvent);
_mouseStates[targetState.device] = targetState;
} else {
D.assert(!(targetEvent is PointerAddedEvent));
targetState.latestEvent = targetEvent;
if (targetEvent is PointerRemovedEvent)
_mouseStates.Remove(targetEvent.device);
}
public void schedulePostFrameCheck() {
D.assert(result: _duringBuildPhase);
D.assert(result: !_duringDeviceUpdate);
if (!mouseIsConnected) {
return;
D.assert((targetState == null) == (targetEvent == null));
D.assert(()=> {
_duringDeviceUpdate = true;
return true;
});
IEnumerable<_MouseState> dirtyStates = targetEvent == null ? (IEnumerable<_MouseState>) _mouseStates.Values : new List<_MouseState>{targetState};
foreach ( _MouseState dirtyState in dirtyStates) {
HashSet<MouseTrackerAnnotation> nextAnnotations = _findAnnotations(dirtyState);
HashSet<MouseTrackerAnnotation> lastAnnotations = dirtyState.replaceAnnotations(nextAnnotations);
handleUpdatedDevice(dirtyState, lastAnnotations);
}
D.assert(() =>{
_duringDeviceUpdate = false;
return true;
});
if (mouseWasConnected != mouseIsConnected)
notifyListeners();
}
public bool _hasScheduledPostFrameCheck = false;
public void schedulePostFrameCheck() {
D.assert(_duringBuildPhase);
D.assert(!_duringDeviceUpdate);
if (!mouseIsConnected)
return;
_hasScheduledPostFrameCheck = true;
SchedulerBinding.instance.addPostFrameCallback((stamp => {
D.assert(_hasScheduledPostFrameCheck);
_hasScheduledPostFrameCheck = false;
_updateAllDevices();
}));
_hasScheduledPostFrameCheck = true;
SchedulerBinding.instance.addPostFrameCallback(stamp => {
D.assert(result: _hasScheduledPostFrameCheck);
_hasScheduledPostFrameCheck = false;
_updateAllDevices();
});
}
}
}

8
com.unity.uiwidgets/Runtime/rendering/paragraph.cs


void _computeChildrenWidthWithMaxIntrinsics(float height) {
RenderBox child = firstChild;
List<PlaceholderDimensions> placeholderDimensions = new List<PlaceholderDimensions>(childCount);
List<PlaceholderDimensions> placeholderDimensions = new List<PlaceholderDimensions>(new PlaceholderDimensions[childCount]);
int childIndex = 0;
while (child != null) {
placeholderDimensions[childIndex] = new PlaceholderDimensions(

void _computeChildrenWidthWithMinIntrinsics(float height) {
RenderBox child = firstChild;
List<PlaceholderDimensions> placeholderDimensions = new List<PlaceholderDimensions>(childCount);
List<PlaceholderDimensions> placeholderDimensions = new List<PlaceholderDimensions>(new PlaceholderDimensions[childCount]);
int childIndex = 0;
while (child != null) {
float intrinsicWidth = child.getMinIntrinsicWidth(height);

void _computeChildrenHeightWithMinIntrinsics(float width) {
RenderBox child = firstChild;
List<PlaceholderDimensions> placeholderDimensions = new List<PlaceholderDimensions>(childCount);
List<PlaceholderDimensions> placeholderDimensions = new List<PlaceholderDimensions>(new PlaceholderDimensions[childCount]);
int childIndex = 0;
while (child != null) {
float intrinsicHeight = child.getMinIntrinsicHeight(width);

return;
}
RenderBox child = firstChild;
_placeholderDimensions = new List<PlaceholderDimensions>(childCount);
_placeholderDimensions = new List<PlaceholderDimensions>(new PlaceholderDimensions[childCount]);
int childIndex = 0;
while (child != null) {
child.layout(

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


}
public override Alignment lerp(float t) {
return Alignment.lerp(begin, end, t);
return Alignment.lerpAlignment(begin, end, t);
}
}
public class AlignmentGeometryTween : Tween<AlignmentGeometry> {

1
com.unity.uiwidgets/Runtime/scheduler/binding.cs


using System.Text;
using developer;
using Unity.UIWidgets.async;
using Unity.UIWidgets.async;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;

7
com.unity.uiwidgets/Runtime/services/keyboard.cs


TextEditingValue _value;
TextInputConfiguration _textInputConfiguration;
public void show() {
}

public void setClient(int client, TextInputConfiguration configuration) {
_client = client;
_textInputConfiguration = configuration;
_textInputConfiguration = null;
}
public bool imeRequired() {

}
if (ch == '\n') {
Timer.create(TimeSpan.Zero, () => { TextInput._performAction(_client, TextInputAction.newline); });
Timer.create(TimeSpan.Zero, () => { TextInput._performAction(_client,
_textInputConfiguration?.inputAction ?? TextInputAction.newline); });
}
if (_validateCharacter(ch)) {

67
com.unity.uiwidgets/Runtime/services/keyboard_key.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using UnityEngine;
namespace Unity.UIWidgets.services {
public abstract class KeyboardKey : Diagnosticable {

public override int GetHashCode() {
unchecked {
int hashCode = (int) keyId;
hashCode = (hashCode * 397) ^ (debugName != null ? debugName.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (keyLabel != null ? keyLabel.GetHashCode() : 0);
protected LogicalKeyboardKey(long keyId, string debugName = null, string keyLabel = null) : base() {
public LogicalKeyboardKey(long keyId, string debugName = null, string keyLabel = null) : base() {
D.assert(keyId != null);
this.keyId = keyId;
this.debugName = debugName;

debugName: foundation_.kReleaseMode ? null : "Usb Error Undefined");
public static readonly LogicalKeyboardKey keyA = new LogicalKeyboardKey(0x00000000061, keyLabel: "a",
public static readonly LogicalKeyboardKey keyA = new LogicalKeyboardKey((long)KeyCode.A, keyLabel: "a",
public static readonly LogicalKeyboardKey keyB = new LogicalKeyboardKey(0x00000000062, keyLabel: "b",
public static readonly LogicalKeyboardKey keyB = new LogicalKeyboardKey((long)KeyCode.B, keyLabel: "b",
public static readonly LogicalKeyboardKey keyC = new LogicalKeyboardKey(0x00000000063, keyLabel: "c",
public static readonly LogicalKeyboardKey keyC = new LogicalKeyboardKey((long)KeyCode.C, keyLabel: "c",
public static readonly LogicalKeyboardKey keyD = new LogicalKeyboardKey(0x00000000064, keyLabel: "d",
public static readonly LogicalKeyboardKey keyD = new LogicalKeyboardKey((long)KeyCode.D, keyLabel: "d",
public static readonly LogicalKeyboardKey keyE = new LogicalKeyboardKey(0x00000000065, keyLabel: "e",
public static readonly LogicalKeyboardKey keyE = new LogicalKeyboardKey((long)KeyCode.E, keyLabel: "e",
public static readonly LogicalKeyboardKey keyF = new LogicalKeyboardKey(0x00000000066, keyLabel: "f",
public static readonly LogicalKeyboardKey keyF = new LogicalKeyboardKey((long)KeyCode.F, keyLabel: "f",
public static readonly LogicalKeyboardKey keyG = new LogicalKeyboardKey(0x00000000067, keyLabel: "g",
public static readonly LogicalKeyboardKey keyG = new LogicalKeyboardKey((long)KeyCode.G, keyLabel: "g",
public static readonly LogicalKeyboardKey keyH = new LogicalKeyboardKey(0x00000000068, keyLabel: "h",
public static readonly LogicalKeyboardKey keyH = new LogicalKeyboardKey((long)KeyCode.H, keyLabel: "h",
public static readonly LogicalKeyboardKey keyI = new LogicalKeyboardKey(0x00000000069, keyLabel: "i",
public static readonly LogicalKeyboardKey keyI = new LogicalKeyboardKey((long)KeyCode.I, keyLabel: "i",
public static readonly LogicalKeyboardKey keyJ = new LogicalKeyboardKey(0x0000000006a, keyLabel: "j",
public static readonly LogicalKeyboardKey keyJ = new LogicalKeyboardKey((long)KeyCode.J, keyLabel: "j",
public static readonly LogicalKeyboardKey keyK = new LogicalKeyboardKey(0x0000000006b, keyLabel: "k",
public static readonly LogicalKeyboardKey keyK = new LogicalKeyboardKey((long)KeyCode.K, keyLabel: "k",
public static readonly LogicalKeyboardKey keyL = new LogicalKeyboardKey(0x0000000006c, keyLabel: "l",
public static readonly LogicalKeyboardKey keyL = new LogicalKeyboardKey((long)KeyCode.L, keyLabel: "l",
public static readonly LogicalKeyboardKey keyM = new LogicalKeyboardKey(0x0000000006d, keyLabel: "m",
public static readonly LogicalKeyboardKey keyM = new LogicalKeyboardKey((long)KeyCode.M, keyLabel: "m",
public static readonly LogicalKeyboardKey keyN = new LogicalKeyboardKey(0x0000000006e, keyLabel: "n",
public static readonly LogicalKeyboardKey keyN = new LogicalKeyboardKey((long)KeyCode.N, keyLabel: "n",
public static readonly LogicalKeyboardKey keyO = new LogicalKeyboardKey(0x0000000006f, keyLabel: "o",
public static readonly LogicalKeyboardKey keyO = new LogicalKeyboardKey((long)KeyCode.O, keyLabel: "o",
public static readonly LogicalKeyboardKey keyP = new LogicalKeyboardKey(0x00000000070, keyLabel: "p",
public static readonly LogicalKeyboardKey keyP = new LogicalKeyboardKey((long)KeyCode.P, keyLabel: "p",
public static readonly LogicalKeyboardKey keyQ = new LogicalKeyboardKey(0x00000000071, keyLabel: "q",
public static readonly LogicalKeyboardKey keyQ = new LogicalKeyboardKey((long)KeyCode.Q, keyLabel: "q",
public static readonly LogicalKeyboardKey keyR = new LogicalKeyboardKey(0x00000000072, keyLabel: "",
public static readonly LogicalKeyboardKey keyR = new LogicalKeyboardKey((long)KeyCode.R, keyLabel: "",
public static readonly LogicalKeyboardKey keyS = new LogicalKeyboardKey(0x00000000073, keyLabel: "s",
public static readonly LogicalKeyboardKey keyS = new LogicalKeyboardKey((long)KeyCode.S, keyLabel: "s",
public static readonly LogicalKeyboardKey keyT = new LogicalKeyboardKey(0x00000000074, keyLabel: "t",
public static readonly LogicalKeyboardKey keyT = new LogicalKeyboardKey((long)KeyCode.T, keyLabel: "t",
public static readonly LogicalKeyboardKey keyU = new LogicalKeyboardKey(0x00000000075, keyLabel: "u",
public static readonly LogicalKeyboardKey keyU = new LogicalKeyboardKey((long)KeyCode.U, keyLabel: "u",
public static readonly LogicalKeyboardKey keyV = new LogicalKeyboardKey(0x00000000076, keyLabel: "v",
public static readonly LogicalKeyboardKey keyV = new LogicalKeyboardKey((long)KeyCode.V, keyLabel: "v",
public static readonly LogicalKeyboardKey keyW = new LogicalKeyboardKey(0x00000000077, keyLabel: "w",
public static readonly LogicalKeyboardKey keyW = new LogicalKeyboardKey((long)KeyCode.W, keyLabel: "w",
public static readonly LogicalKeyboardKey keyX = new LogicalKeyboardKey(0x00000000078, keyLabel: "x",
public static readonly LogicalKeyboardKey keyX = new LogicalKeyboardKey((long)KeyCode.X, keyLabel: "x",
public static readonly LogicalKeyboardKey keyY = new LogicalKeyboardKey(0x00000000079, keyLabel: "y",
public static readonly LogicalKeyboardKey keyY = new LogicalKeyboardKey((long)KeyCode.Y, keyLabel: "y",
public static readonly LogicalKeyboardKey keyZ = new LogicalKeyboardKey(0x0000000007a, keyLabel: "z",
public static readonly LogicalKeyboardKey keyZ = new LogicalKeyboardKey((long)KeyCode.Z, keyLabel: "z",
debugName: foundation_.kReleaseMode ? null : "Key Z");

public static readonly LogicalKeyboardKey enter =
new LogicalKeyboardKey(0x00100070028, debugName: foundation_.kReleaseMode ? null : "Ente");
new LogicalKeyboardKey((long)KeyCode.Return, debugName: foundation_.kReleaseMode ? null : "Ente");
new LogicalKeyboardKey(0x00100070029, debugName: foundation_.kReleaseMode ? null : "Escape");
new LogicalKeyboardKey((long)KeyCode.Escape, debugName: foundation_.kReleaseMode ? null : "Escape");
new LogicalKeyboardKey(0x0010007002a, debugName: foundation_.kReleaseMode ? null : "Backspace");
new LogicalKeyboardKey((long)KeyCode.Backspace, debugName: foundation_.kReleaseMode ? null : "Backspace");
new LogicalKeyboardKey(0x0010007002b, debugName: foundation_.kReleaseMode ? null : "Tab");
new LogicalKeyboardKey((long)KeyCode.Tab, debugName: foundation_.kReleaseMode ? null : "Tab");
public static readonly LogicalKeyboardKey space = new LogicalKeyboardKey(0x00000000020, keyLabel: " ",
public static readonly LogicalKeyboardKey space = new LogicalKeyboardKey((long)KeyCode.Space, keyLabel: " ",
debugName: foundation_.kReleaseMode ? null : "Space");

3
com.unity.uiwidgets/Runtime/ui/hooks.cs


}
}
const int _kPointerDataFieldCount = 28;
const int _kPointerDataFieldCount = 29;
static unsafe PointerDataPacket _unpackPointerDataPacket(byte* packet, int packetLength) {
const int kStride = 8;

physicalDeltaX: (float) *(double*) (packet + kStride * offset++),
physicalDeltaY: (float) *(double*) (packet + kStride * offset++),
buttons: (int) *(long*) (packet + kStride * offset++),
modifier: (int) *(long*) (packet + kStride * offset++),
obscured: *(long*) (packet + kStride * offset++) != 0,
synthesized: *(long*) (packet + kStride * offset++) != 0,
pressure: (float) *(double*) (packet + kStride * offset++),

18
com.unity.uiwidgets/Runtime/ui/painting.cs


static extern void Path_reset(IntPtr ptr);
[DllImport(NativeBindings.dllName)]
[return: MarshalAs(UnmanagedType.U1)]
static extern bool Path_contains(IntPtr ptr, float x, float y);
[DllImport(NativeBindings.dllName)]

static extern unsafe void Path_getBounds(IntPtr ptr, float* rect);
[DllImport(NativeBindings.dllName)]
[return: MarshalAs(UnmanagedType.U1)]
static extern bool Path_op(IntPtr ptr, IntPtr path1, IntPtr path2, int operation);
}

[DllImport(NativeBindings.dllName)]
[return: MarshalAs(UnmanagedType.U1)]
[return: MarshalAs(UnmanagedType.U1)]
static extern bool PathMeasure_nativeNextContour();
}

public static extern void Vertices_dispose(IntPtr ptr);
[DllImport(NativeBindings.dllName)]
[return: MarshalAs(UnmanagedType.U1)]
public static extern unsafe bool Vertices_init(IntPtr ptr,
int mode,
float* positions,

}
}
public int approximateBytesUsed => Picture_GetAllocationSize(_ptr);
public ulong approximateBytesUsed => Picture_GetAllocationSize(_ptr);
static extern int Picture_GetAllocationSize(IntPtr ptr);
[return: MarshalAs(UnmanagedType.SysUInt)]
static extern ulong Picture_GetAllocationSize(IntPtr ptr);
delegate void Picture_toImageCallback(IntPtr callbackHandle, IntPtr result);

static extern void PictureRecorder_dispose(IntPtr ptr);
[DllImport(NativeBindings.dllName)]
[return: MarshalAs(UnmanagedType.U1)]
static extern bool PictureRecorder_isRecording(IntPtr ptr);
[DllImport(NativeBindings.dllName)]

public class Skottie : NativeWrapper {
public Skottie(string path) {
_setPtr(Skottie_Construct(path));
var Id = Skottie_Construct(path);
if(Id == IntPtr.Zero){
Debug.Log($"cannot load lottie from {path}, please check file exist and valid");
}else {
_setPtr(Id);
}
}
public override void DisposePtr(IntPtr ptr) {

11
com.unity.uiwidgets/Runtime/ui/pointer.cs


unknown,
}
public enum FunctionKey {
none = 0,
shift = 1,
alt = 2,
command = 3,
control = 4,
}
public readonly struct PointerData {
public PointerData(
TimeSpan? timeStamp = null,

float physicalDeltaX = 0.0f,
float physicalDeltaY = 0.0f,
int buttons = 0,
int modifier = 0,
bool obscured = false,
bool synthesized = false,
float pressure = 0.0f,

this.physicalDeltaX = physicalDeltaX;
this.physicalDeltaY = physicalDeltaY;
this.buttons = buttons;
this.modifier = modifier;
this.obscured = obscured;
this.synthesized = synthesized;
this.pressure = pressure;

public readonly float physicalDeltaX;
public readonly float physicalDeltaY;
public readonly int buttons;
public readonly int modifier;
public readonly bool obscured;
public readonly bool synthesized;
public readonly float pressure;

20
com.unity.uiwidgets/Runtime/ui/text.cs


}
}
[StructLayout(LayoutKind.Sequential)]
public struct Float32List {
public IntPtr data;
public int length;

internal static unsafe void setFloat(this byte[] bytes, int byteOffset, float value) {
D.assert(byteOffset >= 0 && byteOffset + 4 < bytes.Length);
var intVal = *(int*) &value;
#if UNITY_ANDROID
byte[] vOut = BitConverter.GetBytes(value);
for (int i = 0; i < vOut.Length; i++) {
bytes[byteOffset + i] = vOut[i];
}
#else
*(int*) b = intVal;
*(float*) b = value;
#endif
}
internal static byte[] _encodeStrut(

static extern float Paragraph_ideographicBaseline(IntPtr ptr);
[DllImport(dllName: NativeBindings.dllName)]
[return: MarshalAs(UnmanagedType.U1)]
static extern bool Paragraph_didExceedMaxLines(IntPtr ptr);
[DllImport(dllName: NativeBindings.dllName)]

}
public void addPlaceholder(float width, float height, PlaceholderAlignment alignment,
TextBaseline baseline,
TextBaseline? baseline,
D.assert(alignment == PlaceholderAlignment.aboveBaseline ||
D.assert((alignment == PlaceholderAlignment.aboveBaseline ||
alignment == PlaceholderAlignment.baseline);
alignment == PlaceholderAlignment.baseline) ? baseline != null : true);
(int) baseline);
(int) (baseline ?? TextBaseline.alphabetic));
placeholderCount++;
placeholderScales.Add(item: scale);
}

7
com.unity.uiwidgets/Runtime/ui/window.cs


return null;
}
List<string> _computePlatformResolvedLocale(List<string> supportedLocalesData) =>
// Window_computePlatformResolvedLocale not implement yet, TODO _computePlatformResolvedLocale
List<string> _computePlatformResolvedLocale(List<string> supportedLocalesData) {
return new List<string>();
}
/// A callback that is invoked whenever [locale] changes value.
///

static extern void Window_render(IntPtr ptr, IntPtr scene);
[DllImport(NativeBindings.dllName)]
static extern List<string> Window_computePlatformResolvedLocale(List<string> supportedLocalesData);
static extern void Window_computePlatformResolvedLocale(List<string> supportedLocalesData);
[MonoPInvokeCallback(typeof(Window_sendPlatformMessageCallback))]
static unsafe void _sendPlatformMessageCallback(IntPtr callbackHandle, byte* data, int dataLength) {

116
com.unity.uiwidgets/Runtime/widgets/LottiePainter.cs


using System;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async;
using Unity.UIWidgets.rendering;
using Canvas = Unity.UIWidgets.ui.Canvas;
public int _round = 0;
public float _duration = 0;
public Size _size = null;
public Lottie(string path, float frame) {
public Lottie(string path, float frame = 0, Size size = null, int round = -1) {
_frame = frame;
_duration = _skottie.duration();
_round = round;
_frame = frame * _duration;
_size = size;
return new LottieState();
return new LottieState(_frame, _round);
public override Widget build(BuildContext context) {
return new LottieRenderObjectWidget(widget._skottie, widget._frame);
}
}
public class LottieRenderObjectWidget : LeafRenderObjectWidget {
Skottie _anime;
float _frame;
float _duration;
public override void updateRenderObject(BuildContext context, RenderObject renderObject) {
base.updateRenderObject(context, renderObject);
var a = (RenderLottie) renderObject;
a.frame = _frame*_duration;
}
float _frame = 0;
int _round = 0;
public LottieRenderObjectWidget(Skottie anime, float frame) {
_anime = anime;
public LottieState(float frame, int round) {
_duration = anime.duration();
_round = round;
public override RenderObject createRenderObject(BuildContext context) {
return new RenderLottie(_anime, 100, 100, frame: _frame);
public override Widget build(BuildContext context) {
if (_round != 0) {
WidgetsBinding.instance.addPostFrameCallback((_) => {
if (!mounted) {
return;
}
setState(() => {
_frame += Time.deltaTime;
if (_frame > widget._duration) {
_frame -= widget._duration;
if (_round > 0) {
_round--;
}
}
});
});
}
return new CustomPaint(
size: widget._size,
painter: new LottiePainter(
skottie: widget._skottie,
frame: _frame
)
);
public class AnimatedLottie : ImplicitlyAnimatedWidget {
public class LottiePainter : AbstractCustomPainter {
public float _frame = 0;
float _frame = 0;
public AnimatedLottie(
string path,
Key key = null,
Curve curve = null,
TimeSpan? duration = null,
float frame = 0
) :base(key: key, curve: curve, duration: duration){
_skottie = new Skottie(Path.Combine(Application.streamingAssetsPath, path));
_frame = frame;
}
AnimatedLottie(
Skottie skottie,
Key key = null,
Curve curve = null,
TimeSpan? duration = null,
float frame = 0
) :base(key: key, curve: curve, duration: duration){
public LottiePainter(Skottie skottie, float frame) {
public static AnimatedLottie file(string path, Key key = null, Curve curve = null, TimeSpan? duration = null,
float frame = 0) {
var skottie = new Skottie(Path.Combine(Application.streamingAssetsPath, path));
duration = duration ?? TimeSpan.FromSeconds(skottie.duration());
return new AnimatedLottie(skottie, key, curve, duration, frame);
public override void paint(Canvas canvas, Size size) {
_skottie.paint(canvas, Offset.zero, size.width, size.height, _frame);
public override State createState() {
return new _AnimatedLottieState();
}
}
class _AnimatedLottieState : AnimatedWidgetBaseState<AnimatedLottie> {
FloatTween frame;
protected override void forEachTween(TweenVisitor visitor) {
frame = (FloatTween) visitor.visit(this, frame, widget._frame,
(value) => new FloatTween(begin: value, value));
}
public override Widget build(BuildContext context) {
return new LottieRenderObjectWidget(widget._skottie, frame.lerp(animation.value));
public override bool shouldRepaint(CustomPainter oldDelegate) {
if (oldDelegate is LottiePainter oldLottiePainter) {
return _frame != oldLottiePainter._frame;
}
return true;
}
}
}

12
com.unity.uiwidgets/Runtime/widgets/actions.cs


class CallbackAction : UiWidgetAction {
public CallbackAction(LocalKey intentKey, OnInvokeCallback onInvoke) : base(intentKey: intentKey) {
public class CallbackAction : UiWidgetAction {
public CallbackAction(LocalKey intentKey = null, OnInvokeCallback onInvoke = null) : base(intentKey: intentKey) {
D.assert(onInvoke != null);
this.onInvoke = onInvoke;
}

}
class ActionDispatcher : Diagnosticable {
public class ActionDispatcher : Diagnosticable {
public ActionDispatcher() {
}

}
}
class Actions : InheritedWidget {
public class Actions : InheritedWidget {
public Actions(
Key key = null,
ActionDispatcher dispatcher = null,

}
actionsElement = element;
Actions actions = element.widget as Actions;
action = actions.actions[intent.key]?.Invoke();
action = actions.actions.getOrDefault(intent.key)?.Invoke();
return action == null;
}

}
class FocusableActionDetector : StatefulWidget {
public class FocusableActionDetector : StatefulWidget {
public FocusableActionDetector(
Key key = null,

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


}
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(child == _child);
_child = null;
base.forgetChild(child);

22
com.unity.uiwidgets/Runtime/widgets/framework.cs


get { return _debugStateLockLevel > 0; }
}
internal bool debugBuilding {
public bool debugBuilding {
get { return _debugBuilding; }
}
bool _debugBuilding = false;

HashSet<Element> _debugForgottenChildrenWithGlobalKey = new HashSet<Element>();
internal virtual void forgetChild(Element child) {
public virtual void forgetChild(Element child) {
D.assert(() => {
if (child.widget.key is GlobalKey)
_debugForgottenChildrenWithGlobalKey.Add(child);

}
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(child == _child);
_child = null;
base.forgetChild(child);

notifyClients(oldWidget);
}
protected abstract void notifyClients(ProxyWidget oldWidget);
public abstract void notifyClients(ProxyWidget oldWidget);
}
public class ParentDataElement : ProxyElement {

_applyParentData(newWidget);
}
protected override void notifyClients(ProxyWidget oldWidget) {
public override void notifyClients(ProxyWidget oldWidget) {
_applyParentData((ParentDataWidget) widget);
}
}

_applyParentData(newWidget);
}
protected override void notifyClients(ProxyWidget oldWidget) {
public override void notifyClients(ProxyWidget oldWidget) {
_applyParentData((ParentDataWidget<T>) widget);
}

}
}
protected override void notifyClients(ProxyWidget oldWidgetRaw) {
public override void notifyClients(ProxyWidget oldWidgetRaw) {
var oldWidget = (InheritedWidget) oldWidgetRaw;
D.assert(_debugCheckOwnerBuildTargetExists("notifyClients"));

protected RenderObjectElement(RenderObjectWidget widget) : base(widget) {
}
public new RenderObjectWidget widget {
public new virtual RenderObjectWidget widget {
get { return (RenderObjectWidget) base.widget; }
}

public LeafRenderObjectElement(LeafRenderObjectWidget widget) : base(widget) {
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(false);
base.forgetChild(child);
}

}
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(child == _child);
_child = null;
base.forgetChild(child);

}
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(_children.Contains(child));
D.assert(!_forgottenChildren.Contains(child));
_forgottenChildren.Add(child);

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


markNeedsBuild();
}
protected override void notifyClients(ProxyWidget oldWidget) {
public override void notifyClients(ProxyWidget oldWidget) {
oldWidget = (InheritedNotifier<T>) oldWidget;
base.notifyClients(oldWidget);
_dirty = false;

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


visitor(_child);
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(child == _child);
_child = null;
base.forgetChild(child);

396
com.unity.uiwidgets/Runtime/widgets/list_wheel_scroll_view.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using JetBrains.Annotations;
using Unity.UIWidgets.external;
using Unity.UIWidgets.external;
using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.ui;
using UnityEngine;

Widget build(BuildContext context, int index);
Widget build(BuildContext context, int index);
public readonly List<Widget> children;
public ListWheelChildListDelegate(
List<Widget> children
) {

public readonly List<Widget> children;
public int? estimatedChildCount {
get { return children.Count; }

return null;
}
return new IndexedSemantics(child: children[index], index: index);
return new IndexedSemantics(child: children[index: index], index: index);
}
public int trueIndexOf(int index) {

}
public class ListWheelChildLoopingListDelegate : ListWheelChildDelegate {
public readonly List<Widget> children;
public ListWheelChildLoopingListDelegate(
List<Widget> children
) {

public readonly List<Widget> children;
public int? estimatedChildCount {
get { return null; }

return index % children.Count;
var result = index % children.Count;
if (index < 0) {result = result + children.Count; }
return result;
}
public Widget build(BuildContext context, int index) {

return new IndexedSemantics(child: children[Mathf.Abs(index % children.Count)]);
}

}
public class ListWheelChildBuilderDelegate : ListWheelChildDelegate {
public readonly IndexedWidgetBuilder builder;
public readonly int? childCount;
public ListWheelChildBuilderDelegate(
IndexedWidgetBuilder builder,
int? childCount = null

this.childCount = childCount;
}
public readonly IndexedWidgetBuilder builder;
public readonly int? childCount;
public int? estimatedChildCount {
get { return childCount; }
}

Widget child = builder(context, index);
var child = builder(context: context, index: index);
return child == null ? null : new IndexedSemantics(child: child);
}

return new IndexedSemantics(child: builder(context, index));
return new IndexedSemantics(child: builder(context: context, index: index));
}
public int trueIndexOf(int index) {

class ListWheelScrollViewUtils {
public static int _getItemFromOffset(
float offset ,
float itemExtent ,
float minScrollExtent ,
float maxScrollExtent
float offset,
float itemExtent,
float minScrollExtent,
float maxScrollExtent
return (_clipOffsetToScrollableRange(offset, minScrollExtent, maxScrollExtent) / itemExtent).round();
return (_clipOffsetToScrollableRange(offset: offset, minScrollExtent: minScrollExtent,
maxScrollExtent: maxScrollExtent) / itemExtent).round();
return Mathf.Min(Mathf.Max(offset, minScrollExtent), maxScrollExtent);
return Mathf.Min(Mathf.Max(a: offset, b: minScrollExtent), b: maxScrollExtent);
public readonly int initialItem;
public FixedExtentScrollController(
int initialItem = 0
) {

public readonly int initialItem;
public int selectedItem {
get {
D.assert(positions.isNotEmpty(),

() =>
"The selectedItem property cannot be read when multiple scroll views are attached to the same FixedExtentScrollController."
);
_FixedExtentScrollPosition position = (_FixedExtentScrollPosition) this.position;
var position = (_FixedExtentScrollPosition) this.position;
return position.itemIndex;
}
}

if (!hasClients) {
return null;
}
List<Future> futures = new List<Future>();
foreach (_FixedExtentScrollPosition position in positions.Cast<_FixedExtentScrollPosition>()) {
var futures = new List<Future>();
foreach (var position in positions.Cast<_FixedExtentScrollPosition>()) {
futures.Add(position.animateTo(
itemIndex * position.itemExtent,
duration: duration,

return Future.wait<object>(futures);
return Future.wait<object>(futures: futures);
foreach (_FixedExtentScrollPosition position in positions.Cast<_FixedExtentScrollPosition>()) {
foreach (var position in positions.Cast<_FixedExtentScrollPosition>()) {
ScrollPhysics physics,
ScrollPhysics physics,
ScrollContext context,
ScrollPosition oldPosition) {
return new _FixedExtentScrollPosition(

public class FixedExtentMetrics : FixedScrollMetrics, IFixedExtentMetrics {
public FixedExtentMetrics(
float minScrollExtent ,
float minScrollExtent,
float pixels ,
float viewportDimension ,
AxisDirection axisDirection ,
int itemIndex
float pixels,
float viewportDimension,
AxisDirection axisDirection,
int itemIndex
minScrollExtent: minScrollExtent ,
maxScrollExtent: maxScrollExtent ,
pixels: pixels ,
viewportDimension: viewportDimension ,
minScrollExtent: minScrollExtent,
maxScrollExtent: maxScrollExtent,
pixels: pixels,
viewportDimension: viewportDimension,
axisDirection: axisDirection
) {
this.itemIndex = itemIndex;

int? itemIndex = null
) {
return new FixedExtentMetrics(
minScrollExtent: minScrollExtent ?? this.minScrollExtent,
maxScrollExtent: maxScrollExtent ?? this.maxScrollExtent,
pixels: pixels ?? this.pixels,
viewportDimension: viewportDimension ?? this.viewportDimension,
axisDirection: axisDirection ?? this.axisDirection,
itemIndex: itemIndex ?? this.itemIndex
minScrollExtent ?? this.minScrollExtent,
maxScrollExtent ?? this.maxScrollExtent,
pixels ?? this.pixels,
viewportDimension ?? this.viewportDimension,
axisDirection ?? this.axisDirection,
itemIndex ?? this.itemIndex
}
class _FixedExtentScrollPosition : ScrollPositionWithSingleContext, IFixedExtentMetrics {

) : base(
physics: physics,
context: context,
initialPixels: _getItemExtentFromScrollContext(context) * (initialItem ?? 0.0f),
_getItemExtentFromScrollContext(context: context) * (initialItem ?? 0.0f),
keepScrollOffset: keepScrollOffset,
oldPosition: oldPosition,
debugLabel: debugLabel

);
}
static float _getItemExtentFromScrollContext(ScrollContext context) {
_FixedExtentScrollableState scrollable = (_FixedExtentScrollableState) context;
return scrollable.itemExtent;
}
get { return _getItemExtentFromScrollContext(context); }
get { return _getItemExtentFromScrollContext(context: context); }
}

int? itemIndex = null
) {
return new FixedExtentMetrics(
minScrollExtent: minScrollExtent ?? this.minScrollExtent,
maxScrollExtent: maxScrollExtent ?? this.maxScrollExtent,
pixels: pixels ?? this.pixels,
viewportDimension: viewportDimension ?? this.viewportDimension,
axisDirection: axisDirection ?? this.axisDirection,
itemIndex: itemIndex ?? this.itemIndex
minScrollExtent ?? this.minScrollExtent,
maxScrollExtent ?? this.maxScrollExtent,
pixels ?? this.pixels,
viewportDimension ?? this.viewportDimension,
axisDirection ?? this.axisDirection,
itemIndex ?? this.itemIndex
static float _getItemExtentFromScrollContext(ScrollContext context) {
var scrollable = (_FixedExtentScrollableState) context;
return scrollable.itemExtent;
}
public readonly float itemExtent;
ScrollPhysics physics = null,
ScrollPhysics physics = null,
) : base(
key: key,
axisDirection: axisDirection,

this.itemExtent = itemExtent;
}
public readonly float itemExtent;
public override State createState() {
return new _FixedExtentScrollableState();
}

public float itemExtent {
get {
_FixedExtentScrollable actualWidget = (_FixedExtentScrollable) widget;
var actualWidget = (_FixedExtentScrollable) widget;
return actualWidget.itemExtent;
}
}

public class FixedExtentScrollPhysics : ScrollPhysics {
public FixedExtentScrollPhysics(
ScrollPhysics parent = null
) : base(parent: parent) { }
) : base(parent: parent) {
}
return new FixedExtentScrollPhysics(parent: buildParent(ancestor));
return new FixedExtentScrollPhysics(buildParent(ancestor: ancestor));
}
public override Simulation createBallisticSimulation(ScrollMetrics position, float velocity) {

"the FixedExtentScrollController"
);
_FixedExtentScrollPosition metrics = (_FixedExtentScrollPosition) position;
var metrics = (_FixedExtentScrollPosition) position;
if ((velocity <= 0.0f && metrics.pixels <= metrics.minScrollExtent) ||
(velocity >= 0.0f && metrics.pixels >= metrics.maxScrollExtent)) {
return base.createBallisticSimulation(metrics, velocity);
if (velocity <= 0.0f && metrics.pixels <= metrics.minScrollExtent ||
velocity >= 0.0f && metrics.pixels >= metrics.maxScrollExtent) {
return base.createBallisticSimulation(position: metrics, velocity: velocity);
Simulation testFrictionSimulation =
base.createBallisticSimulation(metrics, velocity);
var testFrictionSimulation =
base.createBallisticSimulation(position: metrics, velocity: velocity);
&& (testFrictionSimulation.x(float.PositiveInfinity) == metrics.minScrollExtent
|| testFrictionSimulation.x(float.PositiveInfinity) == metrics.maxScrollExtent)) {
return base.createBallisticSimulation(metrics, velocity);
&& (testFrictionSimulation.x(time: float.PositiveInfinity) == metrics.minScrollExtent
|| testFrictionSimulation.x(time: float.PositiveInfinity) == metrics.maxScrollExtent)) {
return base.createBallisticSimulation(position: metrics, velocity: velocity);
int settlingItemIndex = ListWheelScrollViewUtils._getItemFromOffset(
offset: testFrictionSimulation?.x(float.PositiveInfinity) ?? metrics.pixels,
var settlingItemIndex = ListWheelScrollViewUtils._getItemFromOffset(
testFrictionSimulation?.x(time: float.PositiveInfinity) ?? metrics.pixels,
float settlingPixels = settlingItemIndex * metrics.itemExtent;
var settlingPixels = settlingItemIndex * metrics.itemExtent;
if (velocity.abs() < tolerance.velocity
&& (settlingPixels - metrics.pixels).abs() < tolerance.distance) {

if (settlingItemIndex == metrics.itemIndex) {
return new SpringSimulation(
spring,
metrics.pixels,
settlingPixels,
velocity,
spring: spring,
start: metrics.pixels,
end: settlingPixels,
velocity: velocity,
metrics.pixels,
settlingPixels,
velocity,
startPosition: metrics.pixels,
endPosition: settlingPixels,
startVelocity: velocity,
tolerance.velocity * velocity.sign()
);
}

public readonly bool clipToSize;
public readonly ScrollController controller;
public readonly float diameterRatio;
public readonly float itemExtent;
public readonly float magnification;
public readonly float offAxisFraction;
public readonly ValueChanged<int> onSelectedItemChanged;
public readonly float overAndUnderCenterOpacity;
public readonly float perspective;
public readonly ScrollPhysics physics;
public readonly bool renderChildrenOutsideViewport;
public readonly float squeeze;
public readonly bool useMagnifier;
public ListWheelChildDelegate childDelegate;
public ListWheelScrollView(
List<Widget> children,
float itemExtent,

this.renderChildrenOutsideViewport = renderChildrenOutsideViewport;
}
public ListWheelScrollView (
public ListWheelScrollView(
float itemExtent,
Key key = null,
ScrollController controller = null,

ListWheelChildDelegate childDelegate = null
) : base(key: key) {
D.assert(childDelegate != null);
D.assert(diameterRatio > 0.0, ()=>RenderListWheelViewport.diameterRatioZeroMessage);
D.assert(diameterRatio > 0.0, () => RenderListWheelViewport.diameterRatioZeroMessage);
D.assert(perspective <= 0.01,()=> RenderListWheelViewport.perspectiveTooHighMessage);
D.assert(perspective <= 0.01, () => RenderListWheelViewport.perspectiveTooHighMessage);
D.assert(magnification > 0);
D.assert(overAndUnderCenterOpacity >= 0 && overAndUnderCenterOpacity <= 1);
D.assert(itemExtent != null);

!renderChildrenOutsideViewport || !clipToSize,()=>
RenderListWheelViewport.clipToSizeAndRenderChildrenOutsideViewportConflict
!renderChildrenOutsideViewport || !clipToSize, () =>
RenderListWheelViewport.clipToSizeAndRenderChildrenOutsideViewportConflict
);
this.controller = controller;
this.physics = physics;

this.childDelegate = childDelegate;
}
public readonly ScrollController controller;
public readonly ScrollPhysics physics;
public readonly float diameterRatio;
public readonly float perspective;
public readonly float offAxisFraction;
public readonly bool useMagnifier;
public readonly float magnification;
public readonly float itemExtent;
public readonly float overAndUnderCenterOpacity;
public readonly float squeeze;
public readonly ValueChanged<int> onSelectedItemChanged;
public readonly bool clipToSize;
public readonly bool renderChildrenOutsideViewport;
public ListWheelChildDelegate childDelegate;
public override State createState() {
return new _ListWheelScrollViewState();
}

int _lastReportedItemIndex = 0;
int _lastReportedItemIndex;
ScrollController scrollController;
public override void initState() {

}
public override void didUpdateWidget(StatefulWidget oldWidget) {
base.didUpdateWidget(oldWidget);
base.didUpdateWidget(oldWidget: oldWidget);
ScrollController oldScrollController = scrollController;
SchedulerBinding.instance.addPostFrameCallback((_) => { oldScrollController.dispose(); });
var oldScrollController = scrollController;
SchedulerBinding.instance.addPostFrameCallback(_ => { oldScrollController.dispose(); });
scrollController = widget.controller;
}
}

onNotification: (ScrollNotification notification) => {
onNotification: notification => {
int currentItemIndex = metrics.itemIndex;
var currentItemIndex = metrics.itemIndex;
int trueIndex = widget.childDelegate.trueIndexOf(currentItemIndex);
widget.onSelectedItemChanged(trueIndex);
var trueIndex = widget.childDelegate.trueIndexOf(index: currentItemIndex);
widget.onSelectedItemChanged(value: trueIndex);
}
}

controller: scrollController,
physics: widget.physics,
itemExtent: widget.itemExtent,
viewportBuilder: (BuildContext _context, ViewportOffset _offset) => {
viewportBuilder: (_context, _offset) => {
return new ListWheelViewport(
diameterRatio: widget.diameterRatio,
perspective: widget.perspective,

overAndUnderCenterOpacity: widget.overAndUnderCenterOpacity,
itemExtent: widget.itemExtent ,
itemExtent: widget.itemExtent,
squeeze: widget.squeeze,
clipToSize: widget.clipToSize,
renderChildrenOutsideViewport: widget.renderChildrenOutsideViewport,

}
public class ListWheelElement : RenderObjectElement, IListWheelChildManager {
public ListWheelElement(ListWheelViewport widget) : base(widget) { }
readonly SplayTree<int, Element> _childElements = new SplayTree<int, Element>();
readonly Dictionary<int, Widget> _childWidgets = new Dictionary<int, Widget>();
public ListWheelElement(ListWheelViewport widget) : base(widget: widget) {
}
public new ListWheelViewport widget {
get { return (ListWheelViewport) base.widget; }

get { return (RenderListWheelViewport)base.renderObject; }
get { return (RenderListWheelViewport) base.renderObject; }
public int? childCount {
get { return widget.childDelegate.estimatedChildCount; }
}
readonly Dictionary<int, Widget> _childWidgets = new Dictionary<int, Widget>();
public bool childExistsAt(int index) {
return retrieveWidget(index: index) != null;
}
public void createChild(int index, RenderBox after) {
owner.buildScope(this, () => {
var insertFirst = after == null;
D.assert(insertFirst || _childElements.getOrDefault(index - 1) != null);
var newChild = updateChild(_childElements.getOrDefault(key: index), retrieveWidget(index: index),
newSlot: index);
if (newChild != null) {
_childElements[key: index] = newChild;
}
else {
_childElements.Remove(key: index);
}
});
}
readonly SplayTree<int, Element> _childElements = new SplayTree<int, Element>();
public void removeChild(RenderBox child) {
var index = renderObject.indexOf(child: child);
owner.buildScope(this, () => {
D.assert(_childElements.ContainsKey(key: index));
var result = updateChild(_childElements[key: index], null, newSlot: index);
D.assert(result == null);
_childElements.Remove(key: index);
D.assert(!_childElements.ContainsKey(key: index));
});
}
ListWheelViewport oldWidget = widget;
base.update(newWidget);
ListWheelChildDelegate newDelegate = ((ListWheelViewport) newWidget).childDelegate;
ListWheelChildDelegate oldDelegate = oldWidget.childDelegate;
var oldWidget = widget;
base.update(newWidget: newWidget);
var newDelegate = ((ListWheelViewport) newWidget).childDelegate;
var oldDelegate = oldWidget.childDelegate;
(newDelegate.GetType() != oldDelegate.GetType() || newDelegate.shouldRebuild(oldDelegate))) {
(newDelegate.GetType() != oldDelegate.GetType() ||
newDelegate.shouldRebuild(oldDelegate: oldDelegate))) {
}
public int? childCount {
get { return widget.childDelegate.estimatedChildCount; }
}
protected override void performRebuild() {

return;
}
int firstIndex = _childElements.First()?.Key ?? 0;
int lastIndex = _childElements.Last()?.Key ?? _childElements.Count;
var firstIndex = _childElements.First()?.Key ?? 0;
var lastIndex = _childElements.Last()?.Key ?? _childElements.Count;
for (int index = firstIndex; index <= lastIndex; ++index) {
Element newChild = updateChild(_childElements[index], retrieveWidget(index), index);
for (var index = firstIndex; index <= lastIndex; ++index) {
var newChild = updateChild(_childElements[key: index], retrieveWidget(index: index), newSlot: index);
_childElements[index] = newChild;
_childElements[key: index] = newChild;
_childElements.Remove(index);
_childElements.Remove(key: index);
return _childWidgets.putIfAbsent(index,
() => { return widget.childDelegate.build(this, index); });
}
public bool childExistsAt(int index) {
return retrieveWidget(index) != null;
}
public void createChild(int index, RenderBox after) {
owner.buildScope(this, () => {
bool insertFirst = after == null;
D.assert(insertFirst || _childElements.getOrDefault(index - 1) != null);
Element newChild = updateChild(_childElements.getOrDefault(index), retrieveWidget(index), index);
if (newChild != null) {
_childElements[index] = newChild;
}
else {
_childElements.Remove(index);
}
});
}
public void removeChild(RenderBox child) {
int index = renderObject.indexOf(child);
owner.buildScope(this, () => {
D.assert(_childElements.ContainsKey(index));
Element result = updateChild(_childElements[index], null, index);
D.assert(result == null);
_childElements.Remove(index);
D.assert(!_childElements.ContainsKey(index));
});
return _childWidgets.putIfAbsent(key: index,
() => { return widget.childDelegate.build(this, index: index); });
ListWheelParentData oldParentData = (ListWheelParentData) child?.renderObject?.parentData;
Element newChild = base.updateChild(child, newWidget, newSlot);
ListWheelParentData newParentData = (ListWheelParentData) newChild?.renderObject?.parentData;
var oldParentData = (ListWheelParentData) child?.renderObject?.parentData;
var newChild = base.updateChild(child: child, newWidget: newWidget, newSlot: newSlot);
var newParentData = (ListWheelParentData) newChild?.renderObject?.parentData;
if (newParentData != null) {
newParentData.index = (int) newSlot;
if (oldParentData != null) {

}
protected override void insertChildRenderObject(RenderObject child, object slot) {
RenderListWheelViewport renderObject = this.renderObject;
D.assert(renderObject.debugValidateChild(child));
int slotNum = (int) slot;
renderObject.insert(child as RenderBox, after: _childElements.getOrDefault(slotNum - 1)?.renderObject as RenderBox);
var renderObject = this.renderObject;
D.assert(renderObject.debugValidateChild(child: child));
var slotNum = (int) slot;
renderObject.insert(child as RenderBox,
_childElements.getOrDefault(slotNum - 1)?.renderObject as RenderBox);
protected override void moveChildRenderObject(RenderObject child, dynamic slot) {
string moveChildRenderObjectErrorMessage =
protected override void moveChildRenderObject(RenderObject child, dynamic slot) {
var moveChildRenderObjectErrorMessage =
"Currently we maintain the list in contiguous increasing order, so " +
"moving children around is not allowed.";
D.assert(false, () => moveChildRenderObjectErrorMessage);

public override void visitChildren(ElementVisitor visitor) {
foreach (var item in _childElements) {
visitor(item.Value);
visitor(element: item.Value);
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
_childElements.Remove((int) (child.slot));
base.forgetChild(child);
}

public readonly ListWheelChildDelegate childDelegate;
public readonly bool clipToSize;
public readonly float diameterRatio;
public readonly float? itemExtent;
public readonly float magnification;
public readonly float offAxisFraction;
public readonly ViewportOffset offset;
public readonly float overAndUnderCenterOpacity;
public readonly float perspective;
public readonly bool renderChildrenOutsideViewport;
public readonly float squeeze;
public readonly bool useMagnifier;
public ListWheelViewport(
Key key = null,
float diameterRatio = RenderListWheelViewport.defaultDiameterRatio,

this.childDelegate = childDelegate;
}
public readonly float diameterRatio;
public readonly float perspective;
public readonly float offAxisFraction;
public readonly bool useMagnifier;
public readonly float magnification;
public readonly float overAndUnderCenterOpacity;
public readonly float? itemExtent;
public readonly float squeeze;
public readonly bool clipToSize;
public readonly bool renderChildrenOutsideViewport;
public readonly ViewportOffset offset;
public readonly ListWheelChildDelegate childDelegate;
ListWheelElement childManager = (ListWheelElement) context;
var childManager = (ListWheelElement) context;
return new RenderListWheelViewport(
childManager: childManager,
offset: offset,

useMagnifier: useMagnifier,
magnification: magnification,
overAndUnderCenterOpacity: overAndUnderCenterOpacity,
itemExtent: itemExtent ?? 1.0f ,
itemExtent: itemExtent ?? 1.0f,
squeeze: squeeze,
clipToSize: clipToSize,
renderChildrenOutsideViewport: renderChildrenOutsideViewport

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


public override bool applyViewportDimension(float viewportDimension) {
float oldViewportDimensions = 0.0f;
if (haveDimensions) {
if (haveViewportDimension) {
oldViewportDimensions = this.viewportDimension;
}

16
com.unity.uiwidgets/Runtime/widgets/routes.cs


_ModalScopeStatus widget = context.dependOnInheritedWidgetOfExactType<_ModalScopeStatus>();
return widget?.route as ModalRoute<T>;
}
public new GlobalKey<_ModalScopeState<T>> _scopeKey = new LabeledGlobalKey<_ModalScopeState<T>>();
public override Future<RoutePopDisposition> willPop() {
//async
_ModalScopeState<T> scope = _scopeKey.currentState as _ModalScopeState<T> ;
D.assert(scope != null);
bool result = false;
foreach (WillPopCallback callback in _willPopCallbacks) {
callback.Invoke().then(v => result = !(bool)v);
if (result) {
return Future.value(RoutePopDisposition.doNotPop).to<RoutePopDisposition>();
}
}
return base.willPop();
}
public override Widget _buildModalScope(BuildContext context) {
return _modalScopeCache = _modalScopeCache ?? new _ModalScope<T>(key: _scopeKey, route: this);
}

51
com.unity.uiwidgets/Runtime/widgets/scroll_metrics.cs


using System;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;

) {
if (it is IPageMetrics) {
return new PageMetrics(
minScrollExtent: minScrollExtent ?? it.minScrollExtent,
maxScrollExtent: maxScrollExtent ?? it.maxScrollExtent,
pixels: pixels ?? it.pixels,
viewportDimension: viewportDimension ?? it.viewportDimension,
axisDirection: axisDirection ?? it.axisDirection,
viewportFraction: viewportFraction ?? ((IPageMetrics) it).viewportFraction
minScrollExtent ?? it.minScrollExtent,
maxScrollExtent ?? it.maxScrollExtent,
pixels ?? it.pixels,
viewportDimension ?? it.viewportDimension,
axisDirection ?? it.axisDirection,
viewportFraction ?? ((IPageMetrics) it).viewportFraction
minScrollExtent: minScrollExtent ?? it.minScrollExtent,
maxScrollExtent: maxScrollExtent ?? it.maxScrollExtent,
pixels: pixels ?? it.pixels,
viewportDimension: viewportDimension ?? it.viewportDimension,
axisDirection: axisDirection ?? it.axisDirection,
minScrollExtent ?? it.minScrollExtent,
maxScrollExtent ?? it.maxScrollExtent,
pixels ?? it.pixels,
viewportDimension ?? it.viewportDimension,
axisDirection ?? it.axisDirection,
minScrollExtent: minScrollExtent ?? it.minScrollExtent,
maxScrollExtent: maxScrollExtent ?? it.maxScrollExtent,
pixels: pixels ?? it.pixels,
viewportDimension: viewportDimension ?? it.viewportDimension,
axisDirection: axisDirection ?? it.axisDirection
minScrollExtent ?? it.minScrollExtent,
maxScrollExtent ?? it.maxScrollExtent,
pixels ?? it.pixels,
viewportDimension ?? it.viewportDimension,
axisDirection ?? it.axisDirection
return AxisUtils.axisDirectionToAxis(it.axisDirection);
return AxisUtils.axisDirectionToAxis(axisDirection: it.axisDirection);
}
public static bool outOfRange(this ScrollMetrics it) {

public static float extentInside(this ScrollMetrics it) {
D.assert(it.minScrollExtent <= it.maxScrollExtent);
return it.viewportDimension
- (it.minScrollExtent - it.pixels).clamp(0, it.viewportDimension)
- (it.pixels - it.maxScrollExtent).clamp(0, it.viewportDimension);
return it.viewportDimension
- (it.minScrollExtent - it.pixels).clamp(0, max: it.viewportDimension)
- (it.pixels - it.maxScrollExtent).clamp(0, max: it.viewportDimension);
}
public static float extentAfter(this ScrollMetrics it) {

this.axisDirection = axisDirection;
}
public float minScrollExtent { get; private set; }
public float minScrollExtent { get; }
public float maxScrollExtent { get; private set; }
public float maxScrollExtent { get; }
public float pixels { get; private set; }
public float pixels { get; }
public float viewportDimension { get; private set; }
public float viewportDimension { get; }
public AxisDirection axisDirection { get; private set; }
public AxisDirection axisDirection { get; }
public override string ToString() {
return $"{GetType()}({this.extentBefore():F1})..[{this.extentInside():F1}]..{this.extentAfter():F1})";

4
com.unity.uiwidgets/Runtime/widgets/scroll_position.cs


float? _viewportDimension;
public bool haveViewportDimension {
get { return _viewportDimension != null; }
}
public bool haveDimensions {
get { return _haveDimensions; }
}

31
com.unity.uiwidgets/Runtime/widgets/shortcuts.cs


public static readonly List<int> _tempHashStore4 = new List<int> {0, 0, 0, 0}; // used to sort exactly 4 keys
public readonly HashSet<T> _keys;
public int _hashCode;
public KeySet(
T key1,
T key2 = default,

return true;
}
return Equals(objA: _keys, objB: other._keys) && _hashCode == other._hashCode;
return _keys.SetEquals(other._keys);
}
public override bool Equals(object obj) {

public override int GetHashCode() {
unchecked {
if (_hashCode != 0) {
return _hashCode;
}
var h1 = iterator.GetHashCode();
var h1 = iterator.Current.GetHashCode();
return _hashCode = h1;
return h1;
var h2 = iterator.GetHashCode();
var h2 = iterator.Current.GetHashCode();
return _hashCode = h1 < h2
return h1 < h2
? ((h1 != null ? h1.GetHashCode() : 0) * 397) ^ h2.GetHashCode()
: ((h2 != null ? h2.GetHashCode() : 0) * 397) ^ h1.GetHashCode();
}

sortedHashes[0] = h1;
sortedHashes[1] = h2;
iterator.MoveNext();
sortedHashes[2] = iterator.GetHashCode();
sortedHashes[2] = iterator.Current.GetHashCode();
sortedHashes[3] = iterator.GetHashCode();
sortedHashes[3] = iterator.Current.GetHashCode();
return _hashCode = (_hashCode * 397) ^ (sortedHashes != null ? sortedHashes.GetHashCode() : 0);
var _hashCode = sortedHashes[0].GetHashCode();
for (var i = 1; i < sortedHashes.Count; i++) {
_hashCode = (_hashCode * 397) ^ (sortedHashes[i].GetHashCode());
}
return _hashCode;
}
}

notifyListeners();
}
}
public bool handleKeypress(
public virtual bool handleKeypress(
BuildContext context,
RawKeyEvent rawKeyEvent,
LogicalKeySet keysPressed = null

4
com.unity.uiwidgets/Runtime/widgets/sliver.cs


int index = _keyToIndex.getOrDefault(_defaultNullKey);
while (index < children.Count) {
Widget child = children[index];
if (child.key != _defaultNullKey) {
if (child.key != null && child.key != _defaultNullKey) {
_keyToIndex[child.key] = index;
}
if (child.key == key) {

}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(child != null);
D.assert(child.slot != null);
D.assert(_childElements.ContainsKey((int) child.slot));

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


});
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
D.assert(child == this.child);
this.child = null;
base.forgetChild(child);

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


}
}
internal override void forgetChild(Element child) {
public override void forgetChild(Element child) {
_forgottenChildren.Add(child);
}
}

4
com.unity.uiwidgets/Runtime/widgets/title.cs


Widget child = null
) : base(key: key) {
D.assert(title != null);
D.assert(color != null && color.alpha == 0xFF);
//in flutter, the background color is not allowed to be transparent because there is nothing behind the UI. But in UIWidgets it is
//possible to put a unity scene under the ui panel. Therefore we can discard the assertion on "color.alpha == 0xFF" here
D.assert(color != null);
this.color = color;
this.child = child;
this.title = title;

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


public override RenderComparison compareTo(InlineSpan other) {
if (this == other)
return RenderComparison.identical;
if (style.GetType() != GetType())
if (other.GetType() != GetType())
return RenderComparison.layout;
if ((style == null) != (other.style == null))
return RenderComparison.layout;

307
engine/Build.bee.cs


using Bee.Toolchain.IOS;
using System.Diagnostics;
using System.IO;
using Bee.Toolchain.Android;
enum UIWidgetsBuildTargetPlatform
{
windows,

}
//bee.exe mac
static void DeployAndroid()
static void DeployAndroid(bool isArm64 = false)
buildArm64 = isArm64;
Backend.Current.AddAliasDependency("android_debug", dep);
Backend.Current.AddAliasDependency(isArm64 ? "android_debug_arm64" : "android_debug", dep);
Backend.Current.AddAliasDependency("android_release", dep);
Backend.Current.AddAliasDependency(isArm64 ? "android_release_arm64" : "android_release", dep);
}
}

{
DeployMac();
DeployAndroid();
DeployAndroid(true);
DeployIOS();
}
}

private static bool buildArm64;
//this setting is disabled by default, don't change it unless you know what you are doing
//it must be set the same as the settings we choose to build the flutter txt library

//"SKIA_VERSION=\"0.0\"",
"XML_STATIC",
});
np.CompilerSettings().Add(c => IsAndroid(c), c => c.WithCustomFlags(new[] {
"-MD",
"-MF",
np.CompilerSettings().Add(c => IsAndroid(c), c =>
{
var flags = new List<string>{
"-MD",
"-MF",
"-I.",
"-Ithird_party",
"-Isrc",
"-I"+ flutterRoot,
"-I"+ flutterRoot+"/third_party/rapidjson/include",
"-I"+ skiaRoot,
"-I"+ skiaRoot + "/include/third_party/vulkan",
"-I"+ flutterRoot+"/flutter/third_party/txt/src",
"-I" + flutterRoot + "/third_party/harfbuzz/src",
"-I" + skiaRoot + "/third_party/externals/icu/source/common",
"-I.",
"-Ithird_party",
"-Isrc",
"-I" + flutterRoot,
"-I" + flutterRoot + "/third_party/rapidjson/include",
"-I" + skiaRoot,
"-I" + skiaRoot + "/include/third_party/vulkan",
"-I" + flutterRoot + "/flutter/third_party/txt/src",
"-I" + flutterRoot + "/third_party/harfbuzz/src",
"-I" + skiaRoot + "/third_party/externals/icu/source/common",
// "-Igen",
"-I"+ flutterRoot+"/third_party/libcxx/include",
"-I"+ flutterRoot+"/third_party/libcxxabi/include",
"-I"+ flutterRoot+"/third_party/icu/source/common",
"-I"+ flutterRoot+"/third_party/icu/source/i18n",
// "-Igen",
"-I" + flutterRoot + "/third_party/libcxx/include",
"-I" + flutterRoot + "/third_party/libcxxabi/include",
"-I" + flutterRoot + "/third_party/icu/source/common",
"-I" + flutterRoot + "/third_party/icu/source/i18n",
// ignore deprecated code
"-Wno-deprecated-declarations",
// ignore deprecated code
"-Wno-deprecated-declarations",
"-fno-strict-aliasing",
"-mfloat-abi=softfp",
"-mthumb",
"-fPIC",
"-pipe",
"-fcolor-diagnostics",
"-ffunction-sections",
"-funwind-tables",
"-fno-short-enums",
"-nostdinc++",
"-mfpu=neon",
"-Wall",
"-Wextra",
"-Wendif-labels",
"-Werror",
"-Wno-missing-field-initializers",
"-Wno-unused-parameter",
"-Wno-unused-variable",
"-Wno-unused-command-line-argument",
"-Wno-unused-function",
// "-Wno-non-c-typedef-for-linkage",
"-isystem" + flutterRoot + "/third_party/android_tools/ndk/sources/android/support/include",
// "-isystem" + flutterRoot +
//"-D__ANDROID_API__=16",
// "-fvisibility=hidden",
"--sysroot=" + flutterRoot + "/third_party/android_tools/ndk/sysroot",
"-Wstring-conversion",
// supress new line error
// "-Wnewline-eof",
"-O0",
"-g2",
"-fvisibility-inlines-hidden",
"-std=c++17",
"-fno-rtti",
"-fno-exceptions",
"-nostdlib"
};
if (buildArm64)
{
flags.Add(new []
{
"--target=aarch64-linux-android",
"-isystem"+ flutterRoot +
"/third_party/android_tools/ndk/sysroot/usr/include/aarch64-linux-android",
"-fno-strict-aliasing",
"-march=armv7-a",
"-mfloat-abi=softfp",
"-mtune=generic-armv7-a",
"-mthumb",
"-fPIC",
"-pipe",
"-fcolor-diagnostics",
"-ffunction-sections",
"-funwind-tables",
"-fno-short-enums",
"-nostdinc++",
"--target=arm-linux-androideabi",
"-mfpu=neon",
"-Wall",
"-Wextra",
"-Wendif-labels",
"-Werror",
"-Wno-missing-field-initializers",
"-Wno-unused-parameter",
"-Wno-unused-variable",
"-Wno-unused-command-line-argument",
"-Wno-unused-function",
// "-Wno-non-c-typedef-for-linkage",
"-isystem"+ flutterRoot+"/third_party/android_tools/ndk/sources/android/support/include",
"-isystem"+ flutterRoot +
"/third_party/android_tools/ndk/sysroot/usr/include/arm-linux-androideabi",
//"-D__ANDROID_API__=16",
// "-fvisibility=hidden",
"--sysroot="+ flutterRoot+"/third_party/android_tools/ndk/sysroot",
"-Wstring-conversion",
// supress new line error
// "-Wnewline-eof",
"-O0",
"-g2",
"-fvisibility-inlines-hidden",
"-std=c++17",
"-fno-rtti",
"-fno-exceptions",
"-nostdlib"
}));
});
}
else
{
flags.Add(new []
{
"-march=armv7-a",
"-mtune=generic-armv7-a",
"--target=arm-linux-androideabi",
"-isystem"+ flutterRoot +
"/third_party/android_tools/ndk/sysroot/usr/include/arm-linux-androideabi",
});
}
return c.WithCustomFlags(flags.ToArray());
}
);
np.IncludeDirectories.Add("third_party");
np.IncludeDirectories.Add("src");

return IsWindows(c) && c.CodeGen == CodeGen.Debug;
}, l => l.WithCustomFlags_workaround(new[] { "/DEBUG:FULL" }));
np.LinkerSettings().Add(c => IsAndroid(c), l => l.WithCustomFlags_workaround(new[] {
"-Wl,--fatal-warnings",
"-fPIC",
"-Wl,-z,noexecstack",
"-Wl,-z,now",
"-Wl,-z,relro",
"-Wl,-z,defs",
"--gcc-toolchain="+ flutterRoot +
"/third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64",
"-Wl,--no-undefined",
"-Wl,--exclude-libs,ALL",
"-fuse-ld=lld",
"-Wl,--icf=all",
"--target=arm-linux-androideabi",
"-nostdlib++",
"-Wl,--warn-shared-textrel",
"-nostdlib",
"--sysroot="+ flutterRoot+"/third_party/android_tools/ndk/platforms/android-16/arch-arm",
"-L"+ flutterRoot + "/third_party/android_tools/ndk/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a",
"-Wl,--build-id=sha1",
"-g",
"-Wl,-soname=libUIWidgets.so",
"-Wl,--whole-archive",
}));
np.LinkerSettings().Add(c => IsAndroid(c), l =>
{
var flags = new List<string>()
{
"-Wl,--fatal-warnings",
"-fPIC",
"-Wl,-z,noexecstack",
"-Wl,-z,now",
"-Wl,-z,relro",
"-Wl,-z,defs",
"-Wl,--no-undefined",
"-Wl,--exclude-libs,ALL",
"-fuse-ld=lld",
"-Wl,--icf=all",
"-nostdlib++",
"-Wl,--warn-shared-textrel",
"-nostdlib",
"-Wl,--build-id=sha1",
"-g",
"-Wl,-soname=libUIWidgets.so",
"-Wl,--whole-archive",
};
if (buildArm64)
{
flags.Add(new []
{
"--gcc-toolchain="+ flutterRoot +
"/third_party/android_tools/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64",
"--sysroot="+ flutterRoot+"/third_party/android_tools/ndk/platforms/android-22/arch-arm64",
"-L"+ flutterRoot + "/third_party/android_tools/ndk/sources/cxx-stl/llvm-libc++/libs/arm64-v8a",
"-L/Users/siyao/Documents/GitHub/com.unity.uiwidgets/engine/Scripts/engine/src/third_party/android_tools/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/lib/gcc/aarch64-linux-android/4.9.x",
});
}
else
{
flags.Add(new []
{
"--gcc-toolchain="+ flutterRoot +
"/third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64",
"--target=arm-linux-androideabi",
"--sysroot="+ flutterRoot+"/third_party/android_tools/ndk/platforms/android-16/arch-arm",
"-L"+ flutterRoot + "/third_party/android_tools/ndk/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a",
});
}
return l.WithCustomFlags_workaround(flags.ToArray());
});
SetupDependency(np);
//SetupFml(np);

}
else if (platform == UIWidgetsBuildTargetPlatform.android)
{
var androidToolchain = ToolChain.Store.Android().r19().Armv7();
AndroidNdkToolchain androidToolchain = null;
if (buildArm64)
{
androidToolchain = ToolChain.Store.Android().r19().Arm64();
}
else
{
androidToolchain = ToolChain.Store.Android().r19().Armv7();
}
var validConfigurations = new List<NativeProgramConfiguration>();

if(codegen == CodeGen.Debug)
{
var buildNP = np.SetupSpecificConfiguration(config, androidToolchain.DynamicLibraryFormat).DeployTo("build_debug");
var buildNP = np.SetupSpecificConfiguration(config, androidToolchain.DynamicLibraryFormat)
.DeployTo(buildArm64 ? "build_debug_arm64" : "build_debug");
var buildNP = np.SetupSpecificConfiguration(config, androidToolchain.DynamicLibraryFormat).DeployTo("build_release");
var buildNP = np.SetupSpecificConfiguration(config, androidToolchain.DynamicLibraryFormat)
.DeployTo(buildArm64 ? "build_release_64" : "build_release");
dependencies_release.Add(buildNP.Path);
}

np.Libraries.Add(IsAndroid, c =>
{
if(c.CodeGen == CodeGen.Debug){
return new PrecompiledLibrary[]{
new StaticLibrary(flutterRoot+"/out/android_debug_unopt/obj/flutter/third_party/txt/libtxt_lib.a"),
};
} else {
return new PrecompiledLibrary[]{
new StaticLibrary(flutterRoot+"/out/android_release/obj/flutter/third_party/txt/libtxt_lib.a"),
if (c.CodeGen == CodeGen.Debug)
{
if (buildArm64)
{
return new PrecompiledLibrary[]
{
new StaticLibrary(flutterRoot +
"/out/android_debug_unopt_arm64/obj/flutter/third_party/txt/libtxt_lib.a"),
};
}
else
{
return new PrecompiledLibrary[]
{
new StaticLibrary(flutterRoot +
"/out/android_debug_unopt/obj/flutter/third_party/txt/libtxt_lib.a"),
};
}
}
else
{
return new PrecompiledLibrary[]
{
new StaticLibrary(buildArm64 ?
flutterRoot + "/out/android_release_arm64/obj/flutter/third_party/txt/libtxt_lib.a"
:flutterRoot + "/out/android_release/obj/flutter/third_party/txt/libtxt_lib.a"
),
};
}
});

var basePath = skiaRoot + "/out/arm";
return new PrecompiledLibrary[]
var libraries = new List<PrecompiledLibrary>
new StaticLibrary(flutterRoot+"/third_party/android_tools/ndk/platforms/android-16/arch-arm/usr/lib/crtbegin_so.o"),
new StaticLibrary(flutterRoot+"/third_party/android_tools/ndk/platforms/android-16/arch-arm/usr/lib/crtend_so.o"),
new SystemLibrary("android_support"),
new SystemLibrary("unwind"),
new SystemLibrary("gcc"),
new SystemLibrary("c"),
new SystemLibrary("dl"),

new SystemLibrary("GLESv2"),
new SystemLibrary("log"),
};
if (buildArm64)
{
libraries.Add(new PrecompiledLibrary[]
{
new StaticLibrary(flutterRoot +
"/third_party/android_tools/ndk/platforms/android-22/arch-arm64/usr/lib/crtbegin_so.o"),
new StaticLibrary(flutterRoot +
"/third_party/android_tools/ndk/platforms/android-22/arch-arm64/usr/lib/crtbegin_so.o"),
});
}
else
{
libraries.Add(new PrecompiledLibrary[]
{
new StaticLibrary(flutterRoot +
"/third_party/android_tools/ndk/platforms/android-16/arch-arm/usr/lib/crtbegin_so.o"),
new StaticLibrary(flutterRoot +
"/third_party/android_tools/ndk/platforms/android-16/arch-arm/usr/lib/crtend_so.o"),
new SystemLibrary("android_support"),
new SystemLibrary("unwind"),
});
}
return libraries;
});
}

2
engine/README.md


### build icu
```
cd <uiwidigets_dir>\engine
python $FLUTTER_ROOT/flutter/sky/tools/objcopy.py --objcopy $FLUTTER_ROOT/third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-objcopy --input $FLUTTER_ROOT/third_party/icu/flutter/icudtl.dat --output icudtl.o --arch arm
python $FLUTTER_ROOT_PATH/flutter/sky/tools/objcopy.py --objcopy $FLUTTER_ROOT_PATH/third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-objcopy --input $FLUTTER_ROOT_PATH/third_party/icu/flutter/icudtl.dat --output icudtl.o --arch arm
```
### build uiwidgets
```

59
engine/Scripts/lib_build.py


bitcode=""
flutter_root_path=""
visual_studio_path=""
architecture=""
def get_opts():
# get intput agrs

global bitcode
global visual_studio_path
global platform
global architecture
options, args = getopt.getopt(sys.argv[1:], 'r:p:m:v:eh',["help"])
options, args = getopt.getopt(sys.argv[1:], 'r:p:m:v:eh',["arm64","help"])
for opt, arg in options:
if opt == '-r':
engine_path = arg # set engine_path, depot_tools and flutter engine folder will be put into this path

visual_studio_path = arg
elif opt == '-e':
bitcode="-bitcode_bundle -bitcode_verify"
elif opt == '--arm64':
architecture = "arm64"
if platform == "android":
gn_params += " --android-cpu=arm64"
elif opt in ("-h","--help"):
show_help()
sys.exit()

ninja_params3=" -C out/" +output_path + " third_party/angle:libEGL_static"
elif runtime_mode == "release" and platform == "android":
optimize=""
output_path="android_release"
if architecture == "arm64":
output_path="android_release_arm64"
else:
output_path="android_release"
output_path="android_debug_unopt"
if architecture == "arm64":
output_path="android_debug_unopt_arm64"
else:
output_path="android_debug_unopt"
elif runtime_mode == "release" and platform == "ios":
optimize=""
output_path="ios_release"

global platform
print("\nSCompiling engine...")
os.chdir(Path(flutter_root_path + "/third_party/skia/"))
copy_file(Path(work_path + "/patches/skia.patch"), Path(flutter_root_path + "/third_party/skia"))
os.system("patch -p1 < skia.patch -N")
if platform == "ios" or platform == "mac":
os.chdir(Path(flutter_root_path + "/flutter/third_party/txt"))

elif platform == "android":
dest_folder = "android"
os.chdir(work_path + "/../")
os.system("python " + flutter_root_path + "/flutter/sky/tools/objcopy.py --objcopy " + flutter_root_path + "/third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-objcopy --input " + flutter_root_path + "/third_party/icu/flutter/icudtl.dat --output icudtl.o --arch arm")
if architecture == "arm64":
os.system("python " + flutter_root_path + "/flutter/sky/tools/objcopy.py --objcopy " + flutter_root_path + "/third_party/android_tools/ndk/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-objcopy --input " + flutter_root_path + "/third_party/icu/flutter/icudtl.dat --output icudtl.o --arch arm64")
dest_folder = os.path.join(dest_folder, "arm64")
else:
os.system("python " + flutter_root_path + "/flutter/sky/tools/objcopy.py --objcopy " + flutter_root_path + "/third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-objcopy --input " + flutter_root_path + "/third_party/icu/flutter/icudtl.dat --output icudtl.o --arch arm")
elif platform == "ios":
dest_folder = "ios"
if not os.path.exists(Path(work_path + "/../../com.unity.uiwidgets/Runtime/Plugins/" + dest_folder)):

if os.path.exists(Path(work_path + "/../build_release")):
shutil.rmtree(Path(work_path + "/../build_release"))
if os.path.exists(Path(work_path + "/../build_release_arm64")):
shutil.rmtree(Path(work_path + "/../build_release_arm64"))
os.system("mono bee.exe " + platform +"_release")
copy_file(Path(work_path + "/../build_release/"), Path(work_path + "/../../com.unity.uiwidgets/Runtime/Plugins/" + dest_folder))
if platform == "android" and architecture == "arm64":
os.system("mono bee.exe " + platform +"_release_arm64")
else:
os.system("mono bee.exe " + platform +"_release")
if architecture == "arm64":
copy_file(Path(work_path + "/../build_release_arm64/"), Path(work_path + "/../../com.unity.uiwidgets/Runtime/Plugins/" + dest_folder))
else:
copy_file(Path(work_path + "/../build_release/"), Path(work_path + "/../../com.unity.uiwidgets/Runtime/Plugins/" + dest_folder))
if platform == "android":
tundra_file=Path(work_path + "/../artifacts/tundra.dag.json")
rsp = get_rsp(tundra_file, runtime_mode)

os.chdir(Path(work_path + "/../"))
os.system("artifacts/Stevedore/android-ndk-mac/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ " + "@\"" + rsp + "\"")
os.system(flutter_root_path + "/buildtools/mac-x64/clang/bin/clang++ " + "@\"" + rsp + "\"")
copy_file(Path(work_path + "/../artifacts/libUIWidgets/release_Android_arm32/libUIWidgets.so"), Path(work_path + "/../../com.unity.uiwidgets/Runtime/Plugins/Android"))
if architecture == "arm64":
copy_file(Path(work_path + "/../artifacts/libUIWidgets/release_Android_arm64/libUIWidgets.so"), Path(work_path + "/../../com.unity.uiwidgets/Runtime/Plugins/Android/arm64"))
else:
copy_file(Path(work_path + "/../artifacts/libUIWidgets/release_Android_arm32/libUIWidgets.so"), Path(work_path + "/../../com.unity.uiwidgets/Runtime/Plugins/Android"))
elif platform == "ios":
print("\nStarting prlink library...")
os.chdir(Path(work_path + "/../"))

if os.path.exists(Path(work_path + "/../build_debug_arm64")):
shutil.rmtree(Path(work_path + "/../build_debug_arm64"))
elif platform == "android" and architecture == "arm64":
os.system("mono bee.exe " + platform +"_debug_arm64")
copy_file(Path(work_path + "/../build_debug/"), Path(work_path + "/../../com.unity.uiwidgets/Runtime/Plugins/" + dest_folder))
if architecture == "arm64":
copy_file(Path(work_path + "/../build_debug_arm64/"), Path(work_path + "/../../com.unity.uiwidgets/Runtime/Plugins/" + dest_folder))
else:
copy_file(Path(work_path + "/../build_debug/"), Path(work_path + "/../../com.unity.uiwidgets/Runtime/Plugins/" + dest_folder))
if platform == "ios":
print("\nStarting prlink library...")
os.chdir(Path(work_path + "/../"))

def revert_patches():
global flutter_root_path
print("\nRevert patches...")
os.chdir(Path(flutter_root_path + "/third_party/skia/"))
os.system("patch -p1 -R < skia.patch")
os.chdir(Path(flutter_root_path + "/flutter/third_party/txt"))
os.system("patch -R < BUILD.gn.patch")

json_list = temp['Nodes']
target_files=''
for item in json_list:
if item['Annotation'].startswith('Link_Android_arm32') and item['Annotation'].find(runtime_mode) != -1:
if item['Annotation'].startswith('Link_Android_arm64' if architecture == "arm64" else 'Link_Android_arm32') and item['Annotation'].find(runtime_mode) != -1:
action_list = item['Inputs']
for o in action_list:
if o.endswith('.rsp'):

15
engine/Scripts/lib_build_android.sh


engine_path=$(pwd)
runtime_mode=release
while getopts ":r:m:" opt
architecture=""
while getopts ":r:m:a:" opt
do
case $opt in
r)

runtime_mode=$OPTARG
;;
a)
architecture=$OPTARG
;;
?)
echo "unknown param"
exit 1;;

python3 lib_build.py -r $engine_path -p android -m $runtime_mode
if [ $architecture = "arm64" ]; then
python3 lib_build.py -r $engine_path -p android -m $runtime_mode --arm64
elif [ ! $architecture ] || [ $architecture = "arm32" ]; then
python3 lib_build.py -r $engine_path -p android -m $runtime_mode
else
echo "If you want to build android arm64, please enter '-a arm64'. \Without entering this, it will build android arm32 by default"
fi

2
engine/src/lib/ui/painting/picture.cc


UIWIDGETS_API(void) Picture_dispose(Picture* ptr) { ptr->Release(); }
UIWIDGETS_API(bool) Picture_GetAllocationSize(Picture* ptr) {
UIWIDGETS_API(size_t) Picture_GetAllocationSize(Picture* ptr) {
return ptr->GetAllocationSize();
}

22
engine/src/lib/ui/painting/skottie.cc


path = (char*)fileOut;
#endif
sk_sp<skottie::Animation> animation_ = skottie::Animation::MakeFromFile(path);
if(animation_ == nullptr){
return nullptr;
}
return fml::MakeRefCounted<Skottie>(animation_);
}

UIWIDGETS_API(Skottie*)
Skottie_Construct(char* path) {
fml::RefPtr<Skottie> skottie = Skottie::Create(path);
if(skottie.get() == nullptr){
return nullptr;
}
Skottie_Dispose(Skottie* ptr) { ptr->Release(); }
Skottie_Dispose(Skottie* ptr) {
if(ptr == nullptr){
return;
}
ptr->Release();
}
if(ptr == nullptr){
return;
}
Skottie_Duration(Skottie* ptr) { return ptr->duration(); }
Skottie_Duration(Skottie* ptr) {
if(ptr == nullptr){
return 0;
}
return ptr->duration(); }
} // namespace uiwidgets

3
engine/src/lib/ui/window/pointer_data.h


namespace uiwidgets {
static constexpr int kPointerDataFieldCount = 28;
static constexpr int kPointerDataFieldCount = 29;
static constexpr int kBytesPerField = sizeof(int64_t);
enum PointerButtonMouse : int64_t {

double physical_delta_x;
double physical_delta_y;
int64_t buttons;
int64_t modifier;
int64_t obscured;
int64_t synthesized;
double pressure;

1
engine/src/lib/ui/window/pointer_data_packet_converter.cc


PointerData synthesized_hover_event = pointer_data;
synthesized_hover_event.change = PointerData::Change::kHover;
synthesized_hover_event.synthesized = 1;
synthesized_hover_event.buttons = state.previous_buttons;
UpdateDeltaAndState(synthesized_hover_event, state);
converted_pointers.push_back(synthesized_hover_event);

1
engine/src/lib/ui/window/window.cc


// TODO: ComputePlatformResolvedLocale
UIWIDGETS_API(void) Window_computePlatformResolvedLocale(Window* ptr, Scene* scene) {
ptr->client()->Render(scene);
}
} // namespace

1
engine/src/shell/platform/embedder/embedder.cc


// For backwards compatibility with embedders written before the device kind
// and buttons were exposed, if the device kind is not set treat it as a
// mouse, with a synthesized primary button state based on the phase.
pointer_data.modifier = current->modifier;
if (device_kind == 0) {
pointer_data.kind = PointerData::DeviceKind::kMouse;
pointer_data.buttons =

1
engine/src/shell/platform/embedder/embedder.h


float scroll_delta_y;
UIWidgetsPointerDeviceKind device_kind;
int64_t buttons;
int64_t modifier;
} UIWidgetsPointerEvent;
struct _UIWidgetsPlatformMessageResponseHandle;

8
engine/src/shell/platform/unity/android/uiwidgets_panel.cc


return PointerData::DeviceKind::kTouch;
}
void UIWidgetsPanel::OnKeyDown(int keyCode, bool isKeyDown)
void UIWidgetsPanel::OnKeyDown(int keyCode, bool isKeyDown, int64_t modifier)
{
if (process_events_)
{

std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::high_resolution_clock::now().time_since_epoch())
.count();
event.modifier = modifier;
UIWidgetsEngineSendPointerEvent(engine_, &event, 1);
}

}
UIWIDGETS_API(void)
UIWidgetsPanel_onKey(UIWidgetsPanel *panel, int keyCode, bool isKeyDown)
{
panel->OnKeyDown(keyCode, isKeyDown);
UIWidgetsPanel_onKey(UIWidgetsPanel* panel, int keyCode, bool isKeyDown, int64_t modifier) {
panel->OnKeyDown(keyCode, isKeyDown, modifier);
}
UIWIDGETS_API(void)

2
engine/src/shell/platform/unity/android/uiwidgets_panel.h


void VSyncCallback(intptr_t baton);
void OnKeyDown(int keyCode, bool isKeyDown);
void OnKeyDown(int keyCode, bool isKeyDown, int64_t modifier);
void OnMouseMove(float x, float y, int button);

2
engine/src/shell/platform/unity/darwin/ios/uiwidgets_panel.h


void SetEventLocationFromCursorPosition(UIWidgetsPointerEvent* event_data);
void OnKeyDown(int keyCode, bool isKeyDown);
void OnKeyDown(int keyCode, bool isKeyDown, int64_t modifier);
void OnMouseMove(float x, float y, int button);

7
engine/src/shell/platform/unity/darwin/ios/uiwidgets_panel.mm


return PointerData::DeviceKind::kTouch;
}
void UIWidgetsPanel::OnKeyDown(int keyCode, bool isKeyDown) {
void UIWidgetsPanel::OnKeyDown(int keyCode, bool isKeyDown, int64_t modifier) {
if (process_events_) {
UIWidgetsPointerEvent event = {};
event.phase = isKeyDown ? UIWidgetsPointerPhase::kMouseDown : UIWidgetsPointerPhase::kMouseUp;

std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::high_resolution_clock::now().time_since_epoch())
.count();
event.modifier = modifier;
UIWidgetsEngineSendPointerEvent(engine_, &event, 1);
}

UIWIDGETS_API(void)
UIWidgetsPanel_onKey(UIWidgetsPanel* panel, int keyCode, bool isKeyDown) {
panel->OnKeyDown(keyCode, isKeyDown);
UIWidgetsPanel_onKey(UIWidgetsPanel* panel, int keyCode, bool isKeyDown, int64_t modifier) {
panel->OnKeyDown(keyCode, isKeyDown, modifier);
}
UIWIDGETS_API(void)

2
engine/src/shell/platform/unity/darwin/ios/uiwidgets_system.mm


unity_uiwidgets_->SetWakeUpCallback(nullptr);
unity_uiwidgets_ = nullptr;
UnitySurfaceManager::ReleaseResource();
unity_interfaces_ = nullptr;
}

24
engine/src/shell/platform/unity/darwin/ios/unity_surface_manager.h


#pragma once
#include <vector>
#include <OpenGLES/EAGL.h>
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>

#include "flutter/fml/macros.h"
namespace uiwidgets {
struct GLContextPair
{
EAGLContext *gl_context_;
EAGLContext *gl_resource_context_;
GLContextPair(EAGLContext* gl, EAGLContext* gl_resource)
{
gl_context_ = gl;
gl_resource_context_ = gl_resource;
}
};
//openGLES contexts
static EAGLContext *gl_context_;
static EAGLContext *gl_resource_context_;
//openGL contexts pool
static std::vector<GLContextPair> gl_context_pool_;
static void ReleaseResource();
void* CreateRenderTexture(size_t width, size_t height);

uint32_t GetFbo();
private:
static GLContextPair GetFreeOpenGLContext();
void RecycleOpenGLContext(EAGLContext* gl, EAGLContext* gl_resource);
EAGLContext *gl_context_;
EAGLContext *gl_resource_context_;
GLuint default_fbo_ = 0;
GLuint gl_tex_ = 0;
CVOpenGLESTextureCacheRef gl_tex_cache_ref_ = nullptr;

44
engine/src/shell/platform/unity/darwin/ios/unity_surface_manager.mm


namespace uiwidgets {
EAGLContext* UnitySurfaceManager::gl_context_ = nullptr;
EAGLContext* UnitySurfaceManager::gl_resource_context_ = nullptr;
std::vector<GLContextPair> UnitySurfaceManager::gl_context_pool_;
GLContextPair UnitySurfaceManager::GetFreeOpenGLContext()
{
if (gl_context_pool_.size() == 0)
{
EAGLContext* gl = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
EAGLContext* gl_resource = [[EAGLContext alloc] initWithAPI:[gl API] sharegroup: [gl sharegroup]];
return GLContextPair(gl, gl_resource);
}
auto context_pair = gl_context_pool_.back();
gl_context_pool_.pop_back();
return context_pair;
}
void UnitySurfaceManager::RecycleOpenGLContext(EAGLContext* gl, EAGLContext* gl_resource)
{
MakeCurrentContext();
ClearCurrentContext();
MakeCurrentResourceContext();
ClearCurrentContext();
gl_context_pool_.push_back(GLContextPair(gl, gl_resource));
}
void UnitySurfaceManager::ReleaseResource()
{
while(gl_context_pool_.size() > 0)
{
gl_context_pool_.pop_back();
}
}
UnitySurfaceManager::UnitySurfaceManager(IUnityInterfaces* unity_interfaces)
{

//create opengl context
if (gl_context_ == nullptr && gl_resource_context_ == nullptr) {
gl_context_ = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
gl_resource_context_ = [[EAGLContext alloc] initWithAPI:[gl_context_ API] sharegroup: [gl_context_ sharegroup]];
auto new_context = GetFreeOpenGLContext();
gl_context_ = new_context.gl_context_;
gl_resource_context_ = new_context.gl_resource_context_;
}
FML_DCHECK(gl_context_ != nullptr && gl_resource_context_ != nullptr);

void UnitySurfaceManager::ReleaseNativeRenderContext()
{
FML_DCHECK(gl_resource_context_);
RecycleOpenGLContext(gl_context_, gl_resource_context_);
gl_context_ = nullptr;
gl_resource_context_ = nullptr;
[EAGLContext setCurrentContext:nil];

2
engine/src/shell/platform/unity/darwin/macos/uiwidgets_panel.h


void SetEventLocationFromCursorPosition(UIWidgetsPointerEvent* event_data);
void OnKeyDown(int keyCode, bool isKeyDown);
void OnKeyDown(int keyCode, bool isKeyDown, int64_t modifier);
void OnMouseMove(float x, float y);

8
engine/src/shell/platform/unity/darwin/macos/uiwidgets_panel.mm


}
}
void UIWidgetsPanel::OnKeyDown(int keyCode, bool isKeyDown) {
void UIWidgetsPanel::OnKeyDown(int keyCode, bool isKeyDown, int64_t modifier) {
if (process_events_) {
UIWidgetsPointerEvent event = {};
event.phase = isKeyDown ? UIWidgetsPointerPhase::kMouseDown : UIWidgetsPointerPhase::kMouseUp;

std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::high_resolution_clock::now().time_since_epoch())
.count();
event.modifier = modifier;
UIWidgetsEngineSendPointerEvent(engine_, &event, 1);
}

UIWIDGETS_API(void)
UIWidgetsPanel_onKey(UIWidgetsPanel* panel, int keyCode, bool isKeyDown) {
panel->OnKeyDown(keyCode, isKeyDown);
UIWidgetsPanel_onKey(UIWidgetsPanel* panel, int keyCode, bool isKeyDown, int64_t modifier) {
panel->OnKeyDown(keyCode, isKeyDown, modifier);
}
UIWIDGETS_API(void)

2
engine/src/shell/platform/unity/darwin/macos/uiwidgets_system.mm


unity_uiwidgets_->SetWakeUpCallback(nullptr);
unity_uiwidgets_ = nullptr;
UnitySurfaceManager::ReleaseResource();
unity_interfaces_ = nullptr;
}

24
engine/src/shell/platform/unity/darwin/macos/unity_surface_manager.h


#include <AppKit/AppKit.h>
#include <Metal/Metal.h>
#include <CoreVideo/CoreVideo.h>
#include <vector>
struct GLContextPair
{
NSOpenGLContext *gl_context_;
NSOpenGLContext *gl_resource_context_;
GLContextPair(NSOpenGLContext* gl, NSOpenGLContext* gl_resource)
{
gl_context_ = gl;
gl_resource_context_ = gl_resource;
}
};
//openGL contexts
static NSOpenGLContext *gl_context_;
static NSOpenGLContext *gl_resource_context_;
//openGL contexts pool
static std::vector<GLContextPair> gl_context_pool_;
static void ReleaseResource();
void* CreateRenderTexture(size_t width, size_t height);

uint32_t GetFbo();
private:
static GLContextPair GetFreeOpenGLContext();
void RecycleOpenGLContext(NSOpenGLContext* gl, NSOpenGLContext* gl_resource);
NSOpenGLContext *gl_context_;
NSOpenGLContext *gl_resource_context_;
GLuint default_fbo_ = 0;
GLuint gl_tex_ = 0;
CVOpenGLTextureCacheRef gl_tex_cache_ref_ = nullptr;

84
engine/src/shell/platform/unity/darwin/macos/unity_surface_manager.mm


namespace uiwidgets {
NSOpenGLContext* UnitySurfaceManager::gl_context_ = nullptr;
NSOpenGLContext* UnitySurfaceManager::gl_resource_context_ = nullptr;
std::vector<GLContextPair> UnitySurfaceManager::gl_context_pool_;
GLContextPair UnitySurfaceManager::GetFreeOpenGLContext()
{
if (gl_context_pool_.size() == 0)
{
NSOpenGLPixelFormatAttribute attrs[] =
{
NSOpenGLPFAAccelerated,
0
};
NSOpenGLPixelFormat *pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs];
NSOpenGLContext* gl_resource;
NSOpenGLContext* gl;
while(gl_resource == nil) {
gl = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil];
gl_resource = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:gl];
if (gl_resource == nil) {
CGLReleaseContext([gl CGLContextObj]);
gl = nullptr;
}
}
return GLContextPair(gl, gl_resource);
}
auto context_pair = gl_context_pool_.back();
gl_context_pool_.pop_back();
return context_pair;
}
void UnitySurfaceManager::RecycleOpenGLContext(NSOpenGLContext* gl, NSOpenGLContext* gl_resource)
{
MakeCurrentContext();
ClearCurrentContext();
MakeCurrentResourceContext();
ClearCurrentContext();
gl_context_pool_.push_back(GLContextPair(gl, gl_resource));
}
void UnitySurfaceManager::ReleaseResource()
{
while(gl_context_pool_.size() > 0)
{
auto context_pair = gl_context_pool_.back();
CGLReleaseContext([context_pair.gl_context_ CGLContextObj]);
CGLReleaseContext([context_pair.gl_resource_context_ CGLContextObj]);
gl_context_pool_.pop_back();
}
}
UnitySurfaceManager::UnitySurfaceManager(IUnityInterfaces* unity_interfaces)
{

//create opengl context
if (gl_context_ == nullptr && gl_resource_context_ == nullptr) {
NSOpenGLPixelFormatAttribute attrs[] =
{
NSOpenGLPFAAccelerated,
0
};
NSOpenGLPixelFormat *pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs];
//gl_context_ may be created unproperly, we can check this using the relevant gl_resource_context_
//loop until the created gl_context_ is ok, otherwise the program will crash anyway
while(gl_resource_context_ == nil) {
gl_context_ = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil];
gl_resource_context_ = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:gl_context_];
if (gl_resource_context_ == nil) {
CGLReleaseContext(gl_context_.CGLContextObj);
gl_context_ = nullptr;
}
}
auto new_context = GetFreeOpenGLContext();
gl_context_ = new_context.gl_context_;
gl_resource_context_ = new_context.gl_resource_context_;
}
FML_DCHECK(gl_context_ != nullptr && gl_resource_context_ != nullptr);

void UnitySurfaceManager::ReleaseNativeRenderContext()
{
FML_DCHECK(gl_resource_context_);
FML_DCHECK(gl_context_);
FML_DCHECK(gl_context_);
RecycleOpenGLContext(gl_context_, gl_resource_context_);
gl_context_ = nullptr;
gl_resource_context_ = nullptr;
FML_DCHECK(metal_device_ != nullptr);
metal_device_ = nullptr;

7
engine/src/shell/platform/unity/windows/uiwidgets_panel.cc


}
}
void UIWidgetsPanel::OnKeyDown(int keyCode, bool isKeyDown) {
void UIWidgetsPanel::OnKeyDown(int keyCode, bool isKeyDown, int64_t modifier) {
if (process_events_) {
UIWidgetsPointerEvent event = {};
event.phase = isKeyDown ? UIWidgetsPointerPhase::kMouseDown : UIWidgetsPointerPhase::kMouseUp;

std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::high_resolution_clock::now().time_since_epoch())
.count();
event.modifier = modifier;
UIWidgetsEngineSendPointerEvent(engine_, &event, 1);
}

UIWIDGETS_API(void)
UIWidgetsPanel_onKey(UIWidgetsPanel* panel, int keyCode, bool isKeyDown) {
panel->OnKeyDown(keyCode, isKeyDown);
UIWidgetsPanel_onKey(UIWidgetsPanel* panel, int keyCode, bool isKeyDown, int64_t modifier) {
panel->OnKeyDown(keyCode, isKeyDown, modifier);
}
UIWIDGETS_API(void)

2
engine/src/shell/platform/unity/windows/uiwidgets_panel.h


void SetEventLocationFromCursorPosition(UIWidgetsPointerEvent* event_data);
void OnKeyDown(int keyCode, bool isKeyDown);
void OnKeyDown(int keyCode, bool isKeyDown, int64_t modifier);
void OnMouseMove(float x, float y);

8
Samples/UIWidgetsSamples_2019_4/Assets/Editor/tests.meta


fileFormatVersion: 2
guid: efe638edf4624274957047c61091ef15
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

3
Samples/UIWidgetsSamples_2019_4/Assets/RecastablePanelSample.meta


fileFormatVersion: 2
guid: 78f35cf41bb14f94b6607619fd61814b
timeCreated: 1627370684

808
Samples/UIWidgetsSamples_2019_4/Assets/Scene/RecastableTest.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.44657874, g: 0.49641275, b: 0.5748172, 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!28 &406348655
Texture2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 2
m_Width: 0
m_Height: 0
m_CompleteImageSize: 0
m_TextureFormat: 0
m_MipCount: 1
m_IsReadable: 1
m_IgnoreMasterTextureLimit: 0
m_IsPreProcessed: 0
m_StreamingMipmaps: 0
m_StreamingMipmapsPriority: 0
m_AlphaIsTransparency: 0
m_ImageCount: 0
m_TextureDimension: 2
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 0
m_WrapV: 0
m_WrapW: 0
m_LightmapFormat: 0
m_ColorSpace: 0
image data: 0
_typelessdata:
m_StreamData:
offset: 0
size: 0
path:
--- !u!1 &764046566
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 764046568}
- component: {fileID: 764046567}
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 &764046567
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 764046566}
m_Enabled: 1
serializedVersion: 10
m_Type: 1
m_Shape: 0
m_Color: {r: 1, g: 1, b: 1, 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 &764046568
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 764046566}
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 &847097468
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 847097469}
- component: {fileID: 847097471}
- component: {fileID: 847097470}
m_Layer: 5
m_Name: RawImage
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &847097469
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 847097468}
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: 2122288190}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &847097470
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 847097468}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 815fa4781092478880d764710562f43e, 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: 406348655}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
hardwareAntiAliasing: 0
fonts: []
--- !u!222 &847097471
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 847097468}
m_CullTransparentMesh: 0
--- !u!1 &1242484622
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1242484626}
- component: {fileID: 1242484625}
- component: {fileID: 1242484624}
- component: {fileID: 1242484623}
- component: {fileID: 1242484627}
- component: {fileID: 1242484628}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!65 &1242484623
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1242484622}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &1242484624
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1242484622}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &1242484625
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1242484622}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1242484626
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1242484622}
m_LocalRotation: {x: -0.10465724, y: -0.09479626, z: -0.010022044, w: 0.9899293}
m_LocalPosition: {x: 0, y: 1.2, z: 10.99}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: -12.07, y: -10.94, z: 0}
--- !u!54 &1242484627
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1242484622}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!114 &1242484628
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1242484622}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2f49ce3509d94f0ab48ad05b702f9008, type: 3}
m_Name:
m_EditorClassIdentifier:
isHolding: 0
--- !u!1 &1290968256
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1290968260}
- component: {fileID: 1290968259}
- component: {fileID: 1290968258}
- component: {fileID: 1290968257}
m_Layer: 0
m_Name: Cube (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!65 &1290968257
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1290968256}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &1290968258
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1290968256}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &1290968259
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1290968256}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1290968260
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1290968256}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -0.84, z: 1.9}
m_LocalScale: {x: 100, y: 1, z: 22}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1548023132
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1548023135}
- component: {fileID: 1548023134}
- component: {fileID: 1548023133}
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 &1548023133
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1548023132}
m_Enabled: 1
--- !u!20 &1548023134
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1548023132}
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: 1
orthographic size: 5.6
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 &1548023135
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1548023132}
m_LocalRotation: {x: 0.19187035, y: 0.022864925, z: -0.004471415, w: 0.9811437}
m_LocalPosition: {x: 0, y: 1, z: 0.32}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 22.13, y: 2.67, z: 0}
--- !u!1 &1900497009
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1900497012}
- component: {fileID: 1900497011}
- component: {fileID: 1900497010}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1900497010
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1900497009}
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 &1900497011
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1900497009}
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 &1900497012
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1900497009}
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 &2122288186
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2122288190}
- component: {fileID: 2122288189}
- component: {fileID: 2122288188}
- component: {fileID: 2122288187}
- component: {fileID: 2122288191}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &2122288187
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2122288186}
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 &2122288188
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2122288186}
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 &2122288189
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2122288186}
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 &2122288190
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2122288186}
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: 847097469}
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!225 &2122288191
CanvasGroup:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2122288186}
m_Enabled: 1
m_Alpha: 1
m_Interactable: 1
m_BlocksRaycasts: 1
m_IgnoreParentGroups: 0

7
Samples/UIWidgetsSamples_2019_4/Assets/Scene/RecastableTest.unity.meta


fileFormatVersion: 2
guid: b123676e269e44b5c9d8825017d24473
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

581
Samples/UIWidgetsSamples_2019_4/Assets/Scene/StreamTest.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.44657874, g: 0.49641275, b: 0.5748172, 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!28 &601203222
Texture2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 3
m_Width: 0
m_Height: 0
m_CompleteImageSize: 0
m_TextureFormat: 0
m_MipCount: 1
m_IsReadable: 1
m_IgnoreMasterTextureLimit: 0
m_IsPreProcessed: 0
m_StreamingMipmaps: 0
m_StreamingMipmapsPriority: 0
m_AlphaIsTransparency: 0
m_ImageCount: 0
m_TextureDimension: 2
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 1
m_MipBias: 0
m_WrapU: 0
m_WrapV: 0
m_WrapW: 0
m_LightmapFormat: 0
m_ColorSpace: 0
image data: 0
_typelessdata:
m_StreamData:
offset: 0
size: 0
path:
m_OriginalWidth: 0
m_OriginalHeight: 0
m_OriginalAssetGuid: 00000000000000000000000000000000
--- !u!1 &764046566
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 764046568}
- component: {fileID: 764046567}
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 &764046567
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 764046566}
m_Enabled: 1
serializedVersion: 10
m_Type: 1
m_Shape: 0
m_Color: {r: 1, g: 1, b: 1, 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 &764046568
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 764046566}
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 &847097468
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 847097469}
- component: {fileID: 847097471}
- component: {fileID: 847097470}
m_Layer: 5
m_Name: RawImage
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &847097469
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 847097468}
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: 2122288190}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &847097470
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 847097468}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a20abb9224fb842018ca8155e9fec694, 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: 601203222}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
hardwareAntiAliasing: 0
fonts: []
--- !u!222 &847097471
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 847097468}
m_CullTransparentMesh: 0
--- !u!1 &1548023132
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1548023135}
- component: {fileID: 1548023134}
- component: {fileID: 1548023133}
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 &1548023133
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1548023132}
m_Enabled: 1
--- !u!20 &1548023134
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1548023132}
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: 1
orthographic size: 5.6
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 &1548023135
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1548023132}
m_LocalRotation: {x: 0, y: 0.7071068, z: -0.7071068, w: 0}
m_LocalPosition: {x: 0, y: 1, z: 0.32}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 90, y: 180, z: 0}
--- !u!1 &1900497009
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1900497012}
- component: {fileID: 1900497011}
- component: {fileID: 1900497010}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1900497010
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1900497009}
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 &1900497011
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1900497009}
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 &1900497012
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1900497009}
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 &2122288186
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2122288190}
- component: {fileID: 2122288189}
- component: {fileID: 2122288188}
- component: {fileID: 2122288187}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &2122288187
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2122288186}
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 &2122288188
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2122288186}
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 &2122288189
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2122288186}
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 &2122288190
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2122288186}
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: 847097469}
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}

7
Samples/UIWidgetsSamples_2019_4/Assets/Scene/StreamTest.unity.meta


fileFormatVersion: 2
guid: edfd9854d0f804c30891682316f753ac
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

157
Samples/UIWidgetsSamples_2019_4/Assets/Script/StreamTest.cs


using System;
using System.Collections;
using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.widgets;
using ui_ = Unity.UIWidgets.widgets.ui_;
using Unity.UIWidgets.async;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using UnityEngine.Networking;
using Color = Unity.UIWidgets.ui.Color;
using Image = Unity.UIWidgets.widgets.Image;
using Timer = Unity.UIWidgets.async.Timer;
namespace UIWidgetsSample
{
public class NumberCreator
{
public NumberCreator()
{
Timer.periodic(TimeSpan.FromSeconds(1), t =>
{
_controller.sink.add(_count);
_count++;
return default;
});
}
private int _count = 1;
private readonly StreamController<int> _controller = StreamController<int>.create();
public Stream<int> stream
{
get => _controller.stream;
}
}
public class StreamTest : UIWidgetsPanel
{
protected void OnEnable()
{
base.OnEnable();
}
protected override void main()
{
ui_.runApp(new MyApp());
}
class MyApp : StatelessWidget
{
public override Widget build(BuildContext context)
{
return new WidgetsApp(
home: new ExampleApp(),
color: Color.white,
pageRouteBuilder: (settings, builder) =>
new PageRouteBuilder(
settings: settings,
pageBuilder: (Buildcontext, animation, secondaryAnimation) => builder(context)
)
);
}
}
class ExampleApp : StatefulWidget
{
public ExampleApp(Key key = null) : base(key)
{
}
public override State createState()
{
return new ExampleState();
}
}
class ExampleState : State<ExampleApp>
{
readonly Stream<int> myStream = new NumberCreator().stream;
IEnumerator _loadCoroutine(string key, Completer completer, Isolate isolate) {
var url = new Uri(key);
using (var www = UnityWebRequest.Get(url)) {
yield return www.SendWebRequest();
using (Isolate.getScope(isolate)) {
if (www.isNetworkError || www.isHttpError) {
completer.completeError(new Exception($"Failed to load from url \"{url}\": {www.error}"));
yield break;
}
var data = www.downloadHandler.data;
completer.complete(data);
}
}
}
public override Widget build(BuildContext context)
{
Future<byte[]> f = null;
var completer = Completer.create();
var isolate = Isolate.current;
var panel = UIWidgetsPanelWrapper.current.window;
if (panel.isActive()) {
panel.startCoroutine(_loadCoroutine("https://buljan.rcsdk8.org/sites/main/files/main-images/camera_lense_0.jpeg", completer, isolate));
f = completer.future.to<byte[]>().then_<byte[]>(data => {
if (data != null && data.Length > 0) {
return data;
}
throw new Exception("not loaded");
});
}
var futureBuilder = new FutureBuilder<byte[]>(
future: f,
builder: (ctx, snapshot) =>
{
int width = 200;
int height = 200;
Color color = Colors.blue;
if (snapshot.connectionState == ConnectionState.done)
{
return new Container(alignment: Alignment.center, width: width, height:height, color: color, child: Image.memory(snapshot.data) );
} else if (snapshot.connectionState == ConnectionState.waiting)
{
return new Container(alignment: Alignment.center, width: width, height:height, color: color, child: new Text("waiting") );
}
else
{
return new Container(alignment: Alignment.center, width: width, height:height, color: color, child: new Text("else") );
}
}
);
var streamBuilder = new StreamBuilder<int>(
stream: myStream,
initialData: 1,
builder: (ctx, snapshot) =>
{
var data = snapshot.data;
return new Container(child: new Text($"stream data: {data}"));
}
);
return new Container(
color: Colors.blueGrey,
child: new Column(
children: new List<Widget>
{
streamBuilder,
futureBuilder
}
)
);
}
}
}
}

58
Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/StreamBuilderSample.cs


using System;
using Unity.UIWidgets.async;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.widgets;
namespace UIWidgetsSample
{
public class StreamBuilderSample : UIWidgetsPanel
{
protected override void main()
{
ui_.runApp(
new MyStreamBuilderWidget()
);
}
}
class MyStreamBuilderWidget : StatelessWidget
{
private Stream<int> counter()
{
return Stream<int>.periodic(new TimeSpan(0, 0, 0, 1), i =>
{
return i * 3;
}).take(5);
}
public override Widget build(BuildContext context)
{
return new WidgetsApp(
title: "Text Fields",
home: new StreamBuilder<int>(
stream: counter(),
builder: (BuildContext sub_context, AsyncSnapshot<int> snapshot) =>
{
if (snapshot.hasError)
return new Text($"Error: {snapshot.error}");
switch (snapshot.connectionState) {
case ConnectionState.none:
return new Text("没有Stream");
case ConnectionState.waiting:
return new Text("等待数据...");
case ConnectionState.active:
return new Text($"active: {snapshot.data}");
case ConnectionState.done:
return new Text("Stream已关闭");
}
return null; // unreachable
}
),
pageRouteBuilder: (settings, builder) =>
new PageRouteBuilder(
settings: settings,
pageBuilder: (Buildcontext, animation, secondaryAnimation) => builder(context)
)
);
}
}
}

3
Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/StreamBuilderSample.cs.meta


fileFormatVersion: 2
guid: 97f298138594499f8355a91dab4721fc
timeCreated: 1629451124

8
com.unity.uiwidgets/Runtime/Plugins/Android/arm64.meta


fileFormatVersion: 2
guid: 50c2cf1b23d954ecfb07bb4ccbd9fd74
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存