guanghuispark
3 年前
当前提交
9b5d28e8
共有 678 个文件被更改,包括 3362 次插入 和 3165 次删除
-
5.yamato/upm-ci.yml
-
246README-ZH.md
-
276README.md
-
7Samples/UIWidgetsSamples_2019_4/Assets/CountDemo.cs
-
84Samples/UIWidgetsSamples_2019_4/Assets/CountDemo.unity
-
17Samples/UIWidgetsSamples_2019_4/Assets/Editor/EditorWindowSample/GalleryMain.cs
-
4Samples/UIWidgetsSamples_2019_4/Assets/Editor/EditorWindowSample/UIWidgetsEditorWindowSample.asmdef
-
2Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/BottomAppBarSample.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/DividerAndButton.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/MaterialAppBarSample.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/MaterialButtonSample.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/MaterialInkWellSample.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/MaterialNavigationBarSample.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/MaterialSliderSample.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/MaterialTabBarSample.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/MaterialThemeSample.cs
-
4Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/NavigatorPopSample.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/NetWorkImageSample.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/ReorderableListSample.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/MaterialSample/TableSample.cs
-
52Samples/UIWidgetsSamples_2019_4/Assets/Scene/TextTest.unity
-
3Samples/UIWidgetsSamples_2019_4/Assets/Script/CountTest.cs
-
3Samples/UIWidgetsSamples_2019_4/Assets/Script/ImageTest.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/Script/TextFieldTest.cs
-
90Samples/UIWidgetsSamples_2019_4/Assets/Script/TextTest.cs
-
28Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/GalleryMain.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/cupertino/cupertino_refresh_demo.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/cupertino/cupertino_segmented_control_demo.cs
-
239Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/bottom_app_bar_demo.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/bottom_navigation_demo.cs
-
4Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/cards_demo.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/date_and_time_picker_demo.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/leave_behind_demo.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/overscroll_demo.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/material/text_form_field_demo.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/shrine/expanding_bottom_sheet.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/shrine/model/scoped_model.cs
-
4Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/app.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/demo.cs
-
3Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/demos.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/home.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/gallery/updater.cs
-
3Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/CustomPaintSample.cs
-
4Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/DragDropSample.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/ExpansionPanelSample.cs
-
101Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/HttpRequestSample.cs
-
4Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/LongPressSample.cs
-
3Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/NavigationSample.cs
-
3Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/PageViewSample.cs
-
3Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/ScrollbarSample.cs
-
4Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/ToDoAppSample.cs
-
2Samples/UIWidgetsSamples_2019_4/Assets/WidgetsSample/UIWidgetsSamplePanel.cs
-
2Samples/UIWidgetsSamples_2019_4/ProjectSettings/ProjectVersion.txt
-
3add_sample.sh
-
21com.unity.uiwidgets/CHANGELOG.md
-
144com.unity.uiwidgets/Editor/UIWidgetsEditorPanel.cs
-
28com.unity.uiwidgets/Editor/UIWidgetsPanelEditor.cs
-
2com.unity.uiwidgets/LICENSE.md
-
2com.unity.uiwidgets/Runtime/Plugins.meta
-
6com.unity.uiwidgets/Runtime/animation/animation_controller.cs
-
2com.unity.uiwidgets/Runtime/animation/tween_sequence.cs
-
267com.unity.uiwidgets/Runtime/async/timer.cs
-
2com.unity.uiwidgets/Runtime/cupertino/button.cs
-
2com.unity.uiwidgets/Runtime/cupertino/context_menu.cs
-
2com.unity.uiwidgets/Runtime/cupertino/context_menu_action.cs
-
32com.unity.uiwidgets/Runtime/cupertino/date_picker.cs
-
2com.unity.uiwidgets/Runtime/cupertino/localization.cs
-
683com.unity.uiwidgets/Runtime/cupertino/nav_bar.cs
-
4com.unity.uiwidgets/Runtime/cupertino/refresh.cs
-
2com.unity.uiwidgets/Runtime/cupertino/route.cs
-
2com.unity.uiwidgets/Runtime/cupertino/scrollbar.cs
-
2com.unity.uiwidgets/Runtime/cupertino/slider.cs
-
2com.unity.uiwidgets/Runtime/cupertino/switch.cs
-
101com.unity.uiwidgets/Runtime/engine/DisplayMetrics.cs
-
23com.unity.uiwidgets/Runtime/engine/UIWidgetsMessageManager.cs
-
653com.unity.uiwidgets/Runtime/engine/UIWidgetsPanel.cs
-
4com.unity.uiwidgets/Runtime/engine/UIWidgetsPanel.cs.meta
-
5com.unity.uiwidgets/Runtime/external/SplayTree.cs
-
2com.unity.uiwidgets/Runtime/external/simplejson/SimpleJSON.cs
-
7com.unity.uiwidgets/Runtime/foundation/assertions.cs
-
4com.unity.uiwidgets/Runtime/foundation/basic_types.cs
-
2com.unity.uiwidgets/Runtime/foundation/binding.cs
-
21com.unity.uiwidgets/Runtime/foundation/collections.cs
-
110com.unity.uiwidgets/Runtime/foundation/debug.cs
-
19com.unity.uiwidgets/Runtime/foundation/diagnostics.cs
-
2com.unity.uiwidgets/Runtime/foundation/isolates.cs
-
2com.unity.uiwidgets/Runtime/foundation/synchronous_future.cs
-
6com.unity.uiwidgets/Runtime/gestures/binding.cs
-
26com.unity.uiwidgets/Runtime/gestures/events.cs
-
2com.unity.uiwidgets/Runtime/gestures/force_press.cs
-
5com.unity.uiwidgets/Runtime/gestures/hit_test.cs
-
2com.unity.uiwidgets/Runtime/gestures/multidrag.cs
-
2com.unity.uiwidgets/Runtime/gestures/multitap.cs
-
2com.unity.uiwidgets/Runtime/gestures/recognizer.cs
-
4com.unity.uiwidgets/Runtime/material/about.cs
-
103com.unity.uiwidgets/Runtime/material/animated_icons/animated_icons.cs
-
4com.unity.uiwidgets/Runtime/material/animated_icons/animated_icons_data.cs
-
992com.unity.uiwidgets/Runtime/material/animated_icons/data/add_event.g.cs
-
982com.unity.uiwidgets/Runtime/material/animated_icons/data/arrow_menu.g.cs
-
982com.unity.uiwidgets/Runtime/material/animated_icons/data/close_menu.g.cs
|
|||
using System.Collections.Generic; |
|||
using Unity.UIWidgets.engine2; |
|||
using ui_ = Unity.UIWidgets.widgets.ui_; |
|||
using Unity.UIWidgets.engine; |
|||
using Unity.UIWidgets.widgets; |
|||
namespace UIWidgetsGallery { |
|||
public class GalleryMain : UIWidgetsPanel { |
|||
protected override void main() { |
|||
namespace UIWidgetsGallery |
|||
{ |
|||
public class GalleryMain : UIWidgetsPanel |
|||
{ |
|||
protected new void OnEnable() |
|||
{ |
|||
base.OnEnable(); |
|||
} |
|||
|
|||
protected override void main() |
|||
{ |
|||
protected new void OnEnable() { |
|||
base.OnEnable(); |
|||
protected override void onEnable() |
|||
{ |
|||
AddFont("Material Icons", new List<string> {"MaterialIcons-Regular.ttf"}, new List<int> {0}); |
|||
AddFont("CupertinoIcons", new List<string> {"CupertinoIcons.ttf"}, new List<int> {0}); |
|||
AddFont("GalleryIcons", new List<string> {"gallery/GalleryIcons.ttf"}, new List<int> {0}); |
|||
} |
|||
} |
|
|||
m_EditorVersion: 2019.4.2f1 |
|||
m_EditorVersionWithRevision: 2019.4.2f1 (f997fc5c673b) |
|||
m_EditorVersionWithRevision: 2019.4.2f1 (f997fc5c673b) |
|
|||
UIWidgets copyright © 2020 Unity Technologies ApS |
|||
UIWidgets copyright © 2021 Unity Technologies ApS |
|||
|
|||
Licensed under the Unity Companion License for Unity-dependent projects--see [Unity Companion License](http://www.unity3d.com/legal/licenses/Unity_Companion_License). |
|||
|
|
|||
/* |
|||
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); |
|||
}*/ |
|||
} |
683
com.unity.uiwidgets/Runtime/cupertino/nav_bar.cs
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 5f8434687aa245d9ae7f766b6109166b |
|||
timeCreated: 1545642183 |
|||
guid: 305c123a2a944eba8f2b397a962323ff |
|||
timeCreated: 1597215247 |
992
com.unity.uiwidgets/Runtime/material/animated_icons/data/add_event.g.cs
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
982
com.unity.uiwidgets/Runtime/material/animated_icons/data/arrow_menu.g.cs
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
982
com.unity.uiwidgets/Runtime/material/animated_icons/data/close_menu.g.cs
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
部分文件因为文件数量过多而无法显示
撰写
预览
正在加载...
取消
保存
Reference in new issue