浏览代码

Merge pull request #35 from Unity-Technologies/add_diagnosticable_mix

Add diagnosticable mix
/siyaoH-1.17-PlatformMessage
GitHub 4 年前
当前提交
0c57379a
共有 7 个文件被更改,包括 96 次插入7 次删除
  1. 2
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsExample.cs
  2. 2
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/GalleryMain.cs
  3. 2
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/cupertino/cupertino_navigation_demo.cs
  4. 18
      com.unity.uiwidgets/Runtime/foundation/diagnostics.cs
  5. 2
      com.unity.uiwidgets/Runtime/rendering/layer.cs
  6. 37
      com.unity.uiwidgets/Runtime/foundation/diagnosticable.mixin.gen.cs
  7. 40
      com.unity.uiwidgets/Runtime/foundation/diagnosticable.mixin.njk

2
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsExample.cs


using Unity.UIWidgets.animation;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
//using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;

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


using UIWidgetsGallery.gallery;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.material;
//using Unity.UIWidgets.material;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using UnityEngine;

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


//using RSG;
using Unity.UIWidgets.cupertino;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
//using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.rendering;
using Unity.UIWidgets.service;

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


}
}
public class DiagnosticableNode<T> : DiagnosticsNode where T : Diagnosticable {
public class DiagnosticableNode<T> : DiagnosticsNode where T : IDiagnosticable {
T value = null,
T value = default,
DiagnosticsTreeStyle? style = null
) : base(name: name, style: style) {
D.assert(value != null);

public string emptyBodyDescription;
}
public abstract class Diagnosticable {
public interface IDiagnosticable {
string toStringShort();
string toString(DiagnosticLevel minLevel = DiagnosticLevel.debug);
DiagnosticsNode toDiagnosticsNode(
string name = null,
DiagnosticsTreeStyle style = DiagnosticsTreeStyle.sparse);
void debugFillProperties(DiagnosticPropertiesBuilder properties);
}
public abstract class Diagnosticable : IDiagnosticable {
protected Diagnosticable() {
}

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


bool debugSubtreeNeedsAddToScene {
get {
bool result;
bool result = false;
D.assert(()=>{
result = _needsAddToScene;
return true;

37
com.unity.uiwidgets/Runtime/foundation/diagnosticable.mixin.gen.cs


namespace Unity.UIWidgets.foundation {
public class DiagnosticableMixinChangeNotifier : ChangeNotifier, IDiagnosticable {
protected DiagnosticableMixinChangeNotifier() {
}
public virtual string toStringShort() {
return foundation_.describeIdentity(this);
}
public override string ToString() {
return toString();
}
public virtual string toString(DiagnosticLevel minLevel = DiagnosticLevel.debug) {
string fullString = null;
D.assert(() => {
fullString = toDiagnosticsNode(style: DiagnosticsTreeStyle.singleLine)
.toString(minLevel: minLevel);
return true;
});
return fullString ?? toStringShort();
}
public virtual DiagnosticsNode toDiagnosticsNode(
string name = null,
DiagnosticsTreeStyle style = DiagnosticsTreeStyle.sparse) {
return new DiagnosticableNode<DiagnosticableMixinChangeNotifier>(
name: name, value: this, style: style
);
}
public virtual void debugFillProperties(DiagnosticPropertiesBuilder properties) {
}
}
}

40
com.unity.uiwidgets/Runtime/foundation/diagnosticable.mixin.njk


namespace Unity.UIWidgets.foundation {
{% macro DiagnosticableMixin(with) %}
{% set className = 'DiagnosticableMixin' + with %}
public class {{className}} : {{with}}, IDiagnosticable {
protected {{className}}() {
}
public virtual string toStringShort() {
return foundation_.describeIdentity(this);
}
public override string ToString() {
return toString();
}
public virtual string toString(DiagnosticLevel minLevel = DiagnosticLevel.debug) {
string fullString = null;
D.assert(() => {
fullString = toDiagnosticsNode(style: DiagnosticsTreeStyle.singleLine)
.toString(minLevel: minLevel);
return true;
});
return fullString ?? toStringShort();
}
public virtual DiagnosticsNode toDiagnosticsNode(
string name = null,
DiagnosticsTreeStyle style = DiagnosticsTreeStyle.sparse) {
return new DiagnosticableNode<{{className}}>(
name: name, value: this, style: style
);
}
public virtual void debugFillProperties(DiagnosticPropertiesBuilder properties) {
}
}
{% endmacro %}
{{ DiagnosticableMixin('ChangeNotifier') }}
}
正在加载...
取消
保存