From d74728b4dfff482a323ed735d209f8c1737a2239 Mon Sep 17 00:00:00 2001 From: BlackMATov Date: Wed, 7 Dec 2016 18:41:45 +0700 Subject: [PATCH] refactoring process --- .../IsoTools/Addons/Physics/IsoBoxCollider.cs | 2 +- .../Addons/Physics/IsoCapsuleCollider.cs | 8 +- .../Addons/Physics/IsoSphereCollider.cs | 2 +- Assets/IsoTools/Addons/Tiled/TiledMap.cs | 2 +- .../IsoTools/Scripts/Internal/IsoAssocList.cs | 39 ++--- Assets/IsoTools/Scripts/Internal/IsoList.cs | 8 +- Assets/IsoTools/Scripts/Internal/IsoMinMax.cs | 73 +++++++++ .../Scripts/Internal/IsoMinMax.cs.meta | 12 ++ Assets/IsoTools/Scripts/Internal/IsoPool.cs | 36 ++++ .../IsoTools/Scripts/Internal/IsoPool.cs.meta | 12 ++ Assets/IsoTools/Scripts/Internal/IsoRect.cs | 100 +++++++++++ .../IsoTools/Scripts/Internal/IsoRect.cs.meta | 12 ++ Assets/IsoTools/Scripts/Internal/IsoUtils.cs | 155 +++++------------- Assets/IsoTools/Scripts/IsoObject.cs | 8 +- Assets/IsoTools/Scripts/IsoWorld.cs | 12 +- 15 files changed, 327 insertions(+), 154 deletions(-) create mode 100644 Assets/IsoTools/Scripts/Internal/IsoMinMax.cs create mode 100644 Assets/IsoTools/Scripts/Internal/IsoMinMax.cs.meta create mode 100644 Assets/IsoTools/Scripts/Internal/IsoPool.cs create mode 100644 Assets/IsoTools/Scripts/Internal/IsoPool.cs.meta create mode 100644 Assets/IsoTools/Scripts/Internal/IsoRect.cs create mode 100644 Assets/IsoTools/Scripts/Internal/IsoRect.cs.meta diff --git a/Assets/IsoTools/Addons/Physics/IsoBoxCollider.cs b/Assets/IsoTools/Addons/Physics/IsoBoxCollider.cs index 8655ad4..799aead 100644 --- a/Assets/IsoTools/Addons/Physics/IsoBoxCollider.cs +++ b/Assets/IsoTools/Addons/Physics/IsoBoxCollider.cs @@ -65,7 +65,7 @@ namespace IsoTools.Physics { void OnDrawGizmosSelected() { var iso_object = GetComponent(); if ( iso_object && iso_object.isoWorld ) { - IsoUtils.DrawCube( + IsoUtils.DrawIsoCube( iso_object.isoWorld, iso_object.position + offset, size, diff --git a/Assets/IsoTools/Addons/Physics/IsoCapsuleCollider.cs b/Assets/IsoTools/Addons/Physics/IsoCapsuleCollider.cs index 2f9c842..cffd384 100644 --- a/Assets/IsoTools/Addons/Physics/IsoCapsuleCollider.cs +++ b/Assets/IsoTools/Addons/Physics/IsoCapsuleCollider.cs @@ -82,23 +82,23 @@ namespace IsoTools.Physics { var iso_object = GetComponent(); if ( iso_object && iso_object.isoWorld ) { if ( radius * 2 < height ) { - IsoUtils.DrawCube( + IsoUtils.DrawIsoCube( iso_object.isoWorld, iso_object.position + offset, new Vector3(radius * 2.0f, radius * 2.0f, height - radius), Color.green); - IsoUtils.DrawSphere( + IsoUtils.DrawIsoSphere( iso_object.isoWorld, iso_object.position + offset - IsoUtils.Vec3FromZ(height * 0.5f - radius), radius, Color.green); - IsoUtils.DrawSphere( + IsoUtils.DrawIsoSphere( iso_object.isoWorld, iso_object.position + offset + IsoUtils.Vec3FromZ(height * 0.5f - radius), radius, Color.green); } else { - IsoUtils.DrawSphere( + IsoUtils.DrawIsoSphere( iso_object.isoWorld, iso_object.position + offset, radius, diff --git a/Assets/IsoTools/Addons/Physics/IsoSphereCollider.cs b/Assets/IsoTools/Addons/Physics/IsoSphereCollider.cs index bd45025..78d2577 100644 --- a/Assets/IsoTools/Addons/Physics/IsoSphereCollider.cs +++ b/Assets/IsoTools/Addons/Physics/IsoSphereCollider.cs @@ -65,7 +65,7 @@ namespace IsoTools.Physics { void OnDrawGizmosSelected() { var iso_object = GetComponent(); if ( iso_object && iso_object.isoWorld ) { - IsoUtils.DrawSphere( + IsoUtils.DrawIsoSphere( iso_object.isoWorld, iso_object.position + offset, radius, diff --git a/Assets/IsoTools/Addons/Tiled/TiledMap.cs b/Assets/IsoTools/Addons/Tiled/TiledMap.cs index 25836aa..ddd7044 100644 --- a/Assets/IsoTools/Addons/Tiled/TiledMap.cs +++ b/Assets/IsoTools/Addons/Tiled/TiledMap.cs @@ -39,7 +39,7 @@ namespace IsoTools.Tiled { void OnDrawGizmos() { var iso_object = GetComponent(); if ( isShowGrid && iso_object && iso_object.isoWorld ) { - IsoUtils.DrawGrid( + IsoUtils.DrawIsoGrid( iso_object.isoWorld, iso_object.position, iso_object.size, IsoUtils.ColorChangeA(Color.green, 0.5f)); diff --git a/Assets/IsoTools/Scripts/Internal/IsoAssocList.cs b/Assets/IsoTools/Scripts/Internal/IsoAssocList.cs index ad8429b..3d68183 100644 --- a/Assets/IsoTools/Scripts/Internal/IsoAssocList.cs +++ b/Assets/IsoTools/Scripts/Internal/IsoAssocList.cs @@ -1,22 +1,18 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; namespace IsoTools.Internal { public class IsoAssocList { - IsoList _list; - Dictionary _dict; - IEqualityComparer _comparer; + IsoList _list; + Dictionary _dict; public IsoAssocList() { - _list = new IsoList(); - _dict = new Dictionary(); - _comparer = EqualityComparer.Default; + _list = new IsoList(); + _dict = new Dictionary(); } public IsoAssocList(int capacity) { - _list = new IsoList(capacity); - _dict = new Dictionary(capacity); - _comparer = EqualityComparer.Default; + _list = new IsoList(capacity); + _dict = new Dictionary(capacity); } public T this[int index] { @@ -41,22 +37,27 @@ namespace IsoTools.Internal { return _dict.ContainsKey(item); } - public void Add(T item) { - if ( !_dict.ContainsKey(item) ) { - _dict.Add(item, _list.Count); - _list.Push(item); + public bool Add(T item) { + if ( _dict.ContainsKey(item) ) { + return false; } + _dict.Add(item, _list.Count); + _list.Push(item); + return true; } - public void Remove(T item) { + public bool Remove(T item) { int index; if ( _dict.TryGetValue(item, out index) ) { _dict.Remove(item); - var reordered =_list.UnorderedRemoveAt(index); - if ( !_comparer.Equals(reordered, item) ) { - _dict[reordered] = index; + _list.UnorderedRemoveAt(index); + if ( index != _list.Count ) { + _dict[_list[index]] = index; } + + return true; } + return false; } public void Clear() { diff --git a/Assets/IsoTools/Scripts/Internal/IsoList.cs b/Assets/IsoTools/Scripts/Internal/IsoList.cs index 8f71761..62e0452 100644 --- a/Assets/IsoTools/Scripts/Internal/IsoList.cs +++ b/Assets/IsoTools/Scripts/Internal/IsoList.cs @@ -58,14 +58,12 @@ namespace IsoTools.Internal { _size = 0; } - public T UnorderedRemoveAt(int index) { + public void UnorderedRemoveAt(int index) { if ( (uint)index >= (uint)_size ) { throw new IndexOutOfRangeException(); } - var last = _data[_size - 1]; - _data[index] = last; - _data[--_size] = default(T); - return last; + _data[index] = _data[--_size]; + _data[_size] = default(T); } public T this[int index] { diff --git a/Assets/IsoTools/Scripts/Internal/IsoMinMax.cs b/Assets/IsoTools/Scripts/Internal/IsoMinMax.cs new file mode 100644 index 0000000..a8adef2 --- /dev/null +++ b/Assets/IsoTools/Scripts/Internal/IsoMinMax.cs @@ -0,0 +1,73 @@ +using UnityEngine; + +namespace IsoTools.Internal { + public struct IsoMinMax { + public float min; + public float max; + + public IsoMinMax(float min, float max) : this() { + this.min = min; + this.max = max; + } + + public IsoMinMax(IsoMinMax other) : this() { + min = other.min; + max = other.max; + } + + public float size { + get { return max - min; } + } + + public float center { + get { return min + (max - min) * 0.5f; } + } + + public void Set(float min, float max) { + this.min = min; + this.max = max; + } + + public void Set(IsoMinMax other) { + min = other.min; + max = other.max; + } + + public void Translate(float delta) { + min += delta; + max += delta; + } + + public bool Contains(float other) { + return other >= min && other <= max; + } + + public bool Contains(IsoMinMax other) { + return + max >= other.max && + min <= other.min; + } + + public bool Overlaps(IsoMinMax other) { + return + max > other.min && + min < other.max; + } + + public bool Approximately(IsoMinMax other) { + return + Mathf.Approximately(min, other.min) && + Mathf.Approximately(max, other.max); + } + + public static IsoMinMax zero { + get { return new IsoMinMax(); } + } + + public static IsoMinMax Merge(IsoMinMax a, IsoMinMax b) { + return new IsoMinMax( + a.min < b.min ? a.min : b.min, + a.max > b.max ? a.max : b.max); + } + } +} \ No newline at end of file diff --git a/Assets/IsoTools/Scripts/Internal/IsoMinMax.cs.meta b/Assets/IsoTools/Scripts/Internal/IsoMinMax.cs.meta new file mode 100644 index 0000000..fb81a92 --- /dev/null +++ b/Assets/IsoTools/Scripts/Internal/IsoMinMax.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9f0468643e5324b3296f095d6b127253 +timeCreated: 1480524466 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/IsoTools/Scripts/Internal/IsoPool.cs b/Assets/IsoTools/Scripts/Internal/IsoPool.cs new file mode 100644 index 0000000..df4cd7a --- /dev/null +++ b/Assets/IsoTools/Scripts/Internal/IsoPool.cs @@ -0,0 +1,36 @@ +using System; + +namespace IsoTools.Internal { + public interface IsoIPool { + T Take(); + void Release(T item); + } + + public abstract class IsoPool : IsoIPool { + IsoList _items; + + public IsoPool(int capacity) { + _items = new IsoList(capacity); + for ( var i = 0; i < capacity; ++i ) { + _items.Push(CreateItem()); + } + } + + public T Take() { + return _items.Count > 0 + ? _items.Pop() + : CreateItem(); + } + + public void Release(T item) { + if ( item == null ) { + throw new ArgumentNullException("item"); + } + CleanUpItem(item); + _items.Push(item); + } + + public abstract T CreateItem(); + public virtual void CleanUpItem(T item) {} + } +} \ No newline at end of file diff --git a/Assets/IsoTools/Scripts/Internal/IsoPool.cs.meta b/Assets/IsoTools/Scripts/Internal/IsoPool.cs.meta new file mode 100644 index 0000000..6a089a4 --- /dev/null +++ b/Assets/IsoTools/Scripts/Internal/IsoPool.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9518383bac81445daaba54a14e6b87ce +timeCreated: 1481092506 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/IsoTools/Scripts/Internal/IsoRect.cs b/Assets/IsoTools/Scripts/Internal/IsoRect.cs new file mode 100644 index 0000000..55d3608 --- /dev/null +++ b/Assets/IsoTools/Scripts/Internal/IsoRect.cs @@ -0,0 +1,100 @@ +using UnityEngine; + +namespace IsoTools.Internal { + public struct IsoRect { + public IsoMinMax x; + public IsoMinMax y; + + public IsoRect(float min_x, float min_y, float max_x, float max_y) : this() { + x.Set(min_x, max_x); + y.Set(min_y, max_y); + } + + public IsoRect(Vector2 min, Vector2 max) : this() { + x.Set(min.x, max.x); + y.Set(min.y, max.y); + } + + public IsoRect(IsoMinMax minmax_x, IsoMinMax minmax_y) : this() { + x.Set(minmax_x); + y.Set(minmax_y); + } + + public IsoRect(IsoRect other) : this() { + x.Set(other.x); + y.Set(other.y); + } + + public Vector2 size { + get { return new Vector2(x.size, y.size); } + } + + public Vector2 center { + get { return new Vector2(x.center, y.center); } + } + + public void Set(float min_x, float min_y, float max_x, float max_y) { + x.Set(min_x, max_x); + y.Set(min_y, max_y); + } + + public void Set(Vector2 min, Vector2 max) { + x.Set(min.x, max.x); + y.Set(min.y, max.y); + } + + public void Set(IsoMinMax minmax_x, IsoMinMax minmax_y) { + x.Set(minmax_x); + y.Set(minmax_y); + } + + public void Set(IsoRect other) { + x.Set(other.x); + y.Set(other.y); + } + + public void Translate(float delta_x, float delta_y) { + x.Translate(delta_x); + y.Translate(delta_y); + } + + public void Translate(Vector2 delta) { + x.Translate(delta.x); + y.Translate(delta.y); + } + + public bool Contains(Vector2 other) { + return + x.Contains(other.x) && + y.Contains(other.y); + } + + public bool Contains(IsoRect other) { + return + x.Contains(other.x) && + y.Contains(other.y); + } + + public bool Overlaps(IsoRect other) { + return + x.Overlaps(other.x) && + y.Overlaps(other.y); + } + + public bool Approximately(IsoRect other) { + return + x.Approximately(other.x) && + y.Approximately(other.y); + } + + public static IsoRect zero { + get { return new IsoRect(); } + } + + public static IsoRect Merge(IsoRect a, IsoRect b) { + return new IsoRect( + IsoMinMax.Merge(a.x, b.x), + IsoMinMax.Merge(a.y, b.y)); + } + } +} \ No newline at end of file diff --git a/Assets/IsoTools/Scripts/Internal/IsoRect.cs.meta b/Assets/IsoTools/Scripts/Internal/IsoRect.cs.meta new file mode 100644 index 0000000..68876d2 --- /dev/null +++ b/Assets/IsoTools/Scripts/Internal/IsoRect.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1cf642c7164d740708f2d931a8ccde23 +timeCreated: 1480524425 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/IsoTools/Scripts/Internal/IsoUtils.cs b/Assets/IsoTools/Scripts/Internal/IsoUtils.cs index 1521237..3b62072 100644 --- a/Assets/IsoTools/Scripts/Internal/IsoUtils.cs +++ b/Assets/IsoTools/Scripts/Internal/IsoUtils.cs @@ -26,96 +26,6 @@ namespace IsoTools.Internal { public static readonly int FloatBeautifierDigits = 4; - // --------------------------------------------------------------------- - // - // Rect - // - // --------------------------------------------------------------------- - - public struct Rect { - public MinMax x; - public MinMax y; - - public Rect(float x_min, float y_min, float x_max, float y_max) : this() { - x = new MinMax(x_min, x_max); - y = new MinMax(y_min, y_max); - } - - public Vector2 size { - get { return new Vector2(x.size, y.size); } - } - - public Vector2 center { - get { return new Vector2(x.center, y.center); } - } - - public void Set(float x_min, float y_min, float x_max, float y_max) { - x.Set(x_min, x_max); - y.Set(y_min, y_max); - } - - public bool Overlaps(Rect other) { - return - x.Overlaps(other.x) && - y.Overlaps(other.y); - } - - public bool Approximately(Rect other) { - return - x.Approximately(other.x) && - y.Approximately(other.y); - } - - public static Rect zero { - get { return new Rect(); } - } - } - - // --------------------------------------------------------------------- - // - // MinMax - // - // --------------------------------------------------------------------- - - public struct MinMax { - public float min; - public float max; - - public MinMax(float min, float max) : this() { - this.min = min; - this.max = max; - } - - public float size { - get { return max - min; } - } - - public float center { - get { return min / 2.0f + max / 2.0f; } - } - - public void Set(float min, float max) { - this.min = min; - this.max = max; - } - - public bool Overlaps(MinMax other) { - return - max > other.min && - min < other.max; - } - - public bool Approximately(MinMax other) { - return - Mathf.Approximately(min, other.min) && - Mathf.Approximately(max, other.max); - } - - public static MinMax zero { - get { return new MinMax(); } - } - } - // --------------------------------------------------------------------- // // Abs/Min/Max @@ -542,44 +452,45 @@ namespace IsoTools.Internal { // --------------------------------------------------------------------- #if UNITY_EDITOR - static void DrawTop(IsoWorld iso_world, Vector3 pos, Vector3 size) { + static void DrawIsoCubeTop(IsoWorld iso_world, Vector3 pos, Vector3 size) { if ( iso_world ) { - var points = new Vector3[]{ - iso_world.IsoToScreen(pos), - iso_world.IsoToScreen(pos + IsoUtils.Vec3FromX (size.x)), - iso_world.IsoToScreen(pos + IsoUtils.Vec3FromXY(size.x, size.y)), - iso_world.IsoToScreen(pos + IsoUtils.Vec3FromY (size.y)), - iso_world.IsoToScreen(pos) - }; - Handles.DrawLine(points[0], points[1]); - Handles.DrawLine(points[1], points[2]); - Handles.DrawLine(points[2], points[3]); - Handles.DrawLine(points[3], points[0]); + var point0 = iso_world.IsoToScreen(pos); + var point1 = iso_world.IsoToScreen(pos + IsoUtils.Vec3FromX (size.x)); + var point2 = iso_world.IsoToScreen(pos + IsoUtils.Vec3FromXY(size.x, size.y)); + var point3 = iso_world.IsoToScreen(pos + IsoUtils.Vec3FromY (size.y)); + Handles.DrawLine(point0, point1); + Handles.DrawLine(point1, point2); + Handles.DrawLine(point2, point3); + Handles.DrawLine(point3, point0); } } - static void DrawVert(IsoWorld iso_world, Vector3 pos, Vector3 size) { + static void DrawIsoCubeVert(IsoWorld iso_world, Vector3 pos, Vector3 size) { if ( iso_world ) { - Handles.DrawLine( - iso_world.IsoToScreen(pos), - iso_world.IsoToScreen(pos + IsoUtils.Vec3FromZ(size.z))); + var point0 = iso_world.IsoToScreen(pos); + var point1 = iso_world.IsoToScreen(pos + IsoUtils.Vec3FromZ(size.z)); + Handles.DrawLine(point0, point1); } } - public static void DrawCube(IsoWorld iso_world, Vector3 center, Vector3 size, Color color) { + public static void DrawIsoCube( + IsoWorld iso_world, Vector3 center, Vector3 size, Color color) + { if ( iso_world ) { Handles.color = color; var pos = center - size * 0.5f; - DrawTop (iso_world, pos, size); - DrawTop (iso_world, pos + IsoUtils.Vec3FromZ (size.z), size); - DrawVert(iso_world, pos, size); - DrawVert(iso_world, pos + IsoUtils.Vec3FromX (size.x), size); - DrawVert(iso_world, pos + IsoUtils.Vec3FromY (size.y), size); - DrawVert(iso_world, pos + IsoUtils.Vec3FromXY(size.x, size.y), size); + DrawIsoCubeTop (iso_world, pos, size); + DrawIsoCubeTop (iso_world, pos + IsoUtils.Vec3FromZ (size.z), size); + DrawIsoCubeVert(iso_world, pos, size); + DrawIsoCubeVert(iso_world, pos + IsoUtils.Vec3FromX (size.x), size); + DrawIsoCubeVert(iso_world, pos + IsoUtils.Vec3FromY (size.y), size); + DrawIsoCubeVert(iso_world, pos + IsoUtils.Vec3FromXY(size.x, size.y), size); } } - public static void DrawSphere(IsoWorld iso_world, Vector3 pos, float radius, Color color) { + public static void DrawIsoSphere( + IsoWorld iso_world, Vector3 pos, float radius, Color color) + { if ( iso_world ) { Handles.color = color; Handles.RadiusHandle( @@ -589,7 +500,9 @@ namespace IsoTools.Internal { } } - public static void DrawGrid(IsoWorld iso_world, Vector3 pos, Vector3 size, Color color) { + public static void DrawIsoGrid( + IsoWorld iso_world, Vector3 pos, Vector3 size, Color color) + { if ( iso_world ) { Handles.color = color; var size_x = Mathf.RoundToInt(size.x); @@ -606,6 +519,18 @@ namespace IsoTools.Internal { } } } + + public static void DrawRect(IsoRect rect, Color color) { + Handles.color = color; + var point0 = new Vector2(rect.x.min, rect.y.min); + var point1 = new Vector2(rect.x.max, rect.y.min); + var point2 = new Vector2(rect.x.max, rect.y.max); + var point3 = new Vector2(rect.x.min, rect.y.max); + Handles.DrawLine(point0, point1); + Handles.DrawLine(point1, point2); + Handles.DrawLine(point2, point3); + Handles.DrawLine(point3, point0); + } #endif } } \ No newline at end of file diff --git a/Assets/IsoTools/Scripts/IsoObject.cs b/Assets/IsoTools/Scripts/IsoObject.cs index 4c72d43..ea2de28 100644 --- a/Assets/IsoTools/Scripts/IsoObject.cs +++ b/Assets/IsoTools/Scripts/IsoObject.cs @@ -194,8 +194,8 @@ namespace IsoTools { public class InternalState { public bool Dirty = false; public bool Placed = false; - public IsoUtils.Rect ScreenRect = IsoUtils.Rect.zero; - public IsoUtils.MinMax MinMax3d = IsoUtils.MinMax.zero; + public IsoRect ScreenRect = IsoRect.zero; + public IsoMinMax MinMax3d = IsoMinMax.zero; public float Offset3d = 0.0f; public Vector2 MinSector = Vector2.zero; public Vector2 MaxSector = Vector2.zero; @@ -276,7 +276,7 @@ namespace IsoTools { var r = iso_world.IsoToScreen(position + IsoUtils.Vec3FromX(size.x)).x; var b = iso_world.IsoToScreen(position).y; var t = iso_world.IsoToScreen(position + size).y; - Internal.ScreenRect = new IsoUtils.Rect(l, b, r, t); + Internal.ScreenRect = new IsoRect(l, b, r, t); } } @@ -344,7 +344,7 @@ namespace IsoTools { void OnDrawGizmos() { if ( isShowBounds && isoWorld ) { - IsoUtils.DrawCube(isoWorld, position + size * 0.5f, size, Color.red); + IsoUtils.DrawIsoCube(isoWorld, position + size * 0.5f, size, Color.red); } } #endif diff --git a/Assets/IsoTools/Scripts/IsoWorld.cs b/Assets/IsoTools/Scripts/IsoWorld.cs index fb88198..a72b343 100644 --- a/Assets/IsoTools/Scripts/IsoWorld.cs +++ b/Assets/IsoTools/Scripts/IsoWorld.cs @@ -6,6 +6,10 @@ using System.Collections.Generic; using UnityEditor; #endif +#if UNITY_5_5_OR_NEWER +using UnityEngine.Profiling; +#endif + namespace IsoTools { [ExecuteInEditMode, DisallowMultipleComponent] public class IsoWorld : MonoBehaviour { @@ -401,9 +405,9 @@ namespace IsoTools { } } - IsoUtils.MinMax IsoObjectMinMax3D(IsoObject iso_object) { + IsoMinMax IsoObjectMinMax3D(IsoObject iso_object) { bool inited = false; - var result = IsoUtils.MinMax.zero; + var result = IsoMinMax.zero; var renderers = GetIsoObjectRenderers(iso_object); for ( int i = 0, e = renderers.Count; i < e; ++i ) { var bounds = renderers[i].bounds; @@ -421,11 +425,11 @@ namespace IsoTools { } } else { inited = true; - result = new IsoUtils.MinMax(minbounds, maxbounds); + result = new IsoMinMax(minbounds, maxbounds); } } } - return inited ? result : IsoUtils.MinMax.zero; + return inited ? result : IsoMinMax.zero; } bool IsIsoObjectVisible(IsoObject iso_object) {