浏览代码

Merge pull request #201 from UnityTech/yczhang

Cleanup Warnings.
/main
GitHub 6 年前
当前提交
01f8e36d
共有 11 个文件被更改,包括 41 次插入16 次删除
  1. 4
      Runtime/debugger/diagnostics.cs
  2. 2
      Runtime/flow/physical_shape_layer.cs
  3. 5
      Runtime/foundation/key.cs
  4. 2
      Runtime/material/slider_theme.cs
  5. 2
      Runtime/material/text_field.cs
  6. 20
      Runtime/painting/fractional_offset.cs
  7. 6
      Runtime/rendering/object.mixin.gen.cs
  8. 3
      Runtime/rendering/paragraph.cs
  9. 5
      Runtime/widgets/nested_scroll_view.cs
  10. 6
      Tests/Editor/SceneViewTests.cs
  11. 2
      Tests/Editor/Widgets.cs

4
Runtime/debugger/diagnostics.cs


using Unity.UIWidgets.ui;
namespace Unity.UIWidgets.debugger {
#pragma warning disable 0659
#pragma warning disable 0661
public class DiagnosticsNode : IEquatable<DiagnosticsNode> {
readonly Dictionary<string, object> _json; // todo use json class such as simple json
public readonly bool isProperty;

}
}
}
#pragma warning restore 0659
#pragma warning restore 0661
public class InspectorInstanceRef : IEquatable<InspectorInstanceRef> {
public readonly string id;

2
Runtime/flow/physical_shape_layer.cs


Color _shadow_color;
float _device_pixel_ratio;
Path _path;
#pragma warning disable 0414
#pragma warning restore 0414
Rect _frameRRect;
Clip _clip_behavior;

5
Runtime/foundation/key.cs


using System.Collections.Generic;
namespace Unity.UIWidgets.foundation {
#pragma warning disable 0660
#pragma warning disable 0661
public abstract class Key {
protected Key() {
}

return !Equals(left, right);
}
}
#pragma warning restore 0660
#pragma warning restore 0661
public abstract class LocalKey : Key {
protected LocalKey() {

2
Runtime/material/slider_theme.cs


return true;
}
#pragma warning disable 0162
Offset leftCenter = _topLobeCenter - new Offset(leftWidthNeeded, 0.0f) + neckStretch;
Offset rightCenter = _topLobeCenter + new Offset(rightWidthNeeded, 0.0f) + neckStretch;
Rect valueRect = Rect.fromLTRB(

outlinePaint.strokeWidth = 1.0f;
canvas.drawRect(valueRect, outlinePaint);
return true;
#pragma warning restore 0162
});
_addArc(

2
Runtime/material/text_field.cs


formatters.Add(new LengthLimitingTextInputFormatter(this.widget.maxLength));
}
bool forcePressEnabled = false;
// bool forcePressEnabled = false; // TODO: wait for force press is ready
TextSelectionControls textSelectionControls = MaterialUtils.materialTextSelectionControls;;
bool paintCursorAboveText = false;
bool cursorOpacityAnimates = false;

20
Runtime/painting/fractional_offset.cs


get { return (this.y + 1.0f) / 2.0f; }
}
public readonly FractionalOffset topLeft = new FractionalOffset(0.0f, 0.0f);
#pragma warning disable 0108
public static readonly FractionalOffset topLeft = new FractionalOffset(0.0f, 0.0f);
public readonly FractionalOffset topCenter = new FractionalOffset(0.5f, 0.0f);
public static readonly FractionalOffset topCenter = new FractionalOffset(0.5f, 0.0f);
public readonly FractionalOffset topRight = new FractionalOffset(1.0f, 0.0f);
public static readonly FractionalOffset topRight = new FractionalOffset(1.0f, 0.0f);
public readonly FractionalOffset centerLeft = new FractionalOffset(0.0f, 0.5f);
public static readonly FractionalOffset centerLeft = new FractionalOffset(0.0f, 0.5f);
public readonly FractionalOffset center = new FractionalOffset(0.5f, 0.5f);
public static readonly FractionalOffset center = new FractionalOffset(0.5f, 0.5f);
public readonly FractionalOffset centerRight = new FractionalOffset(1.0f, 0.5f);
public static readonly FractionalOffset centerRight = new FractionalOffset(1.0f, 0.5f);
public readonly FractionalOffset bottomLeft = new FractionalOffset(0.0f, 1.0f);
public static readonly FractionalOffset bottomLeft = new FractionalOffset(0.0f, 1.0f);
public readonly FractionalOffset bottomCenter = new FractionalOffset(0.5f, 1.0f);
public static readonly FractionalOffset bottomCenter = new FractionalOffset(0.5f, 1.0f);
public readonly FractionalOffset bottomRight = new FractionalOffset(1.0f, 1.0f);
public static readonly FractionalOffset bottomRight = new FractionalOffset(1.0f, 1.0f);
#pragma warning restore 0108
public static Alignment operator -(FractionalOffset a, Alignment b) {
if (!(b is FractionalOffset)) {

6
Runtime/rendering/object.mixin.gen.cs


namespace Unity.UIWidgets.rendering {
public abstract class RenderObjectWithChildMixinRenderObject<ChildType> : RenderObject, RenderObjectWithChildMixin<ChildType>, RenderObjectWithChildMixin where ChildType : RenderObject {
public bool debugValidateChild(RenderObject child) {
public virtual bool debugValidateChild(RenderObject child) {
D.assert(() => {
if (!(child is ChildType)) {
throw new UIWidgetsError(

public abstract class RenderObjectWithChildMixinRenderBox<ChildType> : RenderBox, RenderObjectWithChildMixin<ChildType>, RenderObjectWithChildMixin where ChildType : RenderObject {
public bool debugValidateChild(RenderObject child) {
public virtual bool debugValidateChild(RenderObject child) {
D.assert(() => {
if (!(child is ChildType)) {
throw new UIWidgetsError(

get { return this._childCount; }
}
public bool debugValidateChild(RenderObject child) {
public override bool debugValidateChild(RenderObject child) {
D.assert(() => {
if (!(child is ChildType)) {
throw new UIWidgetsError(

3
Runtime/rendering/paragraph.cs


}
TextSpan _previousHoverSpan;
#pragma warning disable 0414
#pragma warning restore 0414
bool _hasHoverRecognizer;
MouseTrackerAnnotation _hoverAnnotation;

5
Runtime/widgets/nested_scroll_view.cs


ScrollDirection _userScrollDirection = ScrollDirection.idle;
public void updateUserScrollDirection(ScrollDirection value) {
D.assert(value != null);
if (this.userScrollDirection == value) {
return;
}

}
public override string ToString() {
string extra;
string extra = "";
switch (this._writers) {
case 0:
extra = ", orphan";

break;
}
return "$GetType()($layoutExtent$extra)";
return $"{this.GetType()}({this.layoutExtent}{extra})";
}
}

6
Tests/Editor/SceneViewTests.cs


public class SceneViewTests {
public static void show() {
onPreSceneGUIDelegate += OnPreSceneGUI;
#pragma warning disable 0618
#pragma warning restore 0618
EditorApplication.update += Update;
SceneView.RepaintAll();

public static void hide() {
onPreSceneGUIDelegate -= OnPreSceneGUI;
#pragma warning disable 0618
#pragma warning restore 0618
#pragma warning disable 0618
public static SceneView.OnSceneFunc onPreSceneGUIDelegate {
get {
var field = typeof(SceneView).GetField("onPreSceneGUIDelegate",

field.SetValue(null, value);
}
}
#pragma warning restore 0618
static Func<Widget>[] _options;

2
Tests/Editor/Widgets.cs


const float headerHeight = 80.0f;
float _offsetY = 0.0f;
#pragma warning disable 0414
#pragma warning restore 0414
Widget _buildHeader(BuildContext context) {
return new Container(

正在加载...
取消
保存