浏览代码

rename & clean

/siyaoH-1.17-PlatformMessage
siyao 4 年前
当前提交
957be42a
共有 177 个文件被更改,包括 1138 次插入854 次删除
  1. 2
      Samples/UIWidgetsSamples_2019_4/Assets/CountDemo.cs
  2. 2
      Samples/UIWidgetsSamples_2019_4/Assets/Editor/EditorWindowSample/GalleryMain.cs
  3. 2
      Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/BottomAppBarSample.cs
  4. 2
      Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/DividerAndButton.cs
  5. 2
      Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/HoverSample.cs
  6. 2
      Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/MaterialAppBarSample.cs
  7. 2
      Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/MaterialButtonSample.cs
  8. 2
      Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/MaterialInkWellSample.cs
  9. 2
      Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/MaterialNavigationBarSample.cs
  10. 2
      Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/MaterialSliderSample.cs
  11. 2
      Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/MaterialTabBarSample.cs
  12. 2
      Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/MaterialThemeSample.cs
  13. 4
      Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/NavigatorPopSample.cs
  14. 2
      Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/NetWorkImageSample.cs
  15. 2
      Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/ReorderableListSample.cs
  16. 2
      Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/TableSample.cs
  17. 2
      Samples/UIWidgetsSamples_2019_4/Assets/Script/CountTest.cs
  18. 2
      Samples/UIWidgetsSamples_2019_4/Assets/Script/ImageTest.cs
  19. 2
      Samples/UIWidgetsSamples_2019_4/Assets/Script/TextFieldTest.cs
  20. 2
      Samples/UIWidgetsSamples_2019_4/Assets/Script/TextTest.cs
  21. 2
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/GalleryMain.cs
  22. 2
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/cupertino/cupertino_refresh_demo.cs
  23. 2
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/cupertino/cupertino_segmented_control_demo.cs
  24. 2
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/date_and_time_picker_demo.cs
  25. 2
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/leave_behind_demo.cs
  26. 2
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/overscroll_demo.cs
  27. 2
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/text_form_field_demo.cs
  28. 2
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/shrine/expanding_bottom_sheet.cs
  29. 2
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/shrine/model/scoped_model.cs
  30. 2
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/app.cs
  31. 2
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/demo.cs
  32. 2
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/home.cs
  33. 2
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/updater.cs
  34. 2
      Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/CustomPaintSample.cs
  35. 2
      Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/DragDropSample.cs
  36. 2
      Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/ExpansionPanelSample.cs
  37. 2
      Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/HttpRequestSample.cs
  38. 2
      Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/ImageFormatSample.cs
  39. 2
      Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/LongPressSample.cs
  40. 2
      Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/NavigationSample.cs
  41. 2
      Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/PageViewSample.cs
  42. 2
      Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/ScrollbarSample.cs
  43. 2
      Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/UIWidgetsSamplePanel.cs
  44. 4
      com.unity.uiwidgets/Editor/UIWidgetsEditorPanel.cs
  45. 2
      com.unity.uiwidgets/Editor/UIWidgetsPanelEditor.cs
  46. 267
      com.unity.uiwidgets/Runtime/async/timer.cs
  47. 2
      com.unity.uiwidgets/Runtime/cupertino/localization.cs
  48. 2
      com.unity.uiwidgets/Runtime/cupertino/refresh.cs
  49. 2
      com.unity.uiwidgets/Runtime/cupertino/route.cs
  50. 2
      com.unity.uiwidgets/Runtime/cupertino/scrollbar.cs
  51. 103
      com.unity.uiwidgets/Runtime/engine/DisplayMetrics.cs
  52. 2
      com.unity.uiwidgets/Runtime/engine/UIWidgetsMessageManager.cs
  53. 605
      com.unity.uiwidgets/Runtime/engine/UIWidgetsPanel.cs
  54. 4
      com.unity.uiwidgets/Runtime/engine/UIWidgetsPanel.cs.meta
  55. 2
      com.unity.uiwidgets/Runtime/foundation/basic_types.cs
  56. 2
      com.unity.uiwidgets/Runtime/foundation/binding.cs
  57. 2
      com.unity.uiwidgets/Runtime/foundation/debug.cs
  58. 2
      com.unity.uiwidgets/Runtime/foundation/isolates.cs
  59. 2
      com.unity.uiwidgets/Runtime/foundation/synchronous_future.cs
  60. 2
      com.unity.uiwidgets/Runtime/gestures/binding.cs
  61. 2
      com.unity.uiwidgets/Runtime/gestures/multidrag.cs
  62. 2
      com.unity.uiwidgets/Runtime/gestures/multitap.cs
  63. 2
      com.unity.uiwidgets/Runtime/gestures/recognizer.cs
  64. 2
      com.unity.uiwidgets/Runtime/material/about.cs
  65. 2
      com.unity.uiwidgets/Runtime/material/bottom_sheet.cs
  66. 2
      com.unity.uiwidgets/Runtime/material/dialog.cs
  67. 2
      com.unity.uiwidgets/Runtime/material/dropdown.cs
  68. 2
      com.unity.uiwidgets/Runtime/material/feedback.cs
  69. 2
      com.unity.uiwidgets/Runtime/material/material_localizations.cs
  70. 2
      com.unity.uiwidgets/Runtime/material/pickers/date_picker_dialog.cs
  71. 2
      com.unity.uiwidgets/Runtime/material/popup_menu.cs
  72. 2
      com.unity.uiwidgets/Runtime/material/range_slider.cs
  73. 2
      com.unity.uiwidgets/Runtime/material/refresh_indicator.cs
  74. 2
      com.unity.uiwidgets/Runtime/material/scaffold.cs
  75. 2
      com.unity.uiwidgets/Runtime/material/scrollbar.cs
  76. 2
      com.unity.uiwidgets/Runtime/material/search.cs
  77. 2
      com.unity.uiwidgets/Runtime/material/selectable_text.cs
  78. 2
      com.unity.uiwidgets/Runtime/material/slider.cs
  79. 2
      com.unity.uiwidgets/Runtime/material/tabs.cs
  80. 2
      com.unity.uiwidgets/Runtime/material/time_picker.cs
  81. 2
      com.unity.uiwidgets/Runtime/material/tooltip.cs
  82. 2
      com.unity.uiwidgets/Runtime/painting/binding.cs
  83. 2
      com.unity.uiwidgets/Runtime/painting/image_decoder.cs
  84. 4
      com.unity.uiwidgets/Runtime/painting/image_provider.cs
  85. 2
      com.unity.uiwidgets/Runtime/painting/image_resolution.cs
  86. 2
      com.unity.uiwidgets/Runtime/painting/image_stream.cs
  87. 2
      com.unity.uiwidgets/Runtime/painting/shader_warmup.cs
  88. 2
      com.unity.uiwidgets/Runtime/rendering/editable.cs
  89. 2
      com.unity.uiwidgets/Runtime/rendering/layer.cs
  90. 2
      com.unity.uiwidgets/Runtime/rendering/proxy_box.cs
  91. 2
      com.unity.uiwidgets/Runtime/rendering/viewport_offset.cs
  92. 655
      com.unity.uiwidgets/Runtime/scheduler/binding.cs
  93. 4
      com.unity.uiwidgets/Runtime/scheduler/binding.cs.meta
  94. 158
      com.unity.uiwidgets/Runtime/scheduler/ticker.cs
  95. 4
      com.unity.uiwidgets/Runtime/scheduler/ticker.cs.meta
  96. 4
      com.unity.uiwidgets/Runtime/services/asset_bundle.cs
  97. 2
      com.unity.uiwidgets/Runtime/services/binary_messenger.cs
  98. 2
      com.unity.uiwidgets/Runtime/services/binding.cs
  99. 2
      com.unity.uiwidgets/Runtime/services/clipboard.cs
  100. 2
      com.unity.uiwidgets/Runtime/services/keyboard.cs

2
Samples/UIWidgetsSamples_2019_4/Assets/CountDemo.cs


using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using Text = Unity.UIWidgets.widgets.Text;

2
Samples/UIWidgetsSamples_2019_4/Assets/Editor/EditorWindowSample/GalleryMain.cs


using System.Collections.Generic;
using UIWidgetsGallery.gallery;
using Unity.UIWidgets.Editor;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.widgets;
using UnityEditor;
using UnityEngine;

2
Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/BottomAppBarSample.cs


using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.rendering;

2
Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/DividerAndButton.cs


using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;

2
Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/HoverSample.cs


using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.widgets;

2
Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/MaterialAppBarSample.cs


using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;

2
Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/MaterialButtonSample.cs


using System.Collections.Generic;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;

2
Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/MaterialInkWellSample.cs


using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;

2
Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/MaterialNavigationBarSample.cs


using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;

2
Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/MaterialSliderSample.cs


using System.Collections.Generic;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;

2
Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/MaterialTabBarSample.cs


using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;

2
Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/MaterialThemeSample.cs


using uiwidgets;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;

4
Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/NavigatorPopSample.cs


using System.Collections.Generic;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;

2
Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/NetWorkImageSample.cs


using System.Collections;
using System.Collections.Generic;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.widgets;

2
Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/ReorderableListSample.cs


using System.Collections.Generic;
using System.Linq;
using uiwidgets;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;

2
Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/TableSample.cs


using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;

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


using System.Collections.Generic;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;

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


using System.Collections.Generic;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;

2
Samples/UIWidgetsSamples_2019_4/Assets/Script/TextFieldTest.cs


using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.widgets;
using ui_ = Unity.UIWidgets.widgets.ui_;
using Unity.UIWidgets.cupertino;

2
Samples/UIWidgetsSamples_2019_4/Assets/Script/TextTest.cs


using System.Collections.Generic;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
//using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;

2
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/GalleryMain.cs


using System.Collections.Generic;
using UIWidgetsGallery.gallery;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.widgets;
namespace UIWidgetsGallery

2
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/cupertino/cupertino_refresh_demo.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;

2
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/cupertino/cupertino_segmented_control_demo.cs


using System;
using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;

2
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/date_and_time_picker_demo.cs


using System.Linq;
using uiwidgets;
using UIWidgetsGallery.gallery;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;

2
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/leave_behind_demo.cs


using System.Linq;
using uiwidgets;
using UIWidgetsGallery.gallery;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;

2
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/overscroll_demo.cs


using System;
using System.Collections.Generic;
using UIWidgetsGallery.gallery;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.widgets;

