From 864727a50db0aee60a20e85146b5eba39562f3f7 Mon Sep 17 00:00:00 2001 From: BlackMATov Date: Sun, 25 Dec 2016 14:56:41 +0700 Subject: [PATCH] quad tree for visibility wip --- Assets/IsoTools/Scripts/Internal/IsoGrid.cs | 36 +- Assets/IsoTools/Scripts/Internal/IsoList.cs | 24 +- Assets/IsoTools/Scripts/Internal/IsoMinMax.cs | 10 +- Assets/IsoTools/Scripts/Internal/IsoPoint2.cs | 12 +- .../IsoTools/Scripts/Internal/IsoQuadTree.cs | 410 ++++++++++-------- Assets/IsoTools/Scripts/Internal/IsoRect.cs | 6 +- .../Scripts/Internal/IsoScreenSolver.cs | 176 +++++--- .../Scripts/Internal/IsoSortingSolver.cs | 4 +- Assets/IsoTools/Scripts/IsoObject.cs | 2 +- ProjectSettings/EditorBuildSettings.asset | 4 + ProjectSettings/ProjectSettings.asset | 298 ++++++------- 11 files changed, 542 insertions(+), 440 deletions(-) diff --git a/Assets/IsoTools/Scripts/Internal/IsoGrid.cs b/Assets/IsoTools/Scripts/Internal/IsoGrid.cs index b8178d5..48e8702 100644 --- a/Assets/IsoTools/Scripts/Internal/IsoGrid.cs +++ b/Assets/IsoTools/Scripts/Internal/IsoGrid.cs @@ -3,6 +3,22 @@ namespace IsoTools.Internal { public class IsoGrid { + // --------------------------------------------------------------------- + // + // Interfaces + // + // --------------------------------------------------------------------- + + public interface IItemAdapter { + IsoRect GetBounds (T item); + void SetMinMaxCells (T item, IsoPoint2 min, IsoPoint2 max); + void GetMinMaxCells (T item, ref IsoPoint2 min, ref IsoPoint2 max); + } + + public interface ILookUpper { + void LookUp(IsoList items); + } + // --------------------------------------------------------------------- // // CellPool @@ -26,22 +42,6 @@ namespace IsoTools.Internal { } } - // --------------------------------------------------------------------- - // - // Interfaces - // - // --------------------------------------------------------------------- - - public interface IItemAdapter { - IsoRect GetBounds (T item); - void SetMinMaxCells (T item, IsoPoint2 min, IsoPoint2 max); - void GetMinMaxCells (T item, ref IsoPoint2 min, ref IsoPoint2 max); - } - - public interface ILookUpper { - void LookUp(IsoList items); - } - // --------------------------------------------------------------------- // // Members @@ -79,8 +79,8 @@ namespace IsoTools.Internal { _itemAdapter = item_adapter; } - public void AddItem(T content) { - _gridItems.Add(content); + public void AddItem(T item) { + _gridItems.Add(item); } public void ClearItems() { diff --git a/Assets/IsoTools/Scripts/Internal/IsoList.cs b/Assets/IsoTools/Scripts/Internal/IsoList.cs index 8e43160..f17d3ba 100644 --- a/Assets/IsoTools/Scripts/Internal/IsoList.cs +++ b/Assets/IsoTools/Scripts/Internal/IsoList.cs @@ -1,6 +1,4 @@ -using System; - -namespace IsoTools.Internal { +namespace IsoTools.Internal { public class IsoList { T[] _data; int _size; @@ -15,7 +13,7 @@ namespace IsoTools.Internal { public IsoList(int capacity) { if ( capacity < 0 ) { - throw new ArgumentOutOfRangeException( + throw new System.ArgumentOutOfRangeException( "capacity", "capacity must be >= 0"); } else if ( capacity == 0 ) { _data = _emptyData; @@ -31,7 +29,7 @@ namespace IsoTools.Internal { var new_capacity = _size == 0 ? _defaultCapacity : _size * 2; var new_data = new T[new_capacity]; - Array.Copy(_data, new_data, _size); + System.Array.Copy(_data, new_data, _size); _data = new_data; } _data[_size++] = value; @@ -39,7 +37,7 @@ namespace IsoTools.Internal { public T Pop() { if ( _size == 0 ) { - throw new InvalidOperationException("empty list"); + throw new System.InvalidOperationException("empty list"); } var last = _data[--_size]; _data[_size] = default(T); @@ -48,19 +46,19 @@ namespace IsoTools.Internal { public T Peek() { if ( _size == 0 ) { - throw new InvalidOperationException("empty list"); + throw new System.InvalidOperationException("empty list"); } return _data[_size - 1]; } public void Clear() { - Array.Clear(_data, 0, _size); + System.Array.Clear(_data, 0, _size); _size = 0; } public void UnorderedRemoveAt(int index) { if ( (uint)index >= (uint)_size ) { - throw new IndexOutOfRangeException(); + throw new System.IndexOutOfRangeException(); } _data[index] = _data[--_size]; _data[_size] = default(T); @@ -69,13 +67,13 @@ namespace IsoTools.Internal { public T this[int index] { get { if ( (uint)index >= (uint)_size ) { - throw new IndexOutOfRangeException(); + throw new System.IndexOutOfRangeException(); } return _data[index]; } set { if ( (uint)index >= (uint)_size ) { - throw new IndexOutOfRangeException(); + throw new System.IndexOutOfRangeException(); } _data[index] = value; } @@ -89,12 +87,12 @@ namespace IsoTools.Internal { get { return _data.Length; } set { if ( value < _size ) { - throw new ArgumentOutOfRangeException("value"); + throw new System.ArgumentOutOfRangeException("value"); } else if ( value != _data.Length ) { if ( value > 0 ) { var new_data = new T[value]; if ( _size > 0 ) { - Array.Copy(_data, new_data, _size); + System.Array.Copy(_data, new_data, _size); } _data = new_data; } else { diff --git a/Assets/IsoTools/Scripts/Internal/IsoMinMax.cs b/Assets/IsoTools/Scripts/Internal/IsoMinMax.cs index fb7b94b..f55cfa0 100644 --- a/Assets/IsoTools/Scripts/Internal/IsoMinMax.cs +++ b/Assets/IsoTools/Scripts/Internal/IsoMinMax.cs @@ -69,9 +69,13 @@ namespace IsoTools.Internal { } 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); + if ( a.min > b.min ) { + a.min = b.min; + } + if ( a.max < b.max ) { + a.max = b.max; + } + return a; } } } \ No newline at end of file diff --git a/Assets/IsoTools/Scripts/Internal/IsoPoint2.cs b/Assets/IsoTools/Scripts/Internal/IsoPoint2.cs index 020b1b0..b5d99d9 100644 --- a/Assets/IsoTools/Scripts/Internal/IsoPoint2.cs +++ b/Assets/IsoTools/Scripts/Internal/IsoPoint2.cs @@ -38,15 +38,21 @@ } public static IsoPoint2 operator+(IsoPoint2 a, IsoPoint2 b) { - return new IsoPoint2(a.x + b.x, a.y + b.y); + a.x += b.x; + a.y += b.y; + return a; } public static IsoPoint2 operator-(IsoPoint2 a, IsoPoint2 b) { - return new IsoPoint2(a.x - b.x, a.y - b.y); + a.x -= b.x; + a.y -= b.y; + return a; } public static IsoPoint2 operator-(IsoPoint2 a) { - return new IsoPoint2(-a.x, -a.y); + a.x = -a.x; + a.y = -a.y; + return a; } public static bool operator==(IsoPoint2 lhs, IsoPoint2 rhs) { diff --git a/Assets/IsoTools/Scripts/Internal/IsoQuadTree.cs b/Assets/IsoTools/Scripts/Internal/IsoQuadTree.cs index be9dbc6..875d960 100644 --- a/Assets/IsoTools/Scripts/Internal/IsoQuadTree.cs +++ b/Assets/IsoTools/Scripts/Internal/IsoQuadTree.cs @@ -1,20 +1,29 @@ -namespace IsoTools.Internal { +using System.Collections.Generic; + +namespace IsoTools.Internal { public class IsoQuadTree { - const int MinChildCountPerNode = 3; - + // --------------------------------------------------------------------- // - // IItem + // Interfaces // + // --------------------------------------------------------------------- - public interface IItem { + public interface IBoundsLookUpper { + void LookUp(IsoRect bounds); } - // - // Item - // + public interface IContentLookUpper { + void LookUp(T content); + } - class Item : IItem { + // --------------------------------------------------------------------- + // + // ItemPool + // + // --------------------------------------------------------------------- + + class Item { public Node Owner = null; public IsoRect Bounds = IsoRect.zero; public T Content = default(T); @@ -31,137 +40,6 @@ } } - // - // Node - // - - class Node { - public Node Parent = null; - public IsoRect Bounds = IsoRect.zero; - public Node[] Children = new Node[4]; - public IsoAssocList Contents = new IsoAssocList(MinChildCountPerNode); - - public Node Init(Node parent, IsoRect bounds) { - Parent = parent; - Bounds = bounds; - return this; - } - - public Node Clear(IsoIPool node_pool, IsoIPool item_pool) { - ClearChildren(node_pool, item_pool); - ClearContents(item_pool); - return Init(null, IsoRect.zero); - } - - public bool Insert( - IsoRect bounds, T content, out Item item, - IsoIPool node_pool, IsoIPool item_pool) - { - if ( !Bounds.Contains(bounds) ) { - item = null; - return false; - } - bool has_any_children = false; - for ( int i = 0, e = Children.Length; i < e; ++i ) { - if ( Children[i] != null ) { - has_any_children = true; - if ( Children[i].Insert(bounds, content, out item, node_pool, item_pool) ) { - return true; - } - } - } - if ( has_any_children || Contents.Count >= MinChildCountPerNode ) { - for ( int i = 0, e = Children.Length; i < e; ++i ) { - if ( Children[i] == null ) { - var child_bounds = GetChildBounds(i); - if ( child_bounds.Contains(bounds) ) { - Children[i] = node_pool.Take().Init(this, child_bounds); - if ( Children[i].Insert(bounds, content, out item, node_pool, item_pool) ) { - return true; - } - } - } - } - } - item = item_pool.Take().Init(this, bounds, content); - Contents.Add(item); - return true; - } - - public void VisitAllBounds(System.Action act) { - act(Bounds); - for ( int i = 0, e = Children.Length; i < e; ++i ) { - if ( Children[i] != null ) { - Children[i].VisitAllBounds(act); - } - } - } - - public void VisitItemsByBounds(IsoRect bounds, System.Action act) { - if ( Bounds.Overlaps(bounds) ) { - for ( int i = 0, e = Contents.Count; i < e; ++i ) { - act(Contents[i].Content); - } - for ( int i = 0, e = Children.Length; i < e; ++i ) { - if ( Children[i] != null ) { - Children[i].VisitItemsByBounds(bounds, act); - } - } - } - } - - // - // Private - // - - IsoRect GetChildBounds(int index) { - var size = Bounds.size * 0.5f; - var center = Bounds.center; - switch ( index ) { - case 0: { // LT - return new IsoRect(center - size, center); - } - case 1: { // RT - var rect = new IsoRect(center - size, center); - rect.Translate(size.x, 0.0f); - return rect; - } - case 2: { // LB - var rect = new IsoRect(center, center + size); - rect.Translate(-size.x, 0.0f); - return rect; - } - case 3: { // RB - return new IsoRect(center, center + size); - } - default: - return IsoRect.zero; - } - } - - void ClearChildren(IsoIPool node_pool, IsoIPool item_pool) { - for ( int i = 0, e = Children.Length; i < e; ++i ) { - if ( Children[i] != null ) { - node_pool.Release( - Children[i].Clear(node_pool, item_pool)); - } - } - System.Array.Clear(Children, 0, Children.Length); - } - - void ClearContents(IsoIPool item_pool) { - for ( int i = 0, e = Contents.Count; i < e; ++i ) { - item_pool.Release( - Contents[i].Clear()); - } - Contents.Clear(); - } - } - - // - // ItemPool - // - class ItemPool : IsoPool { public ItemPool(int capacity) : base(capacity) { } @@ -171,9 +49,147 @@ } } + // --------------------------------------------------------------------- // // NodePool // + // --------------------------------------------------------------------- + + const int MinChildCountPerNode = 3; + + class Node { + public Node[] Nodes = new Node[4]; + public IsoAssocList Items = new IsoAssocList(MinChildCountPerNode); + public Node Parent = null; + public IsoRect Bounds = IsoRect.zero; + public IsoRect[] NodeBounds = new IsoRect[4]; + + public Node Init(Node parent, IsoRect bounds) { + Parent = parent; + Bounds = bounds; + return FillNodeBounds(); + } + + public Node Clear(IsoIPool node_pool, IsoIPool item_pool) { + ClearNodes(node_pool, item_pool); + ClearItems(item_pool); + return Init(null, IsoRect.zero); + } + + public bool AddItem( + IsoRect bounds, T content, out Item item, + IsoIPool node_pool, IsoIPool item_pool) + { + if ( !Bounds.Contains(bounds) ) { + item = null; + return false; + } + bool has_any_nodes = false; + for ( int i = 0, e = Nodes.Length; i < e; ++i ) { + var node = Nodes[i]; + if ( node != null ) { + has_any_nodes = true; + if ( node.AddItem(bounds, content, out item, node_pool, item_pool) ) { + return true; + } + } + } + if ( has_any_nodes || Items.Count >= MinChildCountPerNode ) { + for ( int i = 0, e = Nodes.Length; i < e; ++i ) { + var node = Nodes[i]; + if ( node == null ) { + if ( NodeBounds[i].Contains(bounds) ) { + Nodes[i] = node = node_pool.Take().Init(this, NodeBounds[i]); + if ( node.AddItem(bounds, content, out item, node_pool, item_pool) ) { + return true; + } + } + } + } + } + item = item_pool.Take().Init(this, bounds, content); + Items.Add(item); + return true; + } + + public void RemoveItem(Item item) { + Items.Remove(item); + } + + public void VisitAllBounds(IBoundsLookUpper look_upper) { + look_upper.LookUp(Bounds); + for ( int i = 0, e = Nodes.Length; i < e; ++i ) { + if ( Nodes[i] != null ) { + Nodes[i].VisitAllBounds(look_upper); + } + } + } + + public void VisitItemsByBounds(IsoRect bounds, IContentLookUpper look_upper) { + if ( Bounds.Overlaps(bounds) ) { + for ( int i = 0, e = Items.Count; i < e; ++i ) { + var item = Items[i]; + if ( bounds.Overlaps(item.Bounds) ) { + look_upper.LookUp(item.Content); + } + } + for ( int i = 0, e = Nodes.Length; i < e; ++i ) { + var node = Nodes[i]; + if ( node != null ) { + node.VisitItemsByBounds(bounds, look_upper); + } + } + } + } + + // + // Private + // + + Node FillNodeBounds() { + var size = Bounds.size * 0.5f; + var center = Bounds.center; + { // LT + var rect = new IsoRect(center - size, center); + NodeBounds[0] = rect; + } + { // RT + var rect = new IsoRect(center - size, center); + rect.Translate(size.x, 0.0f); + NodeBounds[1] = rect; + } + { // LB + var rect = new IsoRect(center, center + size); + rect.Translate(-size.x, 0.0f); + NodeBounds[2] = rect; + } + { // RB + var rect = new IsoRect(center, center + size); + NodeBounds[3] = rect; + } + return this; + } + + void ClearNodes(IsoIPool node_pool, IsoIPool item_pool) { + for ( int i = 0, e = Nodes.Length; i < e; ++i ) { + var node = Nodes[i]; + if ( node != null ) { + node_pool.Release( + node.Clear(node_pool, item_pool)); + } + } + System.Array.Clear(Nodes, 0, Nodes.Length); + } + + void ClearItems(IsoIPool item_pool) { + for ( int i = 0, e = Items.Count; i < e; ++i ) { + var item = Items[i]; + item_pool.Release( + item.Clear()); + } + Items.Clear(); + } + } class NodePool : IsoPool { public NodePool(int capacity) : base(capacity) { @@ -184,86 +200,126 @@ } } + // --------------------------------------------------------------------- // // Members // + // --------------------------------------------------------------------- - Node _root = null; - IsoIPool _nodePool = null; - IsoIPool _itemPool = null; + Node _rootNode = null; + Dictionary _allItems = null; + IsoIPool _nodePool = null; + IsoIPool _itemPool = null; + // --------------------------------------------------------------------- // // Public // + // --------------------------------------------------------------------- public IsoQuadTree(int capacity) { - _root = null; + _rootNode = null; + _allItems = new Dictionary(capacity); _nodePool = new NodePool(capacity); _itemPool = new ItemPool(capacity); } - public IItem Insert(IsoRect bounds, T content) { - if ( _root == null ) { - var initial_bounds = new IsoRect( - bounds.center - bounds.size * 2.0f, - bounds.center + bounds.size * 2.0f); - _root = _nodePool.Take().Init(null, initial_bounds); + public void AddItem(IsoRect bounds, T content) { + if ( bounds.x.size > 0.0f && bounds.y.size > 0.0f ) { + if ( _allItems.ContainsKey(content) ) { + MoveItem(bounds, content); + } else { + if ( _rootNode == null ) { + var initial_bounds = new IsoRect( + bounds.center - bounds.size * 2.0f, + bounds.center + bounds.size * 2.0f); + _rootNode = _nodePool.Take().Init(null, initial_bounds); + } + Item item; + while ( !_rootNode.AddItem(bounds, content, out item, _nodePool, _itemPool) ) { + GrowUp( + bounds.center.x < _rootNode.Bounds.center.x, + bounds.center.y < _rootNode.Bounds.center.y); + } + _allItems.Add(content, item); + } } + } + + public bool RemoveItem(T content) { Item item; - while ( !_root.Insert(bounds, content, out item, _nodePool, _itemPool) ) { - GrowUp( - bounds.center.x < _root.Bounds.center.x, - bounds.center.y < _root.Bounds.center.y); + if ( _allItems.TryGetValue(content, out item) ) { + if ( item.Owner != null ) { + item.Owner.RemoveItem(item); + } + _allItems.Remove(content); + return true; + } else { + return false; } - return item; + } + + public void MoveItem(IsoRect bounds, T content) { + //TODO implme + RemoveItem(content); + AddItem(bounds, content); } public void Clear() { - if ( _root != null ) { + if ( _rootNode != null ) { _nodePool.Release( - _root.Clear(_nodePool, _itemPool)); - _root = null; + _rootNode.Clear(_nodePool, _itemPool)); + _rootNode = null; + } + _allItems.Clear(); + } + + public void VisitAllBounds(IBoundsLookUpper look_upper) { + if ( look_upper == null ) { + throw new System.ArgumentNullException("look_upper"); + } + if ( _rootNode != null ) { + _rootNode.VisitAllBounds(look_upper); } } - public void VisitAllBounds(System.Action act) { - if ( _root != null ) { - _root.VisitAllBounds(act); - } - } - - public void VisitItemsByBounds(IsoRect bounds, System.Action act) { - if ( _root != null ) { - _root.VisitItemsByBounds(bounds, act); + public void VisitItemsByBounds(IsoRect bounds, IContentLookUpper look_upper) { + if ( look_upper == null ) { + throw new System.ArgumentNullException("look_upper"); + } + if ( _rootNode != null ) { + _rootNode.VisitItemsByBounds(bounds, look_upper); } } + // --------------------------------------------------------------------- // // Private // + // --------------------------------------------------------------------- void GrowUp(bool left, bool top) { - var new_root_bounds = _root.Bounds; + var new_root_bounds = _rootNode.Bounds; new_root_bounds.Translate( - left ? -_root.Bounds.size.x : 0.0f, - top ? -_root.Bounds.size.y : 0.0f); - new_root_bounds.Resize(_root.Bounds.size * 2.0f); + left ? -_rootNode.Bounds.size.x : 0.0f, + top ? -_rootNode.Bounds.size.y : 0.0f); + new_root_bounds.Resize(_rootNode.Bounds.size * 2.0f); var new_root = _nodePool.Take().Init(null, new_root_bounds); if ( left ) { if ( top ) { - new_root.Children[3] = _root; + new_root.Nodes[3] = _rootNode; } else { - new_root.Children[1] = _root; + new_root.Nodes[1] = _rootNode; } } else { if ( top ) { - new_root.Children[2] = _root; + new_root.Nodes[2] = _rootNode; } else { - new_root.Children[0] = _root; + new_root.Nodes[0] = _rootNode; } } - _root.Parent = new_root; - _root = new_root; + _rootNode.Parent = new_root; + _rootNode = new_root; } } } \ No newline at end of file diff --git a/Assets/IsoTools/Scripts/Internal/IsoRect.cs b/Assets/IsoTools/Scripts/Internal/IsoRect.cs index a5af056..dc6432f 100644 --- a/Assets/IsoTools/Scripts/Internal/IsoRect.cs +++ b/Assets/IsoTools/Scripts/Internal/IsoRect.cs @@ -102,9 +102,9 @@ namespace IsoTools.Internal { } public static IsoRect Merge(IsoRect a, IsoRect b) { - return new IsoRect( - IsoMinMax.Merge(a.x, b.x), - IsoMinMax.Merge(a.y, b.y)); + a.x = IsoMinMax.Merge(a.x, b.x); + a.y = IsoMinMax.Merge(a.y, b.y); + return a; } } } \ No newline at end of file diff --git a/Assets/IsoTools/Scripts/Internal/IsoScreenSolver.cs b/Assets/IsoTools/Scripts/Internal/IsoScreenSolver.cs index d382da5..0e6cf54 100644 --- a/Assets/IsoTools/Scripts/Internal/IsoScreenSolver.cs +++ b/Assets/IsoTools/Scripts/Internal/IsoScreenSolver.cs @@ -7,12 +7,60 @@ using UnityEngine.Profiling; namespace IsoTools.Internal { public class IsoScreenSolver { - Vector2 _minIsoXY = Vector2.zero; - IsoAssocList _curVisibles = new IsoAssocList(); - IsoAssocList _oldVisibles = new IsoAssocList(); - IsoGrid _visibleGrid = new IsoGrid(new IsoGridItemAdapter(), 47); - IsoGridLookUpper _gridLookUpper = new IsoGridLookUpper(); - List _tmpRenderers = new List(); + Vector2 _minIsoXY = Vector2.zero; + IsoAssocList _oldVisibles = new IsoAssocList(); + IsoAssocList _curVisibles = new IsoAssocList(); + + IsoQuadTree _quadTree = new IsoQuadTree(47); + IsoGrid _screenGrid = new IsoGrid(new IsoGridItemAdapter(), 47); + + IsoQTBoundsLookUpper _qtBoundsLU = new IsoQTBoundsLookUpper(); + IsoQTContentLookUpper _qtContentLU = new IsoQTContentLookUpper(); + IsoGridLookUpper _screenGridLU = new IsoGridLookUpper(); + + // --------------------------------------------------------------------- + // + // IsoQTBoundsLookUpper + // + // --------------------------------------------------------------------- + + class IsoQTBoundsLookUpper : IsoQuadTree.IBoundsLookUpper { + public void LookUp(IsoRect bounds) { + #if UNITY_EDITOR + IsoUtils.DrawRect(bounds, Color.blue); + #endif + } + } + + // --------------------------------------------------------------------- + // + // IsoQTContentLookUpper + // + // --------------------------------------------------------------------- + + class IsoQTContentLookUpper : IsoQuadTree.IContentLookUpper { + Camera[] _tmpCameras = new Camera[8]; + IsoScreenSolver _screenSolver = null; + + public void LookUp(IsoObject iso_object) { + iso_object.Internal.Placed = false; + _screenSolver._oldVisibles.Add(iso_object); + } + + public void LookUpForVisibility(IsoScreenSolver screen_solver) { + _screenSolver = screen_solver; + var cam_count = Camera.GetAllCameras(_tmpCameras); + for ( var i = 0; i < cam_count; ++i ) { + var camera = _tmpCameras[i]; + var vp_rect = camera.rect; + var wrl_min = camera.ViewportToWorldPoint(new Vector3(vp_rect.xMin, vp_rect.yMin)); + var wrl_max = camera.ViewportToWorldPoint(new Vector3(vp_rect.xMax, vp_rect.yMax)); + _screenSolver._quadTree.VisitItemsByBounds(new IsoRect(wrl_min, wrl_max), this); + } + _screenSolver = null; + System.Array.Clear(_tmpCameras, 0, _tmpCameras.Length); + } + } // --------------------------------------------------------------------- // @@ -46,15 +94,18 @@ namespace IsoTools.Internal { IsoObject _isoObject; public void LookUp(IsoList items) { - LookUpSectorDepends(_isoObject, items); - LookUpSectorRDepends(_isoObject, items); + LookUpCellForLDepends(_isoObject, items); + LookUpCellForRDepends(_isoObject, items); } - public void Setup(IsoObject iso_object) { + public void LookUpForDepends( + IsoScreenSolver screen_solver, IsoObject iso_object) + { _isoObject = iso_object; - } - - public void Reset() { + screen_solver._screenGrid.LookUpCells( + iso_object.Internal.MinGridCell, + iso_object.Internal.MaxGridCell, + this); _isoObject = null; } } @@ -69,14 +120,14 @@ namespace IsoTools.Internal { get { return _minIsoXY; } } - public IsoAssocList curVisibles { - get { return _curVisibles; } - } - public IsoAssocList oldVisibles { get { return _oldVisibles; } } + public IsoAssocList curVisibles { + get { return _curVisibles; } + } + // --------------------------------------------------------------------- // // Callbacks @@ -84,15 +135,22 @@ namespace IsoTools.Internal { // --------------------------------------------------------------------- public void OnAddInstance(IsoObject iso_object) { + _quadTree.AddItem( + iso_object.Internal.ScreenBounds, + iso_object); } public void OnRemoveInstance(IsoObject iso_object) { _oldVisibles.Remove(iso_object); _curVisibles.Remove(iso_object); + _quadTree.RemoveItem(iso_object); ClearIsoObjectDepends(iso_object); } public bool OnMarkDirtyInstance(IsoObject iso_object) { + _quadTree.MoveItem( + iso_object.Internal.ScreenBounds, + iso_object); if ( !iso_object.Internal.Dirty && _curVisibles.Contains(iso_object) ) { iso_object.Internal.Dirty = true; return true; @@ -102,6 +160,7 @@ namespace IsoTools.Internal { #if UNITY_EDITOR public void OnDrawGizmos(IsoWorld iso_world) { + _quadTree.VisitAllBounds(_qtBoundsLU); /* for ( int y = 0, ye = (int)_sectorsNumPosCount.y; y < ye; ++y ) { for ( int x = 0, xe = (int)_sectorsNumPosCount.x; x < xe; ++x ) { @@ -126,32 +185,27 @@ namespace IsoTools.Internal { // --------------------------------------------------------------------- public void StepSortingAction(IsoWorld iso_world, IsoAssocList instances) { - Profiler.BeginSample("ResolveVisibles"); + Profiler.BeginSample("IsoScreenSolver.ResolveVisibles"); ResolveVisibles(instances); Profiler.EndSample(); - Profiler.BeginSample("ResolveVisibleGrid"); + Profiler.BeginSample("IsoScreenSolver.ResolveVisibleGrid"); ResolveVisibleGrid(iso_world); Profiler.EndSample(); } public void PostStepSortingAction() { - _tmpRenderers.Clear(); } public void Clear() { - _curVisibles.Clear(); _oldVisibles.Clear(); - _visibleGrid.ClearGrid(); + _curVisibles.Clear(); + _quadTree.Clear(); + _screenGrid.ClearGrid(); } public void SetupIsoObjectDepends(IsoObject iso_object) { ClearIsoObjectDepends(iso_object); - _gridLookUpper.Setup(iso_object); - _visibleGrid.LookUpCells( - iso_object.Internal.MinGridCell, - iso_object.Internal.MaxGridCell, - _gridLookUpper); - _gridLookUpper.Reset(); + _screenGridLU.LookUpForDepends(this, iso_object); } public void ClearIsoObjectDepends(IsoObject iso_object) { @@ -173,7 +227,15 @@ namespace IsoTools.Internal { // --------------------------------------------------------------------- void ResolveVisibles(IsoAssocList instances) { - _oldVisibles.Clear(); + Profiler.BeginSample("ProcessAllInstances"); + ProcessAllInstances(instances); + Profiler.EndSample(); + Profiler.BeginSample("ProcessNewVisibles"); + ProcessNewVisibles(); + Profiler.EndSample(); + } + + void ProcessAllInstances(IsoAssocList instances) { if ( instances.Count > 0 ) { _minIsoXY.Set(float.MaxValue, float.MaxValue); for ( int i = 0, e = instances.Count; i < e; ++i ) { @@ -191,36 +253,22 @@ namespace IsoTools.Internal { { iso_object.FixIsoPosition(); } - if ( IsIsoObjectVisible(iso_object) ) { - iso_object.Internal.Placed = false; - _oldVisibles.Add(iso_object); - } } } else { _minIsoXY.Set(0.0f, 0.0f); } - var temp_visibles = _curVisibles; + } + + void ProcessNewVisibles() { + _oldVisibles.Clear(); + _qtContentLU.LookUpForVisibility(this); + SwapCurrentVisibles(); + } + + void SwapCurrentVisibles() { + var swap_tmp = _curVisibles; _curVisibles = _oldVisibles; - _oldVisibles = temp_visibles; - } - - bool IsIsoObjectVisible(IsoObject iso_object) { - var renderers = GetIsoObjectRenderers(iso_object); - for ( int i = 0, e = renderers.Count; i < e; ++i ) { - if ( renderers[i].isVisible ) { - return true; - } - } - return false; - } - - List GetIsoObjectRenderers(IsoObject iso_object) { - if ( iso_object.cacheRenderers ) { - return iso_object.Internal.Renderers; - } else { - iso_object.GetComponentsInChildren(_tmpRenderers); - return _tmpRenderers; - } + _oldVisibles = swap_tmp; } // --------------------------------------------------------------------- @@ -230,24 +278,24 @@ namespace IsoTools.Internal { // --------------------------------------------------------------------- void ResolveVisibleGrid(IsoWorld iso_world) { - _visibleGrid.ClearItems(); + _screenGrid.ClearItems(); for ( int i = 0, e = _curVisibles.Count; i < e; ++i ) { var iso_object = _curVisibles[i]; - _visibleGrid.AddItem(iso_object); + _screenGrid.AddItem(iso_object); } var min_sector_size = IsoUtils.Vec2MaxF( iso_world.IsoToScreen(IsoUtils.vec3OneXY) - iso_world.IsoToScreen(Vector3.zero)); - _visibleGrid.RebuildGrid(min_sector_size); + _screenGrid.RebuildGrid(min_sector_size); } // --------------------------------------------------------------------- // - // LookUpSectorDepends + // LookUpCellForDepends // // --------------------------------------------------------------------- - static void LookUpSectorDepends(IsoObject obj_a, IsoList others) { + static void LookUpCellForLDepends(IsoObject obj_a, IsoList others) { for ( int i = 0, e = others.Count; i < e; ++i ) { var obj_b = others[i]; if ( obj_a != obj_b && !obj_b.Internal.Dirty && IsIsoObjectDepends(obj_a, obj_b) ) { @@ -257,7 +305,7 @@ namespace IsoTools.Internal { } } - static void LookUpSectorRDepends(IsoObject obj_a, IsoList others) { + static void LookUpCellForRDepends(IsoObject obj_a, IsoList others) { for ( int i = 0, e = others.Count; i < e; ++i ) { var obj_b = others[i]; if ( obj_a != obj_b && !obj_b.Internal.Dirty && IsIsoObjectDepends(obj_b, obj_a) ) { @@ -293,9 +341,13 @@ namespace IsoTools.Internal { var dB_y = b_max.y - a_min.y; var dB_z = a_max.z - b_min.z; - var dP_x = a_size.x + b_size.x - Mathf.Abs(dA_x - dB_x); - var dP_y = a_size.y + b_size.y - Mathf.Abs(dA_y - dB_y); - var dP_z = a_size.z + b_size.z - Mathf.Abs(dA_z - dB_z); + var dD_x = dB_x - dA_x; + var dD_y = dB_y - dA_y; + var dD_z = dB_z - dA_z; + + var dP_x = a_size.x + b_size.x - (dD_x > 0.0f ? dD_x : -dD_x); + var dP_y = a_size.y + b_size.y - (dD_y > 0.0f ? dD_y : -dD_y); + var dP_z = a_size.z + b_size.z - (dD_z > 0.0f ? dD_z : -dD_z); if ( dP_x <= dP_y && dP_x <= dP_z ) { return dA_x > dB_x; diff --git a/Assets/IsoTools/Scripts/Internal/IsoSortingSolver.cs b/Assets/IsoTools/Scripts/Internal/IsoSortingSolver.cs index f420b05..3713233 100644 --- a/Assets/IsoTools/Scripts/Internal/IsoSortingSolver.cs +++ b/Assets/IsoTools/Scripts/Internal/IsoSortingSolver.cs @@ -43,11 +43,11 @@ namespace IsoTools.Internal { // --------------------------------------------------------------------- public bool StepSortingAction(IsoWorld iso_world, IsoScreenSolver screen_solver) { - Profiler.BeginSample("ResolveVisibles"); + Profiler.BeginSample("IsoSortingSolver.ResolveVisibles"); var dirty = ResolveVisibles(screen_solver); Profiler.EndSample(); if ( dirty ) { - Profiler.BeginSample("PlaceAllVisibles"); + Profiler.BeginSample("IsoSortingSolver.PlaceAllVisibles"); PlaceAllVisibles(iso_world, screen_solver); Profiler.EndSample(); } diff --git a/Assets/IsoTools/Scripts/IsoObject.cs b/Assets/IsoTools/Scripts/IsoObject.cs index 8a70dd0..ffb2744 100644 --- a/Assets/IsoTools/Scripts/IsoObject.cs +++ b/Assets/IsoTools/Scripts/IsoObject.cs @@ -294,7 +294,7 @@ namespace IsoTools { void Awake() { FixCachedTransform(); FixLastTransform(); - FixIsoPosition(); + FixTransform(); } protected override void OnEnable() { diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index d7f2451..36dc178 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -25,3 +25,7 @@ EditorBuildSettings: path: Assets/IsoTools/Examples/Scenes/Scene08.unity - enabled: 1 path: Assets/IsoTools/Examples/Scenes/Scene09.unity + - enabled: 1 + path: Assets/IsoTools/Examples/Scenes/Scene10.unity + - enabled: 1 + path: Assets/IsoTools/Examples/Scenes/Scene11.unity diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index f76be36..3c39eb3 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -3,7 +3,7 @@ --- !u!129 &1 PlayerSettings: m_ObjectHideFlags: 0 - serializedVersion: 8 + serializedVersion: 10 productGUID: 0ae4d8e5611a65d45bd97550aa4471af AndroidProfiler: 0 defaultScreenOrientation: 4 @@ -14,21 +14,46 @@ PlayerSettings: productName: UnityIso defaultCursor: {fileID: 0} cursorHotspot: {x: 0, y: 0} - m_SplashScreenStyle: 0 + m_SplashScreenBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21176471, a: 1} m_ShowUnitySplashScreen: 1 + m_ShowUnitySplashLogo: 1 + m_SplashScreenOverlayOpacity: 1 + m_SplashScreenAnimation: 1 + m_SplashScreenLogoStyle: 1 + m_SplashScreenDrawMode: 0 + m_SplashScreenBackgroundAnimationZoom: 1 + m_SplashScreenLogoAnimationZoom: 1 + m_SplashScreenBackgroundLandscapeAspect: 1 + m_SplashScreenBackgroundPortraitAspect: 1 + m_SplashScreenBackgroundLandscapeUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenBackgroundPortraitUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenLogos: [] + m_SplashScreenBackgroundLandscape: {fileID: 0} + m_SplashScreenBackgroundPortrait: {fileID: 0} m_VirtualRealitySplashScreen: {fileID: 0} + m_HolographicTrackingLossScreen: {fileID: 0} defaultScreenWidth: 1024 defaultScreenHeight: 768 defaultScreenWidthWeb: 960 defaultScreenHeightWeb: 600 - m_RenderingPath: 1 - m_MobileRenderingPath: 1 + m_StereoRenderingPath: 0 m_ActiveColorSpace: 0 m_MTRendering: 1 m_MobileMTRendering: 0 m_StackTraceTypes: 010000000100000001000000010000000100000001000000 iosShowActivityIndicatorOnLoading: -1 androidShowActivityIndicatorOnLoading: -1 + tizenShowActivityIndicatorOnLoading: -1 iosAppInBackgroundBehavior: 0 displayResolutionDialog: 1 iosAllowHTTPDownload: 1 @@ -43,7 +68,7 @@ PlayerSettings: defaultIsNativeResolution: 1 runInBackground: 1 captureSingleScreen: 0 - Override IPod Music: 0 + muteOtherAudioSources: 0 Prepare IOS For Recording: 0 submitAnalytics: 1 usePlayerLog: 1 @@ -75,7 +100,6 @@ PlayerSettings: xboxOneResolution: 0 xboxOneMonoLoggingLevel: 0 xboxOneLoggingLevel: 1 - ps3SplashScreen: {fileID: 0} videoMemoryForVertexBuffers: 0 psp2PowerMode: 0 psp2AcquireBGM: 1 @@ -97,9 +121,9 @@ PlayerSettings: bundleIdentifier: com.Company.ProductName bundleVersion: 1.0 preloadedAssets: [] - metroEnableIndependentInputSource: 0 + metroInputSource: 0 + m_HolographicPauseOnTrackingLoss: 1 xboxOneDisableKinectGpuReservation: 0 - singlePassStereoRendering: 0 protectGraphicsMemory: 0 AndroidBundleVersionCode: 1 AndroidMinSdkVersion: 9 @@ -120,10 +144,10 @@ PlayerSettings: serializedVersion: 2 m_Bits: 238 iPhoneSdkVersion: 988 - iPhoneTargetOSVersion: 22 + iOSTargetOSVersionString: 6.0 tvOSSdkVersion: 0 - tvOSTargetOSVersion: 900 tvOSRequireExtendedGameController: 0 + tvOSTargetOSVersionString: 9.0 uIPrerenderedIcon: 0 uIRequiresPersistentWiFi: 0 uIRequiresFullScreen: 1 @@ -144,6 +168,7 @@ PlayerSettings: tvOSSmallIconLayers: [] tvOSLargeIconLayers: [] tvOSTopShelfImageLayers: [] + tvOSTopShelfImageWideLayers: [] iOSLaunchScreenType: 0 iOSLaunchScreenPortrait: {fileID: 0} iOSLaunchScreenLandscape: {fileID: 0} @@ -163,6 +188,8 @@ PlayerSettings: iOSLaunchScreeniPadCustomXibPath: iOSDeviceRequirements: [] iOSURLSchemes: [] + iOSBackgroundModes: 0 + iOSMetalForceHardShadows: 0 appleDeveloperTeamID: AndroidTargetDevice: 0 AndroidSplashScreenScale: 0 @@ -187,6 +214,63 @@ PlayerSettings: m_Height: 0 m_BuildTargetBatching: [] m_BuildTargetGraphicsAPIs: [] + m_BuildTargetVRSettings: + - m_BuildTarget: Android + m_Enabled: 0 + m_Devices: + - Oculus + - m_BuildTarget: Metro + m_Enabled: 0 + m_Devices: [] + - m_BuildTarget: N3DS + m_Enabled: 0 + m_Devices: [] + - m_BuildTarget: PS3 + m_Enabled: 0 + m_Devices: [] + - m_BuildTarget: PS4 + m_Enabled: 0 + m_Devices: + - PlayStationVR + - m_BuildTarget: PSM + m_Enabled: 0 + m_Devices: [] + - m_BuildTarget: PSP2 + m_Enabled: 0 + m_Devices: [] + - m_BuildTarget: SamsungTV + m_Enabled: 0 + m_Devices: [] + - m_BuildTarget: Standalone + m_Enabled: 0 + m_Devices: + - Oculus + - m_BuildTarget: Tizen + m_Enabled: 0 + m_Devices: [] + - m_BuildTarget: WebGL + m_Enabled: 0 + m_Devices: [] + - m_BuildTarget: WebPlayer + m_Enabled: 0 + m_Devices: [] + - m_BuildTarget: WiiU + m_Enabled: 0 + m_Devices: [] + - m_BuildTarget: Xbox360 + m_Enabled: 0 + m_Devices: [] + - m_BuildTarget: XboxOne + m_Enabled: 0 + m_Devices: [] + - m_BuildTarget: iOS + m_Enabled: 0 + m_Devices: [] + - m_BuildTarget: tvOS + m_Enabled: 0 + m_Devices: [] + openGLRequireES31: 0 + openGLRequireES31AEP: 0 webPlayerTemplate: APPLICATION:Default m_TemplateCustomTags: {} wiiUTitleID: 0005000011000000 @@ -224,24 +308,6 @@ PlayerSettings: xboxAdditionalTitleMemorySize: 0 xboxDeployKinectHeadOrientation: 0 xboxDeployKinectHeadPosition: 0 - ps3TitleConfigPath: - ps3DLCConfigPath: - ps3ThumbnailPath: - ps3BackgroundPath: - ps3SoundPath: - ps3NPAgeRating: 12 - ps3TrophyCommId: - ps3NpCommunicationPassphrase: - ps3TrophyPackagePath: - ps3BootCheckMaxSaveGameSizeKB: 128 - ps3TrophyCommSig: - ps3SaveGameSlots: 1 - ps3TrialMode: 0 - ps3VideoMemoryForAudio: 0 - ps3EnableVerboseMemoryStats: 0 - ps3UseSPUForUmbra: 0 - ps3EnableMoveSupport: 1 - ps3DisableDolbyEncoding: 0 ps4NPAgeRating: 12 ps4NPTitleSecret: ps4NPTrophyPackPath: @@ -283,8 +349,8 @@ PlayerSettings: ps4pnFriends: 1 ps4pnGameCustomData: 1 playerPrefsSupport: 0 - ps4UseResolutionFallback: 0 restrictedAudioUsageRights: 0 + ps4UseResolutionFallback: 0 ps4ReprojectionSupport: 0 ps4UseAudio3dBackend: 0 ps4SocialScreenEnabled: 0 @@ -351,8 +417,36 @@ PlayerSettings: psp2InfoBarColor: 0 psp2UseDebugIl2cppLibs: 0 psmSplashimage: {fileID: 0} + splashScreenBackgroundSourceLandscape: {fileID: 0} + splashScreenBackgroundSourcePortrait: {fileID: 0} spritePackerPolicy: + webGLMemorySize: 256 + webGLExceptionSupport: 0 + webGLDataCaching: 0 + webGLDebugSymbols: 0 + webGLEmscriptenArgs: + webGLModulesDirectory: + webGLTemplate: APPLICATION:Default + webGLAnalyzeBuildSize: 0 + webGLUseEmbeddedResources: 0 + webGLUseWasm: 0 + webGLCompressionFormat: 1 scriptingDefineSymbols: {} + platformArchitecture: + iOS: 0 + tvOS: 1 + scriptingBackend: + Android: 0 + Standalone: 0 + WebGL: 1 + iOS: 1 + tvOS: 1 + incrementalIl2cppBuild: + iOS: 1 + tvOS: 0 + additionalIl2CppArgs: + m_RenderingPath: 1 + m_MobileRenderingPath: 1 metroPackageName: UnityIso metroPackageVersion: metroCertificatePath: @@ -383,6 +477,8 @@ PlayerSettings: tizenSigningProfileName: tizenGPSPermissions: 0 tizenMicrophonePermissions: 0 + tizenDeploymentTarget: + tizenDeploymentTargetType: -256 tizenMinOSVersion: 0 n3dsUseExtSaveData: 0 n3dsCompressStaticMem: 1 @@ -413,141 +509,27 @@ PlayerSettings: XboxOnePackageEncryption: 0 XboxOnePackageUpdateGranularity: 2 XboxOneDescription: + XboxOneLanguage: + - enus + XboxOneCapability: [] + XboxOneGameRating: {} XboxOneIsContentPackage: 0 XboxOneEnableGPUVariability: 0 XboxOneSockets: {} XboxOneSplashScreen: {fileID: 0} XboxOneAllowedProductIds: [] XboxOnePersistentLocalStorageSize: 0 - intPropertyNames: - - Android::ScriptingBackend - - Standalone::ScriptingBackend - - WebGL::ScriptingBackend - - WebGL::audioCompressionFormat - - WebGL::exceptionSupport - - WebGL::memorySize - - iOS::Architecture - - iOS::EnableIncrementalBuildSupportForIl2cpp - - iOS::ScriptingBackend - - tvOS::Architecture - - tvOS::EnableIncrementalBuildSupportForIl2cpp - - tvOS::ScriptingBackend - Android::ScriptingBackend: 0 - Standalone::ScriptingBackend: 0 - WebGL::ScriptingBackend: 1 - WebGL::audioCompressionFormat: 4 - WebGL::exceptionSupport: 0 - WebGL::memorySize: 256 - iOS::Architecture: 0 - iOS::EnableIncrementalBuildSupportForIl2cpp: 1 - iOS::ScriptingBackend: 1 - tvOS::Architecture: 1 - tvOS::EnableIncrementalBuildSupportForIl2cpp: 0 - tvOS::ScriptingBackend: 1 - boolPropertyNames: - - Android::VR::enable - - Metro::VR::enable - - N3DS::VR::enable - - PS3::VR::enable - - PS4::VR::enable - - PSM::VR::enable - - PSP2::VR::enable - - SamsungTV::VR::enable - - Standalone::VR::enable - - Tizen::VR::enable - - WebGL::VR::enable - - WebGL::analyzeBuildSize - - WebGL::dataCaching - - WebGL::useEmbeddedResources - - WebPlayer::VR::enable - - WiiU::VR::enable - - Xbox360::VR::enable - - XboxOne::VR::enable - - iOS::VR::enable - - tvOS::VR::enable - Android::VR::enable: 0 - Metro::VR::enable: 0 - N3DS::VR::enable: 0 - PS3::VR::enable: 0 - PS4::VR::enable: 0 - PSM::VR::enable: 0 - PSP2::VR::enable: 0 - SamsungTV::VR::enable: 0 - Standalone::VR::enable: 0 - Tizen::VR::enable: 0 - WebGL::VR::enable: 0 - WebGL::analyzeBuildSize: 0 - WebGL::dataCaching: 0 - WebGL::useEmbeddedResources: 0 - WebPlayer::VR::enable: 0 - WiiU::VR::enable: 0 - Xbox360::VR::enable: 0 - XboxOne::VR::enable: 0 - iOS::VR::enable: 0 - tvOS::VR::enable: 0 - stringPropertyNames: - - Analytics_ServiceEnabled::Analytics_ServiceEnabled - - Build_ServiceEnabled::Build_ServiceEnabled - - Collab_ServiceEnabled::Collab_ServiceEnabled - - ErrorHub_ServiceEnabled::ErrorHub_ServiceEnabled - - Game_Performance_ServiceEnabled::Game_Performance_ServiceEnabled - - Hub_ServiceEnabled::Hub_ServiceEnabled - - Purchasing_ServiceEnabled::Purchasing_ServiceEnabled - - UNet_ServiceEnabled::UNet_ServiceEnabled - - Unity_Ads_ServiceEnabled::Unity_Ads_ServiceEnabled - - WebGL::emscriptenArgs - - WebGL::template - - additionalIl2CppArgs::additionalIl2CppArgs - Analytics_ServiceEnabled::Analytics_ServiceEnabled: False - Build_ServiceEnabled::Build_ServiceEnabled: False - Collab_ServiceEnabled::Collab_ServiceEnabled: False - ErrorHub_ServiceEnabled::ErrorHub_ServiceEnabled: False - Game_Performance_ServiceEnabled::Game_Performance_ServiceEnabled: False - Hub_ServiceEnabled::Hub_ServiceEnabled: False - Purchasing_ServiceEnabled::Purchasing_ServiceEnabled: False - UNet_ServiceEnabled::UNet_ServiceEnabled: False - Unity_Ads_ServiceEnabled::Unity_Ads_ServiceEnabled: False - WebGL::emscriptenArgs: - WebGL::template: APPLICATION:Default - additionalIl2CppArgs::additionalIl2CppArgs: - vectorPropertyNames: - - Android::VR::enabledDevices - - Metro::VR::enabledDevices - - N3DS::VR::enabledDevices - - PS3::VR::enabledDevices - - PS4::VR::enabledDevices - - PSM::VR::enabledDevices - - PSP2::VR::enabledDevices - - SamsungTV::VR::enabledDevices - - Standalone::VR::enabledDevices - - Tizen::VR::enabledDevices - - WebGL::VR::enabledDevices - - WebPlayer::VR::enabledDevices - - WiiU::VR::enabledDevices - - Xbox360::VR::enabledDevices - - XboxOne::VR::enabledDevices - - iOS::VR::enabledDevices - - tvOS::VR::enabledDevices - Android::VR::enabledDevices: - - Oculus - Metro::VR::enabledDevices: [] - N3DS::VR::enabledDevices: [] - PS3::VR::enabledDevices: [] - PS4::VR::enabledDevices: - - PlayStationVR - PSM::VR::enabledDevices: [] - PSP2::VR::enabledDevices: [] - SamsungTV::VR::enabledDevices: [] - Standalone::VR::enabledDevices: - - Oculus - Tizen::VR::enabledDevices: [] - WebGL::VR::enabledDevices: [] - WebPlayer::VR::enabledDevices: [] - WiiU::VR::enabledDevices: [] - Xbox360::VR::enabledDevices: [] - XboxOne::VR::enabledDevices: [] - iOS::VR::enabledDevices: [] - tvOS::VR::enabledDevices: [] + vrEditorSettings: {} + cloudServicesEnabled: + Analytics: 0 + Build: 0 + Collab: 0 + ErrorHub: 0 + Game_Performance: 0 + Hub: 0 + Purchasing: 0 + UNet: 0 + Unity_Ads: 0 cloudProjectId: projectName: organizationId: