From e9c1a0324a4950813966b518318235bbdc98f50c Mon Sep 17 00:00:00 2001 From: "xingwei.zhu" Date: Mon, 6 May 2019 11:17:04 +0800 Subject: [PATCH] remove utils folder --- Runtime/material/mergeable_material.cs | 1 - Runtime/painting/basic_types.cs | 17 +++++++++++++++++ Runtime/utils.meta | 8 -------- Runtime/utils/axis_direction.cs | 20 -------------------- Runtime/utils/axis_direction.cs.meta | 11 ----------- Runtime/utils/drag_utils.cs | 11 ----------- Runtime/utils/drag_utils.cs.meta | 11 ----------- Runtime/widgets/basic.cs | 1 - Runtime/widgets/drag_target.cs | 11 ++++++++--- Runtime/widgets/single_child_scroll_view.cs | 1 - 10 files changed, 25 insertions(+), 67 deletions(-) delete mode 100644 Runtime/utils.meta delete mode 100644 Runtime/utils/axis_direction.cs delete mode 100644 Runtime/utils/axis_direction.cs.meta delete mode 100644 Runtime/utils/drag_utils.cs delete mode 100644 Runtime/utils/drag_utils.cs.meta diff --git a/Runtime/material/mergeable_material.cs b/Runtime/material/mergeable_material.cs index f15d7cd6..62b5c873 100644 --- a/Runtime/material/mergeable_material.cs +++ b/Runtime/material/mergeable_material.cs @@ -4,7 +4,6 @@ using Unity.UIWidgets.painting; using Unity.UIWidgets.rendering; using Unity.UIWidgets.ui; -using Unity.UIWidgets.utils; using Unity.UIWidgets.widgets; namespace Unity.UIWidgets.material { diff --git a/Runtime/painting/basic_types.cs b/Runtime/painting/basic_types.cs index 18038e72..0e1bdab7 100644 --- a/Runtime/painting/basic_types.cs +++ b/Runtime/painting/basic_types.cs @@ -1,5 +1,6 @@ using System; using Unity.UIWidgets.ui; +using Unity.UIWidgets.widgets; namespace Unity.UIWidgets.painting { public enum RenderComparison { @@ -26,6 +27,22 @@ public enum AxisDirection { down, left, } + + public static class AxisDirectionUtils { + public static AxisDirection? getAxisDirectionFromAxisReverseAndDirectionality( + BuildContext context, + Axis axis, + bool reverse) { + switch (axis) { + case Axis.horizontal: + return reverse ? AxisDirection.left : AxisDirection.right; + case Axis.vertical: + return reverse ? AxisDirection.up : AxisDirection.down; + } + + return null; + } + } public static class AxisUtils { public static Axis flipAxis(Axis direction) { diff --git a/Runtime/utils.meta b/Runtime/utils.meta deleted file mode 100644 index 2313bc68..00000000 --- a/Runtime/utils.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 963d1b7d830374b3a915967d4721dc4a -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Runtime/utils/axis_direction.cs b/Runtime/utils/axis_direction.cs deleted file mode 100644 index 1a31bc66..00000000 --- a/Runtime/utils/axis_direction.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Unity.UIWidgets.painting; -using Unity.UIWidgets.widgets; - -namespace Unity.UIWidgets.utils { - public static class AxisDirectionUtils { - public static AxisDirection? getAxisDirectionFromAxisReverseAndDirectionality( - BuildContext context, - Axis axis, - bool reverse) { - switch (axis) { - case Axis.horizontal: - return reverse ? AxisDirection.left : AxisDirection.right; - case Axis.vertical: - return reverse ? AxisDirection.up : AxisDirection.down; - } - - return null; - } - } -} \ No newline at end of file diff --git a/Runtime/utils/axis_direction.cs.meta b/Runtime/utils/axis_direction.cs.meta deleted file mode 100644 index 3da1f213..00000000 --- a/Runtime/utils/axis_direction.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 9dd3903a956dd4113a1f550c6cb76f28 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Runtime/utils/drag_utils.cs b/Runtime/utils/drag_utils.cs deleted file mode 100644 index 4e72139b..00000000 --- a/Runtime/utils/drag_utils.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using Unity.UIWidgets.widgets; - -namespace Unity.UIWidgets.utils { - public class DragUtils { - public static List _mapAvatarsToData(List<_DragAvatar> avatars) { - return avatars.Select(avatar => avatar.data).ToList(); - } - } -} \ No newline at end of file diff --git a/Runtime/utils/drag_utils.cs.meta b/Runtime/utils/drag_utils.cs.meta deleted file mode 100644 index 953d9e32..00000000 --- a/Runtime/utils/drag_utils.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 63d65ac8718914805bc92f8dd0b52d03 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Runtime/widgets/basic.cs b/Runtime/widgets/basic.cs index 516478ae..a5c4177f 100644 --- a/Runtime/widgets/basic.cs +++ b/Runtime/widgets/basic.cs @@ -5,7 +5,6 @@ using Unity.UIWidgets.painting; using Unity.UIWidgets.rendering; using Unity.UIWidgets.ui; -using Unity.UIWidgets.utils; using UnityEngine; using Color = Unity.UIWidgets.ui.Color; using Rect = Unity.UIWidgets.ui.Rect; diff --git a/Runtime/widgets/drag_target.cs b/Runtime/widgets/drag_target.cs index 446e221b..d93b60d7 100644 --- a/Runtime/widgets/drag_target.cs +++ b/Runtime/widgets/drag_target.cs @@ -5,7 +5,6 @@ using Unity.UIWidgets.painting; using Unity.UIWidgets.rendering; using Unity.UIWidgets.ui; -using Unity.UIWidgets.utils; namespace Unity.UIWidgets.widgets { public delegate bool DragTargetWillAccept(T data); @@ -24,6 +23,12 @@ public enum DragAnchor { child, pointer } + + static class _DragUtils { + public static List _mapAvatarsToData(List<_DragAvatar> avatars) { + return avatars.Select(avatar => avatar.data).ToList(); + } + } public class Draggable : StatefulWidget { public Draggable( @@ -364,8 +369,8 @@ public override Widget build(BuildContext context) { return new MetaData( metaData: this, behavior: HitTestBehavior.translucent, - child: this.widget.builder(context, DragUtils._mapAvatarsToData(this._candidateAvatars), - DragUtils._mapAvatarsToData(this._rejectedAvatars))); + child: this.widget.builder(context, _DragUtils._mapAvatarsToData(this._candidateAvatars), + _DragUtils._mapAvatarsToData(this._rejectedAvatars))); } } diff --git a/Runtime/widgets/single_child_scroll_view.cs b/Runtime/widgets/single_child_scroll_view.cs index 1b5d42fc..ca60d4d5 100644 --- a/Runtime/widgets/single_child_scroll_view.cs +++ b/Runtime/widgets/single_child_scroll_view.cs @@ -5,7 +5,6 @@ using Unity.UIWidgets.painting; using Unity.UIWidgets.rendering; using Unity.UIWidgets.ui; -using Unity.UIWidgets.utils; using UnityEngine; using Rect = Unity.UIWidgets.ui.Rect;