2
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/text_form_field_demo.cs


using uiwidgets;
using UIWidgets.Runtime.material;
using UIWidgetsGallery.gallery;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.material;

2
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/shrine/expanding_bottom_sheet.cs


using System.Xml.Serialization;
using UIWidgetsGallery.demo.shrine.model;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;

2
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/shrine/model/scoped_model.cs


using System;
using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;

2
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/app.cs


using System.Collections.Generic;
using uiwidgets;
using UIWidgetsGallery.demo.shrine.model;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;

2
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/demo.cs


using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;

2
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/home.cs


using System.Linq;
using uiwidgets;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.material;

2
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/updater.cs


using System;
using System.Collections.Generic;
using System.Diagnostics;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;

2
Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/CustomPaintSample.cs


using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;

2
Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/DragDropSample.cs


using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.ui;

2
Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/ExpansionPanelSample.cs


using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.rendering;

2
Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/HttpRequestSample.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.rendering;

2
Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/ImageFormatSample.cs


using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;

2
Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/LongPressSample.cs


using uiwidgets;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.widgets;
using UnityEngine;
using Color = Unity.UIWidgets.ui.Color;

2
Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/NavigationSample.cs


using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.material;

2
Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/PageViewSample.cs


using System.Collections.Generic;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using ui_ = Unity.UIWidgets.widgets.ui_;

2
Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/ScrollbarSample.cs


using System.Collections.Generic;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;

2
Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/UIWidgetsSamplePanel.cs


