浏览代码

fix some runtime errors (for CountDemo sample)

/siyaoH-1.17-PlatformMessage
xingweizhu 4 年前
当前提交
5ef31294
共有 7 个文件被更改,包括 12 次插入12 次删除
  1. 7
      Samples/UIWidgetsSamples_2019_4/Assets/CountDemo.cs
  2. 6
      Samples/UIWidgetsSamples_2019_4/Assets/CountDemo.unity
  3. 2
      com.unity.uiwidgets/Runtime/painting/text_style.cs
  4. 1
      com.unity.uiwidgets/Runtime/widgets/app.cs
  5. 1
      com.unity.uiwidgets/Runtime/widgets/basic.cs
  6. 4
      com.unity.uiwidgets/Runtime/widgets/navigator.cs
  7. 3
      com.unity.uiwidgets/Runtime/widgets/pages.cs

7
Samples/UIWidgetsSamples_2019_4/Assets/CountDemo.cs


using UnityEngine.UI;
using Text = Unity.UIWidgets.widgets.Text;
using ui_ = Unity.UIWidgets.widgets.ui_;
using TextStyle = Unity.UIWidgets.painting.TextStyle;
namespace UIWidgetsSample
{

public override Widget build(BuildContext context)
{
return new Container(
color: Color.white,
color: Color.fromARGB(255, 255, 0, 0),
new Text($"count: {count}"),
new Text($"count: {count}", style: new TextStyle(color: Color.fromARGB(255, 0 ,0 ,255))),
new CupertinoButton(
onPressed: () =>
{

});
},
child: new Container(
color: Color.black,
color: Color.fromARGB(255,0 , 255, 0),
width: 100,
height: 40
)

6
Samples/UIWidgetsSamples_2019_4/Assets/CountDemo.unity


m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_SizeDelta: {x: 500, y: 500}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1777874942
CanvasRenderer:

m_GameObject: {fileID: 1777874940}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 169ec79ce040653478e1a7725f34bbe1, type: 3}
m_Script: {fileID: 11500000, guid: 0817e3443c80cb943a03dcf7b120bd2e, type: 3}
m_RaycastTarget: 0
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:

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


return new TextStyle(
inherit: inherit ?? this.inherit,
color: this.foreground == null && foreground == null ? color ?? this.color : null,
backgroundColor: this.background == null && background == null ? color ?? this.backgroundColor : null,
backgroundColor: this.background == null && background == null ? backgroundColor ?? this.backgroundColor : null,
fontFamily: fontFamily ?? this.fontFamily,
fontFamilyFallback: fontFamilyFallback ?? this.fontFamilyFallback,
fontSize: fontSize ?? this.fontSize,

1
com.unity.uiwidgets/Runtime/widgets/app.cs


routes = routes ?? new Dictionary<string, WidgetBuilder>();
supportedLocales = supportedLocales ?? new List<Locale> {new Locale("en", "US")};
window = Window.instance;
D.assert(navigatorObservers != null);
D.assert(routes != null);
this.home = home;
this.navigatorKey = navigatorKey;

1
com.unity.uiwidgets/Runtime/widgets/basic.cs


/// The [color] parameter must not be null.
public ColoredBox(Color color = null, Widget child = null, Key key = null) : base(key: key, child: child) {
D.assert(color != null);
this.color = color;
}
/// The color to paint the background area with.
public readonly Color color;

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


widget.pages.isEmpty() || widget.onPopPage != null, () =>
"The Navigator.onPopPage must be provided to use the Navigator.pages API"
);
if (((Navigator)oldWidget).observers != widget.observers) {
if (!((Navigator)oldWidget).observers.equalsList(widget.observers)) {
foreach (NavigatorObserver observer in ((Navigator)oldWidget).observers)
observer._navigator = null;
foreach (NavigatorObserver observer in widget.observers) {

}
if (((Navigator)oldWidget).pages != widget.pages) {
if (!((Navigator)oldWidget).pages.equalsList(widget.pages)) {
D.assert(
widget.pages.isNotEmpty(), () =>
"To use the Navigator.pages, there must be at least one page in the list."

3
com.unity.uiwidgets/Runtime/widgets/pages.cs


bool fullscreenDialog = false
) : base(settings,fullscreenDialog) {
D.assert(pageBuilder != null);
D.assert(transitionsBuilder != null);
this.opaque = opaque;
this.pageBuilder = pageBuilder;
this.transitionsBuilder = transitionsBuilder ?? PagesUtils._defaultTransitionsBuilder;

正在加载...
取消
保存