using Unity.UIWidgets.animation;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.widgets;
namespace UIWidgetsSample {

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


using System.Collections;
using System.Collections.Generic;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Font = Unity.UIWidgets.engine2.Font;
using Font = Unity.UIWidgets.engine.Font;
using Rect = UnityEngine.Rect;
namespace Unity.UIWidgets.Editor {

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


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

267
com.unity.uiwidgets/Runtime/async/timer.cs


/*
using System.Collections.Generic;
using Unity.UIWidgets.foundation;
using System.Runtime.InteropServices;
using AOT;
using Unity.UIWidgets.ui;
#if UNITY_EDITOR
using UnityEditor;
#endif
public abstract void cancel();
public void Dispose() {
cancel();
}
public static float timeSinceStartup {
get {
#if UNITY_EDITOR
return (float) EditorApplication.timeSinceStartup;
#else
return Time.realtimeSinceStartup;
#endif
public static Timer create(TimeSpan duration, ZoneCallback callback) {
if (Zone.current == Zone.root) {
return Zone.current.createTimer(duration, callback);
}
public static TimeSpan timespanSinceStartup {
get { return TimeSpan.FromSeconds(timeSinceStartup); }
return Zone.current
.createTimer(duration, Zone.current.bindCallbackGuarded(callback));
static readonly object _syncObj = new object();
static LinkedList<Action> _callbacks = new LinkedList<Action>();
public static void runInMainFromFinalizer(Action callback) {
lock (_syncObj) {
_callbacks.AddLast(callback);
}
public static Timer create(TimeSpan duration, Action callback) {
return create(duration, () => {
callback.Invoke();
return null;
});
internal static void update() {
LinkedList<Action> callbacks;
lock (_syncObj) {
if (_callbacks.isEmpty()) {
return;
}
callbacks = _callbacks;
_callbacks = new LinkedList<Action>();
public static Timer periodic(TimeSpan duration, ZoneUnaryCallback callback) {
if (Zone.current == Zone.root) {
return Zone.current.createPeriodicTimer(duration, callback);
foreach (var callback in callbacks) {
try {
callback();
}
catch (Exception ex) {
D.logError("Error to execute runInMain callback: ", ex);
}
}
var boundCallback = Zone.current.bindUnaryCallbackGuarded(callback);
return Zone.current.createPeriodicTimer(duration, boundCallback);
}
public class TimerProvider {
readonly PriorityQueue<TimerImpl> _queue;
public TimerProvider() {
_queue = new PriorityQueue<TimerImpl>();
public static void run(ZoneCallback callback) {
create(TimeSpan.Zero, callback);
public Timer runInMain(Action callback) {
var timer = new TimerImpl(callback);
public abstract void cancel();
lock (_queue) {
_queue.enqueue(timer);
}
return timer;
public void Dispose() {
cancel();
public Timer run(TimeSpan duration, Action callback) {
var timer = new TimerImpl(duration, callback);
public abstract long tick { get; }
public abstract bool isActive { get; }
lock (_queue) {
_queue.enqueue(timer);
}
internal static Timer _createTimer(TimeSpan duration, ZoneCallback callback) {
return _Timer._createTimer(_ => callback(), (int) duration.TotalMilliseconds, false);
}
return timer;
internal static Timer _createPeriodicTimer(
TimeSpan duration, ZoneUnaryCallback callback) {
return _Timer._createTimer(callback, (int) duration.TotalMilliseconds, true);
}
public Timer periodic(TimeSpan duration, Action callback) {
var timer = new TimerImpl(duration, callback, periodic: true);
class _Timer : Timer {
long _tick = 0;
lock (_queue) {
_queue.enqueue(timer);
}
ZoneUnaryCallback _callback;
long _wakeupTime;
readonly int _milliSeconds;
readonly bool _repeating;
return timer;
_Timer(ZoneUnaryCallback callback, long wakeupTime, int milliSeconds, bool repeating) {
_callback = callback;
_wakeupTime = wakeupTime;
_milliSeconds = milliSeconds;
_repeating = repeating;
static readonly List<TimerImpl> _timers = new List<TimerImpl>();
static readonly List<TimerImpl> _appendList = new List<TimerImpl>();
public void update(Action flushMicroTasks = null) {
var now = Timer.timeSinceStartup;
_timers.Clear();
_appendList.Clear();
lock (_queue) {
while (_queue.count > 0 && _queue.peek().deadline <= now) {
var timer = _queue.dequeue();
_timers.Add(timer);
}
public static TimeSpan timespanSinceStartup {
get { return TimeSpan.FromMilliseconds(UIMonoState_timerMillisecondClock()); }
}
internal static _Timer _createTimer(ZoneUnaryCallback callback, int milliSeconds, bool repeating) {
if (milliSeconds < 0) {
milliSeconds = 0;
if (_timers.Count != 0) {
foreach (var timer in _timers) {
if (flushMicroTasks != null) {
flushMicroTasks();
}
long now = UIMonoState_timerMillisecondClock();
long wakeupTime = (milliSeconds == 0) ? now : (now + 1 + milliSeconds);
timer.invoke();
if (timer.periodic && !timer.done) {
_appendList.Add(timer);
}
}
}
_Timer timer = new _Timer(callback, wakeupTime, milliSeconds, repeating);
timer._enqueue();
if (_appendList.Count != 0) {
lock (_queue) {
foreach (var timer in _appendList) {
_queue.enqueue(timer);
}
}
}
return timer;
class TimerImpl : Timer, IComparable<TimerImpl> {
float _deadline;
readonly Action _callback;
bool _done;
public override void cancel() {
_callback = null;
}
public readonly bool periodic;
readonly TimeSpan _interval;
public override bool isActive => _callback != null;
public TimerImpl(TimeSpan duration, Action callback, bool periodic = false) {
_deadline = timeSinceStartup + (float) duration.TotalSeconds;
_callback = callback;
_done = false;
public override long tick => _tick;
this.periodic = periodic;
if (periodic) {
_interval = duration;
}
void _advanceWakeupTime() {
if (_milliSeconds > 0) {
_wakeupTime += _milliSeconds;
public TimerImpl(Action callback) {
_deadline = 0;
_callback = callback;
_done = false;
else {
_wakeupTime = UIMonoState_timerMillisecondClock();
}
public float deadline {
get { return _deadline; }
}
const long MILLI_TO_NANO = 1000000L;
void _enqueue() {
Isolate.ensureExists();
GCHandle callbackHandle = GCHandle.Alloc(this);
UIMonoState_postTaskForTime(_postTaskForTime, (IntPtr) callbackHandle, _wakeupTime * MILLI_TO_NANO);
}
public override void cancel() {
_done = true;
}
[MonoPInvokeCallback(typeof(UIMonoState_postTaskForTimeCallback))]
static void _postTaskForTime(IntPtr callbackHandle) {
GCHandle timerHandle = (GCHandle) callbackHandle;
var timer = (_Timer) timerHandle.Target;
timerHandle.Free();
public bool done {
get { return _done; }
}
public void invoke() {
if (_done) {
return;
}
try {
if (timer._callback != null) {
var callback = timer._callback;
if (!timer._repeating) {
timer._callback = null;
}
else if (timer._milliSeconds > 0) {
var ms = timer._milliSeconds;
long overdue = UIMonoState_timerMillisecondClock() - timer._wakeupTime;
if (overdue > ms) {
long missedTicks = overdue / ms;
timer._wakeupTime += missedTicks * ms;
timer._tick += missedTicks;
}
}
var now = timeSinceStartup;
if (!periodic) {
_done = true;
}
timer._tick += 1;
try {
_callback();
}
catch (Exception ex) {
D.logError("Error to execute timer callback: ", ex);
}
callback(timer);
if (periodic) {
_deadline = now + (float) _interval.TotalSeconds;
if (timer._repeating && (timer._callback != null)) {
timer._advanceWakeupTime();
timer._enqueue();
}
public int CompareTo(TimerImpl other) {
return deadline.CompareTo(other.deadline);
catch (Exception ex) {
Debug.LogException(ex);
[DllImport(NativeBindings.dllName)]
static extern long UIMonoState_timerMillisecondClock();
delegate void UIMonoState_postTaskForTimeCallback(IntPtr callbackHandle);
[DllImport(NativeBindings.dllName)]
static extern void UIMonoState_postTaskForTime(UIMonoState_postTaskForTimeCallback callback,
IntPtr callbackHandle, long targetTimeNanos);
}*/
}

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


using System;
using System.Collections.Generic;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;

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


using System.Collections.Generic;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;

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


using System;
using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;

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


using System;
using System.Collections.Generic;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;

103
com.unity.uiwidgets/Runtime/engine/DisplayMetrics.cs


using System;
using System.Runtime.InteropServices;
using Unity.UIWidgets.ui;
using UnityEngine;

public float padding_right;
}
public static class DisplayMetricsProvider {
public static Func<DisplayMetrics> provider = () => new PlayerDisplayMetrics();
}
public interface DisplayMetrics {
void OnEnable();
void OnGUI();
void Update();
void onViewMetricsChanged();
float devicePixelRatio { get; }
viewMetrics viewMetrics { get; }
WindowPadding viewPadding { get; }
WindowPadding viewInsets { get; }
}
public class PlayerDisplayMetrics : DisplayMetrics {
float _devicePixelRatio = 0;
viewMetrics? _viewMetrics = null;
public void OnEnable() {
}
public void OnGUI() {
}
public void Update() {
}
public void onViewMetricsChanged() {
//view metrics marks dirty
_viewMetrics = null;
}
public class DisplayMetrics {
float _devicePixelRatioByDefault;
public float devicePixelRatio {
public float DevicePixelRatioByDefault {
if (_devicePixelRatio > 0) {
return _devicePixelRatio;
if (_devicePixelRatioByDefault > 0) {
return _devicePixelRatioByDefault;
_devicePixelRatio = AndroidDevicePixelRatio();
#endif
#if UNITY_WEBGL
this._devicePixelRatio = UIWidgetsWebGLDevicePixelRatio();
_devicePixelRatioByDefault = AndroidDevicePixelRatio();
//this._devicePixelRatio = IOSDeviceScaleFactor();
_devicePixelRatioByDefault = IOSDeviceScaleFactor();
if (_devicePixelRatio <= 0) {
_devicePixelRatio = 1;
if (_devicePixelRatioByDefault <= 0) {
_devicePixelRatioByDefault = 1;
return _devicePixelRatio;
return _devicePixelRatioByDefault;
public WindowPadding viewPadding {
get {
return new WindowPadding(viewMetrics.padding_left,

}
}
private viewMetrics? _viewMetrics;
public viewMetrics viewMetrics {
get {
if (_viewMetrics != null) {

#if UNITY_ANDROID
#if UNITY_ANDROID && !UNITY_EDITOR
using (
AndroidJavaClass viewController =
new AndroidJavaClass("com.unity.uiwidgets.plugin.UIWidgetsViewController")

padding_bottom = padding_bottom
};
}
#elif UNITY_WEBGL
this._viewMetrics = new viewMetrics {
insets_bottom = 0,
insets_left = 0,
insets_right = 0,
insets_top = 0,
padding_left = 0,
padding_top = 0,
padding_right = 0,
padding_bottom = 0
};
#elif UNITY_IOS
//viewMetrics metrics = IOSGetViewportPadding();
//this._viewMetrics = metrics;
#elif !UNITY_EDITOR && UNITY_IOS
viewMetrics metrics = IOSGetViewportPadding();
this._viewMetrics = metrics;
#else
_viewMetrics = new viewMetrics {
insets_bottom = 0,

return _viewMetrics.Value;
}
}
public void onViewMetricsChanged() {
//view metrics marks dirty
_viewMetrics = null;
}
#if UNITY_ANDROID
static float AndroidDevicePixelRatio() {

}
#endif
#if UNITY_WEBGL
[DllImport("__Internal")]
static extern float UIWidgetsWebGLDevicePixelRatio();
#endif
//[DllImport("__Internal")]
//static extern float IOSDeviceScaleFactor();
        [DllImport("__Internal")]
        static extern float IOSDeviceScaleFactor();
//[DllImport("__Internal")]
//static extern viewMetrics IOSGetViewportPadding();
        [DllImport("__Internal")]
        static extern viewMetrics IOSGetViewportPadding();
}
}

2
com.unity.uiwidgets/Runtime/engine/UIWidgetsMessageManager.cs


using System.Collections.Generic;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.external.simplejson;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.service;

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


/*using System.Collections.Generic;
using Unity.UIWidgets.async;
using Unity.UIWidgets.editor;
using System;
using System.Collections;
using System.Collections.Generic;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.external.simplejson;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;

using UnityEngine.UI;
using RawImage = UnityEngine.UI.RawImage;
using Rect = UnityEngine.Rect;
using Texture = UnityEngine.Texture;
public class UIWidgetWindowAdapter : WindowAdapter {
readonly UIWidgetsPanel _uiWidgetsPanel;
bool _needsPaint;
public enum UIWidgetsWindowType {
InvalidPanel = 0,
GameObjectPanel = 1,
EditorWindowPanel = 2
}
[Serializable]
public struct Font {
public string asset;
public int weight;
}
protected override void updateSafeArea() {
_padding = _uiWidgetsPanel.viewPadding;
_viewInsets = _uiWidgetsPanel.viewInsets;
}
[Serializable]
public struct TextFont {
public string family;
[SerializeField] public Font[] fonts;
}
protected override bool hasFocus() {
return EventSystem.current != null &&
EventSystem.current.currentSelectedGameObject == _uiWidgetsPanel.gameObject;
}
public interface IUIWidgetsWindow {
Offset windowPosToScreenPos(Offset offset);
public override void scheduleFrame(bool regenerateLayerTree = true) {
base.scheduleFrame(regenerateLayerTree);
_needsPaint = true;
}
void startCoroutine(IEnumerator routing);
public UIWidgetWindowAdapter(UIWidgetsPanel uiWidgetsPanel) {
_uiWidgetsPanel = uiWidgetsPanel;
}
bool isActive();
void mainEntry();
void onNewFrameScheduled();
public override void OnGUI(Event evt) {
if (displayMetricsChanged()) {
_needsPaint = true;
UIWidgetsWindowType getWindowType();
}
public class Configurations {
private Dictionary<string, TextFont> _textFonts = new Dictionary<string, TextFont>();
public void Clear() {
_textFonts.Clear();
}
public void AddFont(string family, TextFont font) {
_textFonts[key: family] = font;
}
public object fontsToObject() {
Dictionary<string, TextFont> settings = _textFonts;
if (settings == null || settings.Count == 0) {
return null;
if (evt.type == EventType.Repaint) {
if (!_needsPaint) {
return;
var result = new object[settings.Count];
var i = 0;
foreach (var setting in settings) {
var font = new Dictionary<string, object>();
font.Add("family", value: setting.Key);
var dic = new Dictionary<string, object>[setting.Value.fonts.Length];
for (var j = 0; j < setting.Value.fonts.Length; j++) {
dic[j] = new Dictionary<string, object>();
if (setting.Value.fonts[j].asset.Length > 0) {
dic[j].Add("asset", value: setting.Value.fonts[j].asset);
}
if (setting.Value.fonts[j].weight > 0) {
dic[j].Add("weight", value: setting.Value.fonts[j].weight);
}
_needsPaint = false;
font.Add("fonts", value: dic);
result[i] = font;
i++;
base.OnGUI(evt);
return result;
}
protected override Surface createSurface() {
return new WindowSurfaceImpl(_uiWidgetsPanel.applyRenderTexture);
}
public partial class UIWidgetsPanel : RawImage, IUIWidgetsWindow {
static List<UIWidgetsPanel> panels = new List<UIWidgetsPanel>();
public override GUIContent titleContent {
get { return new GUIContent(_uiWidgetsPanel.gameObject.name); }
}
static public Isolate anyIsolate {
get {
if (panels.Count == 0) {
return null;
}
protected override float queryDevicePixelRatio() {
return _uiWidgetsPanel.devicePixelRatio;
}
protected override int queryAntiAliasing() {
return _uiWidgetsPanel.antiAliasing;
return panels[0]._wrapper.isolate;
}
protected override Vector2 queryWindowSize() {
var rect = _uiWidgetsPanel.rectTransform.rect;
// Here we use ReferenceEquals instead of "==" due to
// https://blogs.unity3d.com/2014/05/16/custom-operator-should-we-keep-it/
// In short, "==" is overloaded for UnityEngine.Object and will bring performance issues
if (!ReferenceEquals(_uiWidgetsPanel.canvas, null)) {
var size = new Vector2(rect.width, rect.height) *
_uiWidgetsPanel.canvas.scaleFactor / _uiWidgetsPanel.devicePixelRatio;
size.x = Mathf.Round(size.x);
size.y = Mathf.Round(size.y);
return size;
}
static void registerPanel(UIWidgetsPanel panel) {
panels.Add(panel);
}
return new Vector2(0, 0);
static void unregisterPanel(UIWidgetsPanel panel) {
panels.Remove(panel);
public Offset windowPosToScreenPos(Offset windowPos) {
Camera camera = null;
var canvas = _uiWidgetsPanel.canvas;
if (canvas.renderMode != RenderMode.ScreenSpaceCamera) {
camera = canvas.GetComponent<GraphicRaycaster>().eventCamera;
}
float _devicePixelRatioOverride;
var pos = new Vector2(windowPos.dx, windowPos.dy);
pos = pos * queryDevicePixelRatio() / _uiWidgetsPanel.canvas.scaleFactor;
var rectTransform = _uiWidgetsPanel.rectTransform;
var rect = rectTransform.rect;
pos.x += rect.min.x;
pos.y = rect.max.y - pos.y;
var worldPos = rectTransform.TransformPoint(new Vector2(pos.x, pos.y));
var screenPos = RectTransformUtility.WorldToScreenPoint(camera, worldPos);
return new Offset(screenPos.x, Screen.height - screenPos.y);
}
}
public bool hardwareAntiAliasing;
[RequireComponent(typeof(RectTransform))]
public class UIWidgetsPanel : RawImage, IPointerDownHandler, IPointerUpHandler, IDragHandler,
IPointerEnterHandler, IPointerExitHandler, WindowHost {
static Event _repaintEvent;
public TextFont[] fonts;
[Tooltip("set to zero if you want to use the default device pixel ratio of the target platforms; otherwise the " +
"device pixel ratio will be forced to the given value on all devices.")]
[SerializeField] protected float devicePixelRatioOverride;
[Tooltip("set to true will enable the hardware anti-alias feature, which will improve the appearance of the UI greatly but " +
"making it much slower. Enable it only when seriously required.")]
[SerializeField] protected bool hardwareAntiAliasing = false;
WindowAdapter _windowAdapter;
Texture _texture;
Vector2 _lastMouseMove;
Configurations _configurations;
readonly HashSet<int> _enteredPointers = new HashSet<int>();
bool _viewMetricsCallbackRegistered;
UIWidgetsPanelWrapper _wrapper;
bool _mouseEntered {
get { return !_enteredPointers.isEmpty(); }
int _currentWidth {
get { return Mathf.RoundToInt(rectTransform.rect.width * canvas.scaleFactor); }
DisplayMetrics _displayMetrics;
const int mouseButtonNum = 3;
void _handleViewMetricsChanged(string method, List<JSONNode> args) {
_windowAdapter?.onViewMetricsChanged();
_displayMetrics?.onViewMetricsChanged();
int _currentHeight {
get { return Mathf.RoundToInt(rectTransform.rect.height * canvas.scaleFactor); }
protected virtual void InitWindowAdapter() {
D.assert(_windowAdapter == null);
_windowAdapter = new UIWidgetWindowAdapter(this);
float _currentDevicePixelRatio {
get {
#if !UNITY_EDITOR
return _wrapper.displayMetrics.DevicePixelRatioByDefault;
#endif
var currentDpi = Screen.dpi;
if (currentDpi == 0) {
currentDpi = canvas.GetComponent<CanvasScaler>().fallbackScreenDPI;
}
_windowAdapter.OnEnable();
return currentDpi / 96;
}
protected override void OnEnable() {
base.OnEnable();
//Disable the default touch -> mouse event conversion on mobile devices
Input.simulateMouseWithTouches = false;
_displayMetrics = DisplayMetricsProvider.provider();
_displayMetrics.OnEnable();
bool _viewMetricsCallbackRegistered;
_enteredPointers.Clear();
void _handleViewMetricsChanged(string method, List<JSONNode> args) {
using (Isolate.getScope(anyIsolate)) {
_wrapper.displayMetrics.onViewMetricsChanged();
Window.instance.updateSafeArea();
Window.instance.onMetricsChanged?.Invoke();
}
}
protected virtual void Update() {
UIWidgetsMessageManager.ensureUIWidgetsMessageManagerIfNeeded();
if (_repaintEvent == null) {
_repaintEvent = new Event {type = EventType.Repaint};
if (!_viewMetricsCallbackRegistered) {
_viewMetricsCallbackRegistered = true;
UIWidgetsMessageManager.instance?.AddChannelMessageDelegate("ViewportMetricsChanged",
_handleViewMetricsChanged);
InitWindowAdapter();
Input_Update();
}
Widget root;
using (_windowAdapter.getScope()) {
root = createWidget();
}
#if !UNITY_EDITOR && UNITY_ANDROID
bool AndroidInitialized = true;
_windowAdapter.attachRootWidget(root);
_lastMouseMove = Input.mousePosition;
IEnumerator DoInitAndroid() {
yield return new WaitForEndOfFrame();
AndroidPlatformUtil.Init();
yield return new WaitForEndOfFrame();
enabled = true;
public float devicePixelRatio {
get {
return devicePixelRatioOverride > 0
? devicePixelRatioOverride
: _displayMetrics.devicePixelRatio;
bool IsAndroidInitialized() {
if (AndroidInitialized) {
enabled = false;
AndroidInitialized = false;
startCoroutine(DoInitAndroid());
return false;
return true;
public int antiAliasing {
get { return hardwareAntiAliasing ? Window.defaultAntiAliasing : 0; }
}
#endif
public WindowPadding viewPadding {
get { return _displayMetrics.viewPadding; }
}
public WindowPadding viewInsets {
get { return _displayMetrics.viewInsets; }
protected void OnEnable() {
#if !UNITY_EDITOR && UNITY_ANDROID
if (!IsAndroidInitialized()) {return ;}
#endif
#if !UNITY_EDITOR && UNITY_IOS
//the hook API cannot be automatically called on IOS, so we need try hook it here
Hooks.tryHook();
#endif
base.OnEnable();
D.assert(_wrapper == null);
_configurations = new Configurations();
_wrapper = new UIWidgetsPanelWrapper();
onEnable();
if (fonts != null && fonts.Length > 0) {
foreach (var font in fonts) {
AddFont(family: font.family, font: font);
}
}
_wrapper.Initiate(this, width: _currentWidth, height: _currentHeight, dpr: _currentDevicePixelRatio,
_configurations: _configurations);
_configurations.Clear();
texture = _wrapper.renderTexture;
Input_OnEnable();
registerPanel(this);
D.assert(_windowAdapter != null);
_windowAdapter.OnDisable();
_windowAdapter = null;
unregisterPanel(this);
D.assert(_wrapper != null);
_wrapper?.Destroy();
_wrapper = null;
texture = null;
Input_OnDisable();
protected virtual Widget createWidget() {
return null;
protected virtual void OnGUI() {
Input_OnGUI();
public void recreateWidget() {
Widget root;
using (_windowAdapter.getScope()) {
root = createWidget();
protected override void OnRectTransformDimensionsChange() {
if (_wrapper != null && _wrapper.didDisplayMetricsChanged(width: _currentWidth, height: _currentHeight,
dpr: _currentDevicePixelRatio)) {
_wrapper.OnDisplayMetricsChanged(width: _currentWidth, height: _currentHeight,
dpr: _currentDevicePixelRatio);
texture = _wrapper.renderTexture;
_windowAdapter.attachRootWidget(root);
internal void applyRenderTexture(Rect screenRect, Texture texture, Material mat) {
this.texture = texture;
material = mat;
public UIWidgetsWindowType getWindowType() {
return UIWidgetsWindowType.GameObjectPanel;
protected virtual void Update() {
_displayMetrics.Update();
UIWidgetsMessageManager.ensureUIWidgetsMessageManagerIfNeeded();
public bool isActive() {
return IsActive();
}
#if UNITY_ANDROID
if (Input.GetKeyDown(KeyCode.Escape)) {
this._windowAdapter.withBinding(() => { WidgetsBinding.instance.handlePopRoute(); });
}
#endif
public void startCoroutine(IEnumerator routing) {
StartCoroutine(routine: routing);
}
if (!_viewMetricsCallbackRegistered) {
_viewMetricsCallbackRegistered = true;
UIWidgetsMessageManager.instance?.AddChannelMessageDelegate("ViewportMatricsChanged",
_handleViewMetricsChanged);
}
public void onNewFrameScheduled() {
}
if (_mouseEntered) {
if (_lastMouseMove.x != Input.mousePosition.x || _lastMouseMove.y != Input.mousePosition.y) {
handleMouseMovement();
}
public Offset windowPosToScreenPos(Offset offset) {
Camera camera = null;
if (canvas.renderMode != RenderMode.ScreenSpaceCamera) {
camera = canvas.GetComponent<GraphicRaycaster>().eventCamera;
_lastMouseMove = Input.mousePosition;
if (_mouseEntered) {
handleMouseScroll();
}
var pos = new Vector2(x: offset.dx, y: offset.dy);
pos = pos * _currentDevicePixelRatio / canvas.scaleFactor;
var rect = rectTransform.rect;
pos.x += rect.min.x;
pos.y = rect.max.y - pos.y;
var worldPos = rectTransform.TransformPoint(new Vector2(x: pos.x, y: pos.y));
var screenPos = RectTransformUtility.WorldToScreenPoint(cam: camera, worldPoint: worldPos);
return new Offset(dx: screenPos.x, Screen.height - screenPos.y);
}
D.assert(_windowAdapter != null);
_windowAdapter.Update();
_windowAdapter.OnGUI(_repaintEvent);
public void mainEntry() {
main();
void OnGUI() {
_displayMetrics.OnGUI();
if (Event.current.type == EventType.KeyDown || Event.current.type == EventType.KeyUp) {
_windowAdapter.OnGUI(Event.current);
}
protected virtual void onEnable() {
}
protected void AddFont(string family, TextFont font) {
_configurations.AddFont(family,font);
void handleMouseMovement() {
var pos = getPointPosition(Input.mousePosition);
if (pos == null) {
protected void AddFont(string family, List<string> assets, List<int> weights) {
if (assets.Count != weights.Count) {
Debug.LogError($"The size of {family}‘s assets should be equal to the weights'.");
_windowAdapter.postPointerEvent(new PointerData(
timeStamp: Timer.timespanSinceStartup,
change: PointerChange.hover,
kind: PointerDeviceKind.mouse,
device: getMouseButtonDown(),
physicalX: pos.Value.x,
physicalY: pos.Value.y
));
}
void handleMouseScroll() {
if (Input.mouseScrollDelta.y != 0 || Input.mouseScrollDelta.x != 0) {
var scaleFactor = canvas.scaleFactor;
var pos = getPointPosition(Input.mousePosition);
if (pos == null) {
return;
}
_windowAdapter.onScroll(Input.mouseScrollDelta.x * scaleFactor,
Input.mouseScrollDelta.y * scaleFactor,
pos.Value.x,
pos.Value.y,
InputUtils.getScrollButtonKey());
var textFont = new TextFont {family = family};
var fonts = new Font[assets.Count];
for (var j = 0; j < assets.Count; j++) {
var font = new Font {asset = assets[index: j], weight = weights[index: j]};
fonts[j] = font;
textFont.fonts = fonts;
AddFont(family: family, font: textFont);
}
protected virtual void main() {
}
int getMouseButtonDown() {
//default mouse button key = left mouse button
var defaultKey = 0;
for (int key = 0; key < mouseButtonNum; key++) {
if (Input.GetMouseButton(key)) {
defaultKey = key;
break;
}
}
enum UIWidgetsInputMode
{
Mouse,
Touch
}
public partial class UIWidgetsPanel : IPointerDownHandler, IPointerUpHandler,
IPointerEnterHandler, IPointerExitHandler, IDragHandler {
bool _isEntered;
Vector2 _lastMousePosition;
return InputUtils.getMouseButtonKey(defaultKey);
}
UIWidgetsInputMode _inputMode;
public void OnPointerDown(PointerEventData eventData) {
var position = getPointPosition(eventData);
if (position == null) {
return;
}
EventSystem.current.SetSelectedGameObject(gameObject, eventData);
_windowAdapter.postPointerEvent(new PointerData(
timeStamp: Timer.timespanSinceStartup,
change: PointerChange.down,
kind: InputUtils.getPointerDeviceKind(eventData),
device: InputUtils.getPointerDeviceKey(eventData),
physicalX: position.Value.x,
physicalY: position.Value.y
));
void _convertPointerData(PointerEventData evt, out Vector2? position, out int pointerId) {
position = _inputMode == UIWidgetsInputMode.Mouse
? _getPointerPosition(Input.mousePosition)
: _getPointerPosition(evt);
pointerId = _inputMode == UIWidgetsInputMode.Mouse ? evt.pointerId : (-1 - evt.pointerId);
public void OnPointerUp(PointerEventData eventData) {
var position = getPointPosition(eventData);
if (position == null) {
return;
Vector2? _getPointerPosition(Vector2 position) {
var worldCamera = canvas.worldCamera;
if (RectTransformUtility.ScreenPointToLocalPointInRectangle(
rect: rectTransform, screenPoint: position, cam: worldCamera, out var localPoint)) {
var scaleFactor = canvas.scaleFactor;
localPoint.x = (localPoint.x - rectTransform.rect.min.x) * scaleFactor;
localPoint.y = (rectTransform.rect.max.y - localPoint.y) * scaleFactor;
return localPoint;
_windowAdapter.postPointerEvent(new PointerData(
timeStamp: Timer.timespanSinceStartup,
change: PointerChange.up,
kind: InputUtils.getPointerDeviceKind(eventData),
device: InputUtils.getPointerDeviceKey(eventData),
physicalX: position.Value.x,
physicalY: position.Value.y
));
return null;
Camera getActiveCamera() {
Vector2? _getPointerPosition(PointerEventData eventData) {
return eventCamera;
}
Vector2? getPointPosition(PointerEventData eventData) {
Camera camera = getActiveCamera();
camera, out localPoint);
eventCamera, out localPoint);
var scaleFactor = canvas.scaleFactor;
localPoint.x = (localPoint.x - rectTransform.rect.min.x) * scaleFactor;
localPoint.y = (rectTransform.rect.max.y - localPoint.y) * scaleFactor;

Vector2? getPointPosition(Vector2 position) {
Vector2 localPoint;
Camera eventCamera = getActiveCamera();
void Input_OnEnable() {
_inputMode = Input.mousePresent ? UIWidgetsInputMode.Mouse : UIWidgetsInputMode.Touch;
}
RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform, position,
eventCamera, out localPoint);
var scaleFactor = canvas.scaleFactor;
localPoint.x = (localPoint.x - rectTransform.rect.min.x) * scaleFactor;
localPoint.y = (rectTransform.rect.max.y - localPoint.y) * scaleFactor;
return localPoint;
void Input_OnDisable() {
}
void Input_Update() {
//we only process hover events for desktop applications
if (_inputMode == UIWidgetsInputMode.Mouse) {
if (_isEntered) {
if (!Input.GetMouseButton(0) && !Input.GetMouseButton(1) && !Input.GetMouseButton(2)) {
if (_lastMousePosition.x != Input.mousePosition.x ||
_lastMousePosition.y != Input.mousePosition.y) {
_lastMousePosition = Input.mousePosition;
_onMouseMove();
}
}
else {
_lastMousePosition = Input.mousePosition;
}
if (Input.mouseScrollDelta.magnitude != 0) {
_onScroll();
}
}
}
}
void Input_OnGUI() {
var e = Event.current;
if (e.isKey) {
_wrapper.OnKeyDown(e: e);
}
}
void _onMouseMove() {
if (_inputMode != UIWidgetsInputMode.Mouse) {
return;
}
var pos = _getPointerPosition(Input.mousePosition);
_wrapper.OnMouseMove(pos);
public void OnDrag(PointerEventData eventData) {
var position = getPointPosition(eventData);
if (position == null) {
void _onScroll() {
if (_inputMode != UIWidgetsInputMode.Mouse) {
_windowAdapter.postPointerEvent(new PointerData(
timeStamp: Timer.timespanSinceStartup,
change: PointerChange.move,
kind: InputUtils.getPointerDeviceKind(eventData),
device: InputUtils.getPointerDeviceKey(eventData),
physicalX: position.Value.x,
physicalY: position.Value.y
));
var pos = _getPointerPosition(Input.mousePosition);
_wrapper.OnMouseScroll(Input.mouseScrollDelta, pos);
var position = getPointPosition(eventData);
if (position == null) {
if (_inputMode != UIWidgetsInputMode.Mouse) {
var pointerKey = InputUtils.getPointerDeviceKey(eventData);
_enteredPointers.Add(pointerKey);
_lastMouseMove = eventData.position;
_windowAdapter.postPointerEvent(new PointerData(
timeStamp: Timer.timespanSinceStartup,
change: PointerChange.hover,
kind: InputUtils.getPointerDeviceKind(eventData),
device: pointerKey,
physicalX: position.Value.x,
physicalY: position.Value.y
));
D.assert(eventData.pointerId < 0);
_isEntered = true;
_lastMousePosition = Input.mousePosition;
var position = getPointPosition(eventData);
if (position == null) {
if (_inputMode != UIWidgetsInputMode.Mouse) {
var pointerKey = InputUtils.getPointerDeviceKey(eventData);
_enteredPointers.Remove(pointerKey);
_windowAdapter.postPointerEvent(new PointerData(
timeStamp: Timer.timespanSinceStartup,
change: PointerChange.hover,
kind: InputUtils.getPointerDeviceKind(eventData),
device: pointerKey,
physicalX: position.Value.x,
physicalY: position.Value.y
));
D.assert(eventData.pointerId < 0);
_isEntered = false;
_wrapper.OnPointerLeave();
}
public void OnPointerDown(PointerEventData eventData) {
_convertPointerData(eventData, out var pos, out var pointerId);
_wrapper.OnPointerDown(pos, pointerId);
}
public void OnPointerUp(PointerEventData eventData) {
_convertPointerData(eventData, out var pos, out var pointerId);
_wrapper.OnPointerUp(pos, pointerId);
public Window window {
get { return _windowAdapter; }
public void OnDrag(PointerEventData eventData) {
_convertPointerData(eventData, out var pos, out var pointerId);
_wrapper.OnDrag(pos, pointerId);
}*/
}

4
com.unity.uiwidgets/Runtime/engine/UIWidgetsPanel.cs.meta


fileFormatVersion: 2
guid: 5f8434687aa245d9ae7f766b6109166b
timeCreated: 1545642183
guid: 305c123a2a944eba8f2b397a962323ff
timeCreated: 1597215247

2
com.unity.uiwidgets/Runtime/foundation/basic_types.cs


using System;
using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.InternalBridge;
using UnityEngine;
using Object = UnityEngine.Object;

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


using System.Collections;
using System.Collections.Generic;
using developer;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.foundation {

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


using System;
using System.Diagnostics;
using System.Linq;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using UnityEngine;

2
com.unity.uiwidgets/Runtime/foundation/isolates.cs


using System.ComponentModel;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.foundation {

2
com.unity.uiwidgets/Runtime/foundation/synchronous_future.cs


using System;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
namespace Unity.UIWidgets.foundation {
public class SynchronousFuture : Future {

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


using System;
using System.Collections.Generic;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.ui;

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


using System;
using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;

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


using System;
using System.Collections.Generic;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;

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


using System;
using System.Collections.Generic;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using UnityEngine;

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


using System.Collections.Generic;
using developer;
using uiwidgets;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;

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


using uiwidgets;
using Unity.UIWidget.material;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;

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


using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;

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


using System.Linq;
using uiwidgets;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.external;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;

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


using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.widgets;

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


using System;
using System.Collections.Generic;
using System.Text;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;

2
com.unity.uiwidgets/Runtime/material/pickers/date_picker_dialog.cs


using System;
using System.Collections.Generic;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;

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


using System;
using System.Collections.Generic;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;

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


using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.external;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;

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


using System;
using System.Collections.Generic;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;

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


using uiwidgets;
using Unity.UIWidget.material;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;

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


using System;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;

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


using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.service;
using Unity.UIWidgets.ui;

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


using System;
using System.Collections.Generic;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;

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


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

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


using System.Collections.Generic;
using uiwidgets;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;

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


using System.Linq;
using uiwidgets;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;

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


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

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


using System.Collections.Generic;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.services;
using Unity.UIWidgets.ui;

2
com.unity.uiwidgets/Runtime/painting/image_decoder.cs


using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.painting {

4
com.unity.uiwidgets/Runtime/painting/image_provider.cs


using System.Collections;
using System.Collections.Generic;
using System.Text;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using UnityEngine;

2
com.unity.uiwidgets/Runtime/painting/image_resolution.cs


using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.external;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;

2
com.unity.uiwidgets/Runtime/painting/image_stream.cs


using System;
using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.external;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.scheduler2;

2
com.unity.uiwidgets/Runtime/painting/shader_warmup.cs


using System.Collections.Generic;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;

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


using System;
using System.Collections.Generic;
using System.Linq;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;

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


using System.Collections.Generic;
using System.Linq;
using System.Text;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;

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


using System;
using System.Collections.Generic;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.painting;

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


using System;
using System.Collections.Generic;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
namespace Unity.UIWidgets.rendering {

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


/*
using System;
using System;
using System.Collections;
using RSG.Promises;
using developer;
using Unity.UIWidgets.async;
using Unity.UIWidgets.async;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.scheduler2;
using Unity.UIWidgets.painting;
using Debug = UnityEngine.Debug;
using FrameCallback = Unity.UIWidgets.ui.FrameCallback;
using UnityEngine;
using FrameTiming = Unity.UIWidgets.ui.FrameTiming;
namespace Unity.UIWidgets.scheduler2 {
public static partial class scheduler_ {
static float _timeDilation = 1.0f;
public static float timeDilation {
get { return _timeDilation; }
set {
D.assert(value > 0.0f);
if (_timeDilation == value) {
return;
}
namespace Unity.UIWidgets.scheduler {
SchedulerBinding.instance?.resetEpoch();
_timeDilation = value;
}
}
}
public delegate void FrameCallback(TimeSpan timeStamp);
public delegate T TaskCallback<out T>();
public delegate bool SchedulingStrategy(int priority = 0, SchedulerBinding scheduler = null);
interface _TaskEntry : IComparable<_TaskEntry> {
int priority { get; }
string debugStack { get; }
void run();
}
class _TaskEntry<T> : _TaskEntry {
public readonly TaskCallback<T> task;
public Completer completer;
internal _TaskEntry(TaskCallback<T> task, int priority) {
this.task = task;
this.priority = priority;
D.assert(() => {
debugStack = StackTraceUtility.ExtractStackTrace();
return true;
});
completer = Completer.create();
}
public int priority { get; }
public string debugStack { get; private set; }
public void run() {
if (!foundation_.kReleaseMode) {
completer.complete(FutureOr.value(task()));
}
else {
completer.complete(FutureOr.value(task()));
}
}
public int CompareTo(_TaskEntry other) {
return -priority.CompareTo(value: other.priority);
}
}
public static string debugCurrentCallbackStack;
public readonly FrameCallback callback;
public string debugStack;
internal _FrameCallbackEntry(FrameCallback callback, bool rescheduling = false) {
this.callback = callback;

if (debugCurrentCallbackStack == null) {
throw new UIWidgetsError(
"scheduleFrameCallback called with rescheduling true, but no callback is in scope.\n" +
"The \"rescheduling\" argument should only be set to true if the " +
"callback is being reregistered from within the callback itself, " +
"and only then if the callback itself is entirely synchronous. " +
"If this is the initial registration of the callback, or if the " +
"callback is asynchronous, then do not use the \"rescheduling\" " +
"argument.");
new List<DiagnosticsNode> {
new ErrorSummary(
"scheduleFrameCallback called with rescheduling true, but no callback is in scope."),
new ErrorDescription(
"The \"rescheduling\" argument should only be set to true if the " +
"callback is being reregistered from within the callback itself, " +
"and only then if the callback itself is entirely synchronous."),
new ErrorHint("If this is the initial registration of the callback, or if the " +
"callback is asynchronous, then do not use the \"rescheduling\" " +
"argument.")
});
} else {
debugStack = "skipped, use StackTraceUtility.ExtractStackTrace() if you need it"; // StackTraceUtility.ExtractStackTrace();
}
else {
debugStack = StackTraceUtility.ExtractStackTrace();
public readonly FrameCallback callback;
internal static string debugCurrentCallbackStack;
internal string debugStack;
}
public enum SchedulerPhase {

persistentCallbacks,
postFrameCallbacks,
postFrameCallbacks
public class SchedulerBinding {
public class SchedulerBinding : PaintingBinding {
readonly List<FrameCallback> _persistentCallbacks = new List<FrameCallback>();
readonly List<FrameCallback> _postFrameCallbacks = new List<FrameCallback>();
readonly HashSet<int> _removedIds = new HashSet<int>();
readonly PriorityQueue<_TaskEntry> _taskQueue = new PriorityQueue<_TaskEntry>();
readonly List<TimingsCallback> _timingsCallbacks = new List<TimingsCallback>();
TimeSpan? _currentFrameTimeStamp;
string _debugBanner;
int _debugFrameNumber;
TimeSpan _epochStart = TimeSpan.Zero;
TimeSpan? _firstRawTimeStampInEpoch;
bool _hasRequestedAnEventLoopCallback;
bool _ignoreNextEngineDrawFrame;
int _nextFrameCallbackId;
Completer _nextFrameCompleter;
Dictionary<int, _FrameCallbackEntry> _transientCallbacks = new Dictionary<int, _FrameCallbackEntry>();
bool _warmUpFrame;
public SchedulingStrategy schedulingStrategy = scheduler_.defaultSchedulingStrategy;
get { return (SchedulerBinding) Window.instance._binding; }
private set { Window.instance._binding = value; }
}
public AppLifecycleState? lifecycleState { get; private set; }
public int transientCallbackCount {
get { return _transientCallbacks.Count; }
}
public Future endOfFrame {
D.assert(_instance != null,
() => "Binding.instance is null. " +
"This usually happens when there is a callback from outside of UIWidgets. " +
"Try to use \"using (WindowProvider.of(BuildContext).getScope()) { ... }\" to wrap your code.");
return _instance;
}
if (_nextFrameCompleter == null) {
if (schedulerPhase == SchedulerPhase.idle) {
scheduleFrame();
}
set {
if (value == null) {
D.assert(_instance != null, () => "Binding.instance is already cleared.");
_instance = null;
} else {
D.assert(_instance == null, () => "Binding.instance is already assigned.");
_instance = value;
_nextFrameCompleter = Completer.create();
addPostFrameCallback(timeStamp => {
_nextFrameCompleter.complete();
_nextFrameCompleter = null;
});
return _nextFrameCompleter.future;
internal static SchedulerBinding _instance;
public bool hasScheduledFrame { get; private set; }
public SchedulerPhase schedulerPhase { get; private set; } = SchedulerPhase.idle;
public bool framesEnabled { get; private set; } = true;
public SchedulerBinding() {
Window.instance.onBeginFrame += _handleBeginFrame;
Window.instance.onDrawFrame += _handleDrawFrame;
public TimeSpan currentFrameTimeStamp {
get {
D.assert(_currentFrameTimeStamp != null);
return _currentFrameTimeStamp.Value;
}
public float timeDilation {
get { return _timeDilation; }
set {
if (_timeDilation == value) {
return;
}
public TimeSpan currentSystemFrameTimeStamp { get; private set; } = TimeSpan.Zero;
resetEpoch();
_timeDilation = value;
protected override void initInstances() {
base.initInstances();
instance = this;
//SystemChannels.lifecycle.setMessageHandler(_handleLifecycleMessage);
readInitialLifecycleStateFromNativeWindow();
if (!foundation_.kReleaseMode) {
var frameNumber = 0;
addTimingsCallback(timings => {
foreach (var frameTiming in timings) {
frameNumber += 1;
_profileFramePostEvent(frameNumber: frameNumber, frameTiming: frameTiming);
}
});
float _timeDilation = 1.0f;
public void addTimingsCallback(TimingsCallback callback) {
_timingsCallbacks.Add(item: callback);
if (_timingsCallbacks.Count == 1) {
D.assert(window.onReportTimings == null);
window.onReportTimings = _executeTimingsCallbacks;
}
int _nextFrameCallbackId = 0;
Dictionary<int, _FrameCallbackEntry> _transientCallbacks = new Dictionary<int, _FrameCallbackEntry>();
readonly HashSet<int> _removedIds = new HashSet<int>();
D.assert(window.onReportTimings == _executeTimingsCallbacks);
}
public int transientCallbackCount {
get { return _transientCallbacks.Count; }
public void removeTimingsCallback(TimingsCallback callback) {
D.assert(_timingsCallbacks.Contains(item: callback));
_timingsCallbacks.Remove(item: callback);
if (_timingsCallbacks.isEmpty()) {
window.onReportTimings = null;
}
public int scheduleFrameCallback(FrameCallback callback, bool rescheduling = false) {
scheduleFrame();
_nextFrameCallbackId += 1;
_transientCallbacks[_nextFrameCallbackId] =
new _FrameCallbackEntry(callback, rescheduling: rescheduling);
return _nextFrameCallbackId;
void _executeTimingsCallbacks(List<FrameTiming> timings) {
var clonedCallbacks =
new List<TimingsCallback>(collection: _timingsCallbacks);
foreach (var callback in clonedCallbacks) {
try {
if (_timingsCallbacks.Contains(item: callback)) {
callback(timings: timings);
}
}
catch (Exception ex) {
InformationCollector collector = null;
D.assert(() => {
IEnumerable<DiagnosticsNode> infoCollect() {
yield return new DiagnosticsProperty<TimingsCallback>(
"The TimingsCallback that gets executed was",
value: callback,
style: DiagnosticsTreeStyle.errorProperty);
}
collector = infoCollect;
return true;
});
UIWidgetsError.reportError(new UIWidgetsErrorDetails(
exception: ex,
context: new ErrorDescription("while executing callbacks for FrameTiming"),
informationCollector: collector
));
}
}
public void cancelFrameCallbackWithId(int id) {
D.assert(id > 0);
_transientCallbacks.Remove(id);
_removedIds.Add(id);
protected void readInitialLifecycleStateFromNativeWindow() {
if (lifecycleState == null) {
handleAppLifecycleStateChanged(_parseAppLifecycleMessage(message: window.initialLifecycleState));
}
readonly List<FrameCallback> _persistentCallbacks = new List<FrameCallback>();
protected virtual void handleAppLifecycleStateChanged(AppLifecycleState state) {
lifecycleState = state;
switch (state) {
case AppLifecycleState.resumed:
case AppLifecycleState.inactive:
_setFramesEnabledState(true);
break;
case AppLifecycleState.paused:
case AppLifecycleState.detached:
_setFramesEnabledState(false);
break;
}
}
static AppLifecycleState _parseAppLifecycleMessage(string message) {
switch (message) {
case "AppLifecycleState.paused":
return AppLifecycleState.paused;
case "AppLifecycleState.resumed":
return AppLifecycleState.resumed;
case "AppLifecycleState.inactive":
return AppLifecycleState.inactive;
case "AppLifecycleState.detached":
return AppLifecycleState.detached;
}
public void addPersistentFrameCallback(FrameCallback callback) {
_persistentCallbacks.Add(callback);
throw new Exception("unknown AppLifecycleState: " + message);
readonly List<FrameCallback> _postFrameCallbacks = new List<FrameCallback>();
public Future scheduleTask<T>(
TaskCallback<T> task,
Priority priority) {
var isFirstTask = _taskQueue.isEmpty;
var entry = new _TaskEntry<T>(
task: task,
priority: priority.value
);
_taskQueue.enqueue(item: entry);
if (isFirstTask && !locked) {
_ensureEventLoopCallback();
}
return entry.completer.future;
}
public void addPostFrameCallback(FrameCallback callback) {
_postFrameCallbacks.Add(callback);
protected override void unlocked() {
base.unlocked();
if (_taskQueue.isNotEmpty) {
_ensureEventLoopCallback();
}
public bool hasScheduledFrame {
get { return _hasScheduledFrame; }
void _ensureEventLoopCallback() {
D.assert(result: !locked);
D.assert(_taskQueue.count != 0);
if (_hasRequestedAnEventLoopCallback) {
return;
}
_hasRequestedAnEventLoopCallback = true;
Timer.run(callback: _runTasks);
bool _hasScheduledFrame = false;
object _runTasks() {
_hasRequestedAnEventLoopCallback = false;
if (handleEventLoopCallback()) {
_ensureEventLoopCallback(); // runs next task when there's time
}
public SchedulerPhase schedulerPhase {
get { return _schedulerPhase; }
return null;
SchedulerPhase _schedulerPhase = SchedulerPhase.idle;
bool handleEventLoopCallback() {
if (_taskQueue.isEmpty || locked) {
return false;
}
public bool framesEnabled {
get { return _framesEnabled; }
set {
if (_framesEnabled == value) {
return;
var entry = _taskQueue.first;
if (schedulingStrategy(priority: entry.priority, this)) {
try {
_taskQueue.removeFirst();
entry.run();
catch (Exception exception) {
string callbackStack = null;
D.assert(() => {
callbackStack = entry.debugStack;
return true;
});
_framesEnabled = value;
if (value) {
scheduleFrame();
IEnumerable<DiagnosticsNode> infoCollector() {
yield return DiagnosticsNode.message(
"\nThis exception was thrown in the context of a scheduler callback. " +
"When the scheduler callback was _registered_ (as opposed to when the " +
"exception was thrown), this was the stack: " + callbackStack);
}
UIWidgetsError.reportError(new UIWidgetsErrorDetails(
exception: exception,
"scheduler library",
new ErrorDescription("during a task callback"),
informationCollector: callbackStack == null
? (InformationCollector) null
: infoCollector
));
return _taskQueue.isNotEmpty;
return false;
bool _framesEnabled = true; // todo: set it to false when app switched to background
public int scheduleFrameCallback(FrameCallback callback, bool rescheduling = false) {
scheduleFrame();
_nextFrameCallbackId += 1;
_transientCallbacks[key: _nextFrameCallbackId] =
new _FrameCallbackEntry(callback: callback, rescheduling: rescheduling);
return _nextFrameCallbackId;
}
public void cancelFrameCallbackWithId(int id) {
D.assert(id > 0);
_transientCallbacks.Remove(key: id);
_removedIds.Add(item: id);
}
public void addPersistentFrameCallback(FrameCallback callback) {
_persistentCallbacks.Add(item: callback);
}
public void addPostFrameCallback(FrameCallback callback) {
_postFrameCallbacks.Add(item: callback);
}
void _setFramesEnabledState(bool enabled) {
if (framesEnabled == enabled) {
return;
}
framesEnabled = enabled;
if (enabled) {
scheduleFrame();
}
}
protected void ensureFrameCallbacksRegistered() {
window.onBeginFrame = window.onBeginFrame ?? _handleBeginFrame;
window.onDrawFrame = window.onDrawFrame ?? _handleDrawFrame;
}
public void ensureVisualUpdate() {
switch (schedulerPhase) {

}
public void scheduleFrame() {
if (_hasScheduledFrame || !_framesEnabled) {
if (hasScheduledFrame || !framesEnabled) {
return;
}

return true;
});
ensureFrameCallbacksRegistered();
_hasScheduledFrame = true;
hasScheduledFrame = true;
if (_hasScheduledFrame) {
if (!framesEnabled) {
return;
}
if (hasScheduledFrame) {
return;
}

return true;
});
ensureFrameCallbacksRegistered();
_hasScheduledFrame = true;
hasScheduledFrame = true;
TimeSpan? _firstRawTimeStampInEpoch;
TimeSpan _epochStart = TimeSpan.Zero;
TimeSpan _lastRawTimeStamp = TimeSpan.Zero;
public void scheduleWarmUpFrame() {
if (_warmUpFrame || schedulerPhase != SchedulerPhase.idle) {
return;
}
_warmUpFrame = true;
Timeline.startSync("Warm-up frame");
var hadScheduledFrame = hasScheduledFrame;
// We use timers here to ensure that microtasks flush in between.
Timer.run(() => {
D.assert(result: _warmUpFrame);
handleBeginFrame(null);
return null;
});
Timer.run(() => {
D.assert(result: _warmUpFrame);
handleDrawFrame();
// We call resetEpoch after this frame so that, in the hot reload case,
// the very next frame pretends to have occurred immediately after this
// warm-up frame. The warm-up frame's timestamp will typically be far in
// the past (the time of the last real frame), so if we didn't reset the
// epoch we would see a sudden jump from the old time in the warm-up frame
// to the new time in the "real" frame. The biggest problem with this is
// that implicit animations end up being triggered at the old time and
// then skipping every frame and finishing in the new time.
resetEpoch();
_warmUpFrame = false;
if (hadScheduledFrame) {
scheduleFrame();
}
return null;
});
// Lock events so touch events etc don't insert themselves until the
// scheduled frame has finished.
lockEvents(() => endOfFrame.then(v => {
Timeline.finishSync();
return FutureOr.nil;
}));
}
_epochStart = _adjustForEpoch(_lastRawTimeStamp);
_epochStart = _adjustForEpoch(rawTimeStamp: currentSystemFrameTimeStamp);
_firstRawTimeStampInEpoch = null;
}

: rawTimeStamp - _firstRawTimeStampInEpoch.Value;
return new TimeSpan((long) (rawDurationSinceEpoch.Ticks / timeDilation) + _epochStart.Ticks);
return new TimeSpan((long) (rawDurationSinceEpoch.Ticks / scheduler_.timeDilation) +
_epochStart.Ticks);
public TimeSpan currentFrameTimeStamp {
get { return _currentFrameTimeStamp.Value; }
}
TimeSpan? _currentFrameTimeStamp;
void _handleBeginFrame(TimeSpan rawTimeStamp) {
if (_warmUpFrame) {
D.assert(result: !_ignoreNextEngineDrawFrame);
_ignoreNextEngineDrawFrame = true;
return;
}
int _profileFrameNumber = 0;
string _debugBanner;
void _handleBeginFrame(TimeSpan rawTimeStamp) {
handleBeginFrame(rawTimeStamp);
handleBeginFrame(rawTimeStamp: rawTimeStamp);
if (_ignoreNextEngineDrawFrame) {
_ignoreNextEngineDrawFrame = false;
return;
}
Timeline.startSync("Frame");
_currentFrameTimeStamp = _adjustForEpoch(rawTimeStamp ?? _lastRawTimeStamp);
_currentFrameTimeStamp = _adjustForEpoch(rawTimeStamp ?? currentSystemFrameTimeStamp);
_lastRawTimeStamp = rawTimeStamp.Value;
currentSystemFrameTimeStamp = rawTimeStamp.Value;
_profileFrameNumber += 1;
return true;
});
_debugFrameNumber += 1;
D.assert(() => {
_debugDescribeTimeStamp(
_currentFrameTimeStamp.Value, frameTimeStampDescription);
} else {
_debugDescribeTimeStamp(timeStamp: _currentFrameTimeStamp.Value,
buffer: frameTimeStampDescription);
}
else {
$"▄▄▄▄▄▄▄▄ Frame {_profileFrameNumber.ToString().PadRight(7)} {frameTimeStampDescription.ToString().PadLeft(18)} ▄▄▄▄▄▄▄▄";
$"▄▄▄▄▄▄▄▄ Frame {_debugFrameNumber.ToString().PadRight(7)} ${frameTimeStampDescription.ToString().PadLeft(18)} ▄▄▄▄▄▄▄▄";
Debug.Log(_debugBanner);
Debug.Log(message: _debugBanner);
}
}

D.assert(_schedulerPhase == SchedulerPhase.idle);
_hasScheduledFrame = false;
D.assert(schedulerPhase == SchedulerPhase.idle);
hasScheduledFrame = false;
_schedulerPhase = SchedulerPhase.transientCallbacks;
Timeline.startSync("Animate");
schedulerPhase = SchedulerPhase.transientCallbacks;
if (!_removedIds.Contains(entry.Key)) {
if (!_removedIds.Contains(item: entry.Key)) {
entry.Value.callback, _currentFrameTimeStamp.Value, entry.Value.debugStack);
callback: entry.Value.callback, timeStamp: _currentFrameTimeStamp.Value,
callbackStack: entry.Value.debugStack);
} finally {
_schedulerPhase = SchedulerPhase.midFrameMicrotasks;
}
finally {
schedulerPhase = SchedulerPhase.midFrameMicrotasks;
D.assert(_schedulerPhase == SchedulerPhase.midFrameMicrotasks);
D.assert(schedulerPhase == SchedulerPhase.midFrameMicrotasks);
Timeline.finishSync();
_schedulerPhase = SchedulerPhase.persistentCallbacks;
foreach (FrameCallback callback in _persistentCallbacks) {
_invokeFrameCallback(callback, _currentFrameTimeStamp.Value);
schedulerPhase = SchedulerPhase.persistentCallbacks;
foreach (var callback in _persistentCallbacks) {
_invokeFrameCallback(callback: callback, timeStamp: _currentFrameTimeStamp.Value);
_schedulerPhase = SchedulerPhase.postFrameCallbacks;
var localPostFrameCallbacks = new List<FrameCallback>(_postFrameCallbacks);
schedulerPhase = SchedulerPhase.postFrameCallbacks;
var localPostFrameCallbacks = new List<FrameCallback>(collection: _postFrameCallbacks);
foreach (FrameCallback callback in localPostFrameCallbacks) {
_invokeFrameCallback(callback, _currentFrameTimeStamp.Value);
foreach (var callback in localPostFrameCallbacks) {
_invokeFrameCallback(callback: callback, timeStamp: _currentFrameTimeStamp.Value);
} finally {
_schedulerPhase = SchedulerPhase.idle;
}
finally {
schedulerPhase = SchedulerPhase.idle;
Debug.Log(new string('▀', _debugBanner.Length));
Debug.Log(new string('▀', count: _debugBanner.Length));
}
_debugBanner = null;

}
}
void _profileFramePostEvent(int frameNumber, FrameTiming frameTiming) {
developer_.postEvent("Flutter.Frame", new Hashtable {
{"number", frameNumber},
{"startTime", frameTiming.timestampInMicroseconds(phase: FramePhase.buildStart)},
{"elapsed", (int) (frameTiming.totalSpan.TotalMilliseconds * 1000)},
{"build", (int) (frameTiming.buildDuration.TotalMilliseconds * 1000)},
{"raster", (int) (frameTiming.rasterDuration.TotalMilliseconds * 1000)}
});
}
buffer.AppendFormat("{0}d ", timeStamp.Days);
buffer.AppendFormat("{0}d ", arg0: timeStamp.Days);
buffer.AppendFormat("{0}h ", timeStamp.Hours);
buffer.AppendFormat("{0}h ", arg0: timeStamp.Hours);
buffer.AppendFormat("{0}m ", timeStamp.Minutes);
buffer.AppendFormat("{0}m ", arg0: timeStamp.Minutes);
buffer.AppendFormat("{0}s ", timeStamp.Seconds);
buffer.AppendFormat("{0}s ", arg0: timeStamp.Seconds);
buffer.AppendFormat("{0}", timeStamp.Milliseconds);
buffer.AppendFormat("{0}", arg0: timeStamp.Milliseconds);
int microseconds = (int) (timeStamp.Ticks % 10000 / 10);
var microseconds = (int) (timeStamp.Ticks % 10000 / 10);
if (microseconds > 0) {
buffer.AppendFormat(".{0}", microseconds.ToString().PadLeft(3, '0'));
}

});
try {
callback(timeStamp);
} catch (Exception ex) {
callback(timeStamp: timeStamp);
}
catch (Exception ex) {
IEnumerable<DiagnosticsNode> infoCollector() {
yield return DiagnosticsNode.message(
"\nThis exception was thrown in the context of a scheduler callback. " +
"When the scheduler callback was _registered_ (as opposed to when the " +
"exception was thrown), this was the stack:");
var builder = new StringBuilder();
foreach (var line in UIWidgetsError.defaultStackFilter(
callbackStack.TrimEnd().Split('\n'))) {
builder.AppendLine(value: line);
}
yield return DiagnosticsNode.message(builder.ToString());
}
library: "scheduler library",
context: "during a scheduler callback",
"scheduler library",
new ErrorDescription("during a scheduler callback"),
: information => {
information.AppendLine(
"\nThis exception was thrown in the context of a scheduler callback. " +
"When the scheduler callback was _registered_ (as opposed to when the " +
"exception was thrown), this was the stack:"
);
UIWidgetsError.defaultStackFilter(callbackStack.TrimEnd().Split('\n'))
.Each((line) => information.AppendLine(line));
}
: infoCollector
));
}

});
}
}
}*/
public static partial class scheduler_ {
public static bool defaultSchedulingStrategy(int priority, SchedulerBinding scheduler) {
if (scheduler.transientCallbackCount > 0) {
return priority >= Priority.animation.value;
}
return true;
}
}
}

4
com.unity.uiwidgets/Runtime/scheduler/binding.cs.meta


fileFormatVersion: 2
guid: 6b74179dadff469cb8ee1f7b2ff51ae7
timeCreated: 1534227207
guid: 0756240ed259436a82cdc6ee65831a4f
timeCreated: 1599458325

158
com.unity.uiwidgets/Runtime/scheduler/ticker.cs


/*
using System.Collections.Generic;
using RSG;
using RSG.Promises;
using Unity.UIWidgets.async;
using UnityEngine;
namespace Unity.UIWidgets.scheduler {
namespace Unity.UIWidgets.scheduler2 {
public delegate void TickerCallback(TimeSpan elapsed);
public interface TickerProvider {

public class Ticker {
public Ticker(TickerCallback onTick, Func<string> debugLabel = null) {
public class Ticker : IDisposable {
public Ticker(TickerCallback onTick, string debugLabel = null) {
_debugCreationStack = "skipped, use StackTraceUtility.ExtractStackTrace() if you need it"; // StackTraceUtility.ExtractStackTrace();
_debugCreationStack = StackTraceUtility.ExtractStackTrace();
return true;
});
_onTick = onTick;

TickerFutureImpl _future;
TickerFuture _future;
get { return _muted; }
get => _muted;
if (value == _muted) {
if (value == _muted)
}
_muted = value;
if (value) {

public bool isTicking {
get {
if (_future == null) {
if (_future == null)
}
if (muted) {
if (muted)
}
if (SchedulerBinding.instance.framesEnabled) {
if (SchedulerBinding.instance.framesEnabled)
}
if (SchedulerBinding.instance.schedulerPhase != SchedulerPhase.idle) {
if (SchedulerBinding.instance.schedulerPhase != SchedulerPhase.idle)
}
return false;
}
}

D.assert(() => {
if (isActive) {
throw new UIWidgetsError(
"A ticker that is already active cannot be started again without first stopping it.\n" +
"The affected ticker was: " + toString(debugIncludeStack: true));
new List<DiagnosticsNode>() {
new ErrorSummary("A ticker was started twice."),
new ErrorDescription(
"A ticker that is already active cannot be started again without first stopping it."),
describeForError("The affected ticker was: ")
});
_future = new TickerFutureImpl();
_future = new TickerFuture();
if (shouldScheduleTick) {
scheduleTick();
}

return _future;
}
public DiagnosticsNode describeForError(string name) {
return new DiagnosticsProperty<Ticker>(name, this, description: toString(debugIncludeStack: true));
}
if (!isActive) {
if (!isActive)
}
var localFuture = _future;
_future = null;

int? _animationId;
protected bool scheduled {
get { return _animationId != null; }
get => _animationId != null;
protected bool shouldScheduleTick {
get { return !muted && isActive && !scheduled; }
}
protected bool shouldScheduleTick => !muted && isActive && !scheduled;
void _tick(TimeSpan timeStamp) {
D.assert(isTicking);

_startTime = _startTime ?? timeStamp;
if (shouldScheduleTick) {
if (shouldScheduleTick)
}
}
protected void scheduleTick(bool rescheduling = false) {

originalTicker.unscheduleTick();
}
originalTicker.dispose();
originalTicker.Dispose();
public virtual void dispose() {
public virtual void Dispose() {
if (_future != null) {
var localFuture = _future;
_future = null;

}
D.assert(() => {
_startTime = default(TimeSpan);
_startTime = TimeSpan.Zero;
internal readonly Func<string> debugLabel;
string _debugCreationStack;
public readonly string debugLabel;
internal string _debugCreationStack;
public override string ToString() {
return toString(debugIncludeStack: false);

var buffer = new StringBuilder();
buffer.Append(GetType() + "(");
D.assert(() => {
if (debugLabel != null) {
buffer.Append(debugLabel());
}
buffer.Append(debugLabel ?? "");
return true;
});
buffer.Append(')');

buffer.AppendLine("The stack trace when the " + GetType() + " was actually created was:");
UIWidgetsError.defaultStackFilter(_debugCreationStack.TrimEnd().Split('\n'))
.Each(line => buffer.AppendLine(line));
buffer.AppendLine("The stack trace when the " + GetType() + " was actually created was: ");
foreach (var line in UIWidgetsError.defaultStackFilter(
_debugCreationStack.TrimEnd().Split('\n'))) {
buffer.AppendLine(line);
}
}
return true;

}
public interface TickerFuture : IPromise {
void whenCompleteOrCancel(VoidCallback callback);
IPromise orCancel { get; }
}
public class TickerFuture : Future {
internal TickerFuture() {
}
public class TickerFutureImpl : Promise, TickerFuture {
var result = new TickerFutureImpl();
var result = new TickerFuture();
Promise _secondaryCompleter;
bool? _completed;
readonly Completer _primaryCompleter = Completer.create();
Completer _secondaryCompleter;
bool? _completed; // null means unresolved, true means complete, false means canceled
Resolve();
if (_secondaryCompleter != null) {
_secondaryCompleter.Resolve();
}
_primaryCompleter.complete();
_secondaryCompleter?.complete();
if (_secondaryCompleter != null) {
_secondaryCompleter.Reject(new TickerCanceled(ticker));
}
_secondaryCompleter?.completeError(new TickerCanceled(ticker));
orCancel.Then(() => callback(), ex => callback());
orCancel.then((value) => {
callback();
return FutureOr.nil;
}, ex => {
callback();
return FutureOr.nil;
});
public IPromise orCancel {
public Future orCancel {
_secondaryCompleter = new Promise();
_secondaryCompleter = Completer.create();
_secondaryCompleter.Resolve();
_secondaryCompleter.complete();
_secondaryCompleter.Reject(new TickerCanceled());
_secondaryCompleter.completeError(new TickerCanceled());
return _secondaryCompleter;
return _secondaryCompleter.future;
// public override Stream asStream() {
// return _primaryCompleter.future.asStream();
// }
public override Future catchError(Func<Exception, FutureOr> onError, Func<Exception, bool> test = null) {
return _primaryCompleter.future.catchError(onError, test: test);
}
public override Future then(Func<object, FutureOr> onValue, Func<Exception, FutureOr> onError = null) {
return _primaryCompleter.future.then(onValue, onError: onError);
}
public override Future timeout(TimeSpan timeLimit, Func<FutureOr> onTimeout = null) {
return _primaryCompleter.future.timeout(timeLimit, onTimeout: onTimeout);
}
public override Future whenComplete(Func<FutureOr> action) {
return _primaryCompleter.future.whenComplete(action);
}
public override string ToString() =>
$"{foundation_.describeIdentity(this)}({(_completed == null ? "active" : (_completed.Value ? "complete" : "canceled"))})";
public class TickerCanceled : Exception {
public TickerCanceled(Ticker ticker = null) {

return "The ticker was canceled before the \"orCancel\" property was first used.";
}
}
}*/
}

4
com.unity.uiwidgets/Runtime/scheduler/ticker.cs.meta


fileFormatVersion: 2
guid: 3fb425debd2a441cadf8ad4a4fed3aa1
timeCreated: 1536717302
guid: 9ee135f21ca64943a5f75a04a0e30cc3
timeCreated: 1599458326

4
com.unity.uiwidgets/Runtime/services/asset_bundle.cs


using System.Collections;
using System.Collections.Generic;
using System.Text;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;
using UnityEngine.Networking;

2
com.unity.uiwidgets/Runtime/services/binary_messenger.cs


using System;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.ui;

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


using System;
using System.Collections.Generic;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.gestures;
using Unity.UIWidgets.ui;

2
com.unity.uiwidgets/Runtime/services/clipboard.cs


using System.Runtime.InteropServices;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using UnityEngine;
namespace Unity.UIWidgets.service {

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


using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using Unity.UIWidgets.async2;
using Unity.UIWidgets.async;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.external.simplejson;
using Unity.UIWidgets.foundation;

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

正在加载...
取消
保存