mirror of
https://github.com/BlackMATov/unity-iso-tools.git
synced 2025-12-15 01:12:05 +07:00
quad tree for visibility wip
This commit is contained in:
@@ -3,6 +3,22 @@
|
|||||||
namespace IsoTools.Internal {
|
namespace IsoTools.Internal {
|
||||||
public class IsoGrid<T> {
|
public class IsoGrid<T> {
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// 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<T> items);
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// CellPool
|
// 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<T> items);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Members
|
// Members
|
||||||
@@ -79,8 +79,8 @@ namespace IsoTools.Internal {
|
|||||||
_itemAdapter = item_adapter;
|
_itemAdapter = item_adapter;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddItem(T content) {
|
public void AddItem(T item) {
|
||||||
_gridItems.Add(content);
|
_gridItems.Add(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ClearItems() {
|
public void ClearItems() {
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using System;
|
namespace IsoTools.Internal {
|
||||||
|
|
||||||
namespace IsoTools.Internal {
|
|
||||||
public class IsoList<T> {
|
public class IsoList<T> {
|
||||||
T[] _data;
|
T[] _data;
|
||||||
int _size;
|
int _size;
|
||||||
@@ -15,7 +13,7 @@ namespace IsoTools.Internal {
|
|||||||
|
|
||||||
public IsoList(int capacity) {
|
public IsoList(int capacity) {
|
||||||
if ( capacity < 0 ) {
|
if ( capacity < 0 ) {
|
||||||
throw new ArgumentOutOfRangeException(
|
throw new System.ArgumentOutOfRangeException(
|
||||||
"capacity", "capacity must be >= 0");
|
"capacity", "capacity must be >= 0");
|
||||||
} else if ( capacity == 0 ) {
|
} else if ( capacity == 0 ) {
|
||||||
_data = _emptyData;
|
_data = _emptyData;
|
||||||
@@ -31,7 +29,7 @@ namespace IsoTools.Internal {
|
|||||||
var new_capacity = _size == 0
|
var new_capacity = _size == 0
|
||||||
? _defaultCapacity : _size * 2;
|
? _defaultCapacity : _size * 2;
|
||||||
var new_data = new T[new_capacity];
|
var new_data = new T[new_capacity];
|
||||||
Array.Copy(_data, new_data, _size);
|
System.Array.Copy(_data, new_data, _size);
|
||||||
_data = new_data;
|
_data = new_data;
|
||||||
}
|
}
|
||||||
_data[_size++] = value;
|
_data[_size++] = value;
|
||||||
@@ -39,7 +37,7 @@ namespace IsoTools.Internal {
|
|||||||
|
|
||||||
public T Pop() {
|
public T Pop() {
|
||||||
if ( _size == 0 ) {
|
if ( _size == 0 ) {
|
||||||
throw new InvalidOperationException("empty list");
|
throw new System.InvalidOperationException("empty list");
|
||||||
}
|
}
|
||||||
var last = _data[--_size];
|
var last = _data[--_size];
|
||||||
_data[_size] = default(T);
|
_data[_size] = default(T);
|
||||||
@@ -48,19 +46,19 @@ namespace IsoTools.Internal {
|
|||||||
|
|
||||||
public T Peek() {
|
public T Peek() {
|
||||||
if ( _size == 0 ) {
|
if ( _size == 0 ) {
|
||||||
throw new InvalidOperationException("empty list");
|
throw new System.InvalidOperationException("empty list");
|
||||||
}
|
}
|
||||||
return _data[_size - 1];
|
return _data[_size - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Clear() {
|
public void Clear() {
|
||||||
Array.Clear(_data, 0, _size);
|
System.Array.Clear(_data, 0, _size);
|
||||||
_size = 0;
|
_size = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UnorderedRemoveAt(int index) {
|
public void UnorderedRemoveAt(int index) {
|
||||||
if ( (uint)index >= (uint)_size ) {
|
if ( (uint)index >= (uint)_size ) {
|
||||||
throw new IndexOutOfRangeException();
|
throw new System.IndexOutOfRangeException();
|
||||||
}
|
}
|
||||||
_data[index] = _data[--_size];
|
_data[index] = _data[--_size];
|
||||||
_data[_size] = default(T);
|
_data[_size] = default(T);
|
||||||
@@ -69,13 +67,13 @@ namespace IsoTools.Internal {
|
|||||||
public T this[int index] {
|
public T this[int index] {
|
||||||
get {
|
get {
|
||||||
if ( (uint)index >= (uint)_size ) {
|
if ( (uint)index >= (uint)_size ) {
|
||||||
throw new IndexOutOfRangeException();
|
throw new System.IndexOutOfRangeException();
|
||||||
}
|
}
|
||||||
return _data[index];
|
return _data[index];
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
if ( (uint)index >= (uint)_size ) {
|
if ( (uint)index >= (uint)_size ) {
|
||||||
throw new IndexOutOfRangeException();
|
throw new System.IndexOutOfRangeException();
|
||||||
}
|
}
|
||||||
_data[index] = value;
|
_data[index] = value;
|
||||||
}
|
}
|
||||||
@@ -89,12 +87,12 @@ namespace IsoTools.Internal {
|
|||||||
get { return _data.Length; }
|
get { return _data.Length; }
|
||||||
set {
|
set {
|
||||||
if ( value < _size ) {
|
if ( value < _size ) {
|
||||||
throw new ArgumentOutOfRangeException("value");
|
throw new System.ArgumentOutOfRangeException("value");
|
||||||
} else if ( value != _data.Length ) {
|
} else if ( value != _data.Length ) {
|
||||||
if ( value > 0 ) {
|
if ( value > 0 ) {
|
||||||
var new_data = new T[value];
|
var new_data = new T[value];
|
||||||
if ( _size > 0 ) {
|
if ( _size > 0 ) {
|
||||||
Array.Copy(_data, new_data, _size);
|
System.Array.Copy(_data, new_data, _size);
|
||||||
}
|
}
|
||||||
_data = new_data;
|
_data = new_data;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -69,9 +69,13 @@ namespace IsoTools.Internal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static IsoMinMax Merge(IsoMinMax a, IsoMinMax b) {
|
public static IsoMinMax Merge(IsoMinMax a, IsoMinMax b) {
|
||||||
return new IsoMinMax(
|
if ( a.min > b.min ) {
|
||||||
a.min < b.min ? a.min : b.min,
|
a.min = b.min;
|
||||||
a.max > b.max ? a.max : b.max);
|
}
|
||||||
|
if ( a.max < b.max ) {
|
||||||
|
a.max = b.max;
|
||||||
|
}
|
||||||
|
return a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -38,15 +38,21 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static IsoPoint2 operator+(IsoPoint2 a, IsoPoint2 b) {
|
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) {
|
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) {
|
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) {
|
public static bool operator==(IsoPoint2 lhs, IsoPoint2 rhs) {
|
||||||
|
|||||||
@@ -1,20 +1,29 @@
|
|||||||
namespace IsoTools.Internal {
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace IsoTools.Internal {
|
||||||
public class IsoQuadTree<T> {
|
public class IsoQuadTree<T> {
|
||||||
|
|
||||||
const int MinChildCountPerNode = 3;
|
// ---------------------------------------------------------------------
|
||||||
|
|
||||||
//
|
//
|
||||||
// IItem
|
// Interfaces
|
||||||
//
|
//
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
|
|
||||||
public interface IItem {
|
public interface IBoundsLookUpper {
|
||||||
|
void LookUp(IsoRect bounds);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
public interface IContentLookUpper {
|
||||||
// Item
|
void LookUp(T content);
|
||||||
//
|
}
|
||||||
|
|
||||||
class Item : IItem {
|
// ---------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// ItemPool
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
|
|
||||||
|
class Item {
|
||||||
public Node Owner = null;
|
public Node Owner = null;
|
||||||
public IsoRect Bounds = IsoRect.zero;
|
public IsoRect Bounds = IsoRect.zero;
|
||||||
public T Content = default(T);
|
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<Item> Contents = new IsoAssocList<Item>(MinChildCountPerNode);
|
|
||||||
|
|
||||||
public Node Init(Node parent, IsoRect bounds) {
|
|
||||||
Parent = parent;
|
|
||||||
Bounds = bounds;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Node Clear(IsoIPool<Node> node_pool, IsoIPool<Item> 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> node_pool, IsoIPool<Item> 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<IsoRect> 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<T> 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> node_pool, IsoIPool<Item> 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> item_pool) {
|
|
||||||
for ( int i = 0, e = Contents.Count; i < e; ++i ) {
|
|
||||||
item_pool.Release(
|
|
||||||
Contents[i].Clear());
|
|
||||||
}
|
|
||||||
Contents.Clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// ItemPool
|
|
||||||
//
|
|
||||||
|
|
||||||
class ItemPool : IsoPool<Item> {
|
class ItemPool : IsoPool<Item> {
|
||||||
public ItemPool(int capacity) : base(capacity) {
|
public ItemPool(int capacity) : base(capacity) {
|
||||||
}
|
}
|
||||||
@@ -171,9 +49,147 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// NodePool
|
// NodePool
|
||||||
//
|
//
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
|
|
||||||
|
const int MinChildCountPerNode = 3;
|
||||||
|
|
||||||
|
class Node {
|
||||||
|
public Node[] Nodes = new Node[4];
|
||||||
|
public IsoAssocList<Item> Items = new IsoAssocList<Item>(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> node_pool, IsoIPool<Item> 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> node_pool, IsoIPool<Item> 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> node_pool, IsoIPool<Item> 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> 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<Node> {
|
class NodePool : IsoPool<Node> {
|
||||||
public NodePool(int capacity) : base(capacity) {
|
public NodePool(int capacity) : base(capacity) {
|
||||||
@@ -184,86 +200,126 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Members
|
// Members
|
||||||
//
|
//
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
|
|
||||||
Node _root = null;
|
Node _rootNode = null;
|
||||||
IsoIPool<Node> _nodePool = null;
|
Dictionary<T, Item> _allItems = null;
|
||||||
IsoIPool<Item> _itemPool = null;
|
IsoIPool<Node> _nodePool = null;
|
||||||
|
IsoIPool<Item> _itemPool = null;
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Public
|
// Public
|
||||||
//
|
//
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
|
|
||||||
public IsoQuadTree(int capacity) {
|
public IsoQuadTree(int capacity) {
|
||||||
_root = null;
|
_rootNode = null;
|
||||||
|
_allItems = new Dictionary<T, Item>(capacity);
|
||||||
_nodePool = new NodePool(capacity);
|
_nodePool = new NodePool(capacity);
|
||||||
_itemPool = new ItemPool(capacity);
|
_itemPool = new ItemPool(capacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IItem Insert(IsoRect bounds, T content) {
|
public void AddItem(IsoRect bounds, T content) {
|
||||||
if ( _root == null ) {
|
if ( bounds.x.size > 0.0f && bounds.y.size > 0.0f ) {
|
||||||
var initial_bounds = new IsoRect(
|
if ( _allItems.ContainsKey(content) ) {
|
||||||
bounds.center - bounds.size * 2.0f,
|
MoveItem(bounds, content);
|
||||||
bounds.center + bounds.size * 2.0f);
|
} else {
|
||||||
_root = _nodePool.Take().Init(null, initial_bounds);
|
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;
|
Item item;
|
||||||
while ( !_root.Insert(bounds, content, out item, _nodePool, _itemPool) ) {
|
if ( _allItems.TryGetValue(content, out item) ) {
|
||||||
GrowUp(
|
if ( item.Owner != null ) {
|
||||||
bounds.center.x < _root.Bounds.center.x,
|
item.Owner.RemoveItem(item);
|
||||||
bounds.center.y < _root.Bounds.center.y);
|
}
|
||||||
|
_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() {
|
public void Clear() {
|
||||||
if ( _root != null ) {
|
if ( _rootNode != null ) {
|
||||||
_nodePool.Release(
|
_nodePool.Release(
|
||||||
_root.Clear(_nodePool, _itemPool));
|
_rootNode.Clear(_nodePool, _itemPool));
|
||||||
_root = null;
|
_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<IsoRect> act) {
|
public void VisitItemsByBounds(IsoRect bounds, IContentLookUpper look_upper) {
|
||||||
if ( _root != null ) {
|
if ( look_upper == null ) {
|
||||||
_root.VisitAllBounds(act);
|
throw new System.ArgumentNullException("look_upper");
|
||||||
}
|
}
|
||||||
}
|
if ( _rootNode != null ) {
|
||||||
|
_rootNode.VisitItemsByBounds(bounds, look_upper);
|
||||||
public void VisitItemsByBounds(IsoRect bounds, System.Action<T> act) {
|
|
||||||
if ( _root != null ) {
|
|
||||||
_root.VisitItemsByBounds(bounds, act);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Private
|
// Private
|
||||||
//
|
//
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
|
|
||||||
void GrowUp(bool left, bool top) {
|
void GrowUp(bool left, bool top) {
|
||||||
var new_root_bounds = _root.Bounds;
|
var new_root_bounds = _rootNode.Bounds;
|
||||||
new_root_bounds.Translate(
|
new_root_bounds.Translate(
|
||||||
left ? -_root.Bounds.size.x : 0.0f,
|
left ? -_rootNode.Bounds.size.x : 0.0f,
|
||||||
top ? -_root.Bounds.size.y : 0.0f);
|
top ? -_rootNode.Bounds.size.y : 0.0f);
|
||||||
new_root_bounds.Resize(_root.Bounds.size * 2.0f);
|
new_root_bounds.Resize(_rootNode.Bounds.size * 2.0f);
|
||||||
var new_root = _nodePool.Take().Init(null, new_root_bounds);
|
var new_root = _nodePool.Take().Init(null, new_root_bounds);
|
||||||
if ( left ) {
|
if ( left ) {
|
||||||
if ( top ) {
|
if ( top ) {
|
||||||
new_root.Children[3] = _root;
|
new_root.Nodes[3] = _rootNode;
|
||||||
} else {
|
} else {
|
||||||
new_root.Children[1] = _root;
|
new_root.Nodes[1] = _rootNode;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ( top ) {
|
if ( top ) {
|
||||||
new_root.Children[2] = _root;
|
new_root.Nodes[2] = _rootNode;
|
||||||
} else {
|
} else {
|
||||||
new_root.Children[0] = _root;
|
new_root.Nodes[0] = _rootNode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_root.Parent = new_root;
|
_rootNode.Parent = new_root;
|
||||||
_root = new_root;
|
_rootNode = new_root;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,9 +102,9 @@ namespace IsoTools.Internal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static IsoRect Merge(IsoRect a, IsoRect b) {
|
public static IsoRect Merge(IsoRect a, IsoRect b) {
|
||||||
return new IsoRect(
|
a.x = IsoMinMax.Merge(a.x, b.x);
|
||||||
IsoMinMax.Merge(a.x, b.x),
|
a.y = IsoMinMax.Merge(a.y, b.y);
|
||||||
IsoMinMax.Merge(a.y, b.y));
|
return a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,12 +7,60 @@ using UnityEngine.Profiling;
|
|||||||
|
|
||||||
namespace IsoTools.Internal {
|
namespace IsoTools.Internal {
|
||||||
public class IsoScreenSolver {
|
public class IsoScreenSolver {
|
||||||
Vector2 _minIsoXY = Vector2.zero;
|
Vector2 _minIsoXY = Vector2.zero;
|
||||||
IsoAssocList<IsoObject> _curVisibles = new IsoAssocList<IsoObject>();
|
IsoAssocList<IsoObject> _oldVisibles = new IsoAssocList<IsoObject>();
|
||||||
IsoAssocList<IsoObject> _oldVisibles = new IsoAssocList<IsoObject>();
|
IsoAssocList<IsoObject> _curVisibles = new IsoAssocList<IsoObject>();
|
||||||
IsoGrid<IsoObject> _visibleGrid = new IsoGrid<IsoObject>(new IsoGridItemAdapter(), 47);
|
|
||||||
IsoGridLookUpper _gridLookUpper = new IsoGridLookUpper();
|
IsoQuadTree<IsoObject> _quadTree = new IsoQuadTree<IsoObject>(47);
|
||||||
List<Renderer> _tmpRenderers = new List<Renderer>();
|
IsoGrid<IsoObject> _screenGrid = new IsoGrid<IsoObject>(new IsoGridItemAdapter(), 47);
|
||||||
|
|
||||||
|
IsoQTBoundsLookUpper _qtBoundsLU = new IsoQTBoundsLookUpper();
|
||||||
|
IsoQTContentLookUpper _qtContentLU = new IsoQTContentLookUpper();
|
||||||
|
IsoGridLookUpper _screenGridLU = new IsoGridLookUpper();
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// IsoQTBoundsLookUpper
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
|
|
||||||
|
class IsoQTBoundsLookUpper : IsoQuadTree<IsoObject>.IBoundsLookUpper {
|
||||||
|
public void LookUp(IsoRect bounds) {
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
IsoUtils.DrawRect(bounds, Color.blue);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// IsoQTContentLookUpper
|
||||||
|
//
|
||||||
|
// ---------------------------------------------------------------------
|
||||||
|
|
||||||
|
class IsoQTContentLookUpper : IsoQuadTree<IsoObject>.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;
|
IsoObject _isoObject;
|
||||||
|
|
||||||
public void LookUp(IsoList<IsoObject> items) {
|
public void LookUp(IsoList<IsoObject> items) {
|
||||||
LookUpSectorDepends(_isoObject, items);
|
LookUpCellForLDepends(_isoObject, items);
|
||||||
LookUpSectorRDepends(_isoObject, items);
|
LookUpCellForRDepends(_isoObject, items);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Setup(IsoObject iso_object) {
|
public void LookUpForDepends(
|
||||||
|
IsoScreenSolver screen_solver, IsoObject iso_object)
|
||||||
|
{
|
||||||
_isoObject = iso_object;
|
_isoObject = iso_object;
|
||||||
}
|
screen_solver._screenGrid.LookUpCells(
|
||||||
|
iso_object.Internal.MinGridCell,
|
||||||
public void Reset() {
|
iso_object.Internal.MaxGridCell,
|
||||||
|
this);
|
||||||
_isoObject = null;
|
_isoObject = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -69,14 +120,14 @@ namespace IsoTools.Internal {
|
|||||||
get { return _minIsoXY; }
|
get { return _minIsoXY; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public IsoAssocList<IsoObject> curVisibles {
|
|
||||||
get { return _curVisibles; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public IsoAssocList<IsoObject> oldVisibles {
|
public IsoAssocList<IsoObject> oldVisibles {
|
||||||
get { return _oldVisibles; }
|
get { return _oldVisibles; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IsoAssocList<IsoObject> curVisibles {
|
||||||
|
get { return _curVisibles; }
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Callbacks
|
// Callbacks
|
||||||
@@ -84,15 +135,22 @@ namespace IsoTools.Internal {
|
|||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
|
|
||||||
public void OnAddInstance(IsoObject iso_object) {
|
public void OnAddInstance(IsoObject iso_object) {
|
||||||
|
_quadTree.AddItem(
|
||||||
|
iso_object.Internal.ScreenBounds,
|
||||||
|
iso_object);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnRemoveInstance(IsoObject iso_object) {
|
public void OnRemoveInstance(IsoObject iso_object) {
|
||||||
_oldVisibles.Remove(iso_object);
|
_oldVisibles.Remove(iso_object);
|
||||||
_curVisibles.Remove(iso_object);
|
_curVisibles.Remove(iso_object);
|
||||||
|
_quadTree.RemoveItem(iso_object);
|
||||||
ClearIsoObjectDepends(iso_object);
|
ClearIsoObjectDepends(iso_object);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool OnMarkDirtyInstance(IsoObject 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) ) {
|
if ( !iso_object.Internal.Dirty && _curVisibles.Contains(iso_object) ) {
|
||||||
iso_object.Internal.Dirty = true;
|
iso_object.Internal.Dirty = true;
|
||||||
return true;
|
return true;
|
||||||
@@ -102,6 +160,7 @@ namespace IsoTools.Internal {
|
|||||||
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
public void OnDrawGizmos(IsoWorld iso_world) {
|
public void OnDrawGizmos(IsoWorld iso_world) {
|
||||||
|
_quadTree.VisitAllBounds(_qtBoundsLU);
|
||||||
/*
|
/*
|
||||||
for ( int y = 0, ye = (int)_sectorsNumPosCount.y; y < ye; ++y ) {
|
for ( int y = 0, ye = (int)_sectorsNumPosCount.y; y < ye; ++y ) {
|
||||||
for ( int x = 0, xe = (int)_sectorsNumPosCount.x; x < xe; ++x ) {
|
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<IsoObject> instances) {
|
public void StepSortingAction(IsoWorld iso_world, IsoAssocList<IsoObject> instances) {
|
||||||
Profiler.BeginSample("ResolveVisibles");
|
Profiler.BeginSample("IsoScreenSolver.ResolveVisibles");
|
||||||
ResolveVisibles(instances);
|
ResolveVisibles(instances);
|
||||||
Profiler.EndSample();
|
Profiler.EndSample();
|
||||||
Profiler.BeginSample("ResolveVisibleGrid");
|
Profiler.BeginSample("IsoScreenSolver.ResolveVisibleGrid");
|
||||||
ResolveVisibleGrid(iso_world);
|
ResolveVisibleGrid(iso_world);
|
||||||
Profiler.EndSample();
|
Profiler.EndSample();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PostStepSortingAction() {
|
public void PostStepSortingAction() {
|
||||||
_tmpRenderers.Clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Clear() {
|
public void Clear() {
|
||||||
_curVisibles.Clear();
|
|
||||||
_oldVisibles.Clear();
|
_oldVisibles.Clear();
|
||||||
_visibleGrid.ClearGrid();
|
_curVisibles.Clear();
|
||||||
|
_quadTree.Clear();
|
||||||
|
_screenGrid.ClearGrid();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetupIsoObjectDepends(IsoObject iso_object) {
|
public void SetupIsoObjectDepends(IsoObject iso_object) {
|
||||||
ClearIsoObjectDepends(iso_object);
|
ClearIsoObjectDepends(iso_object);
|
||||||
_gridLookUpper.Setup(iso_object);
|
_screenGridLU.LookUpForDepends(this, iso_object);
|
||||||
_visibleGrid.LookUpCells(
|
|
||||||
iso_object.Internal.MinGridCell,
|
|
||||||
iso_object.Internal.MaxGridCell,
|
|
||||||
_gridLookUpper);
|
|
||||||
_gridLookUpper.Reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ClearIsoObjectDepends(IsoObject iso_object) {
|
public void ClearIsoObjectDepends(IsoObject iso_object) {
|
||||||
@@ -173,7 +227,15 @@ namespace IsoTools.Internal {
|
|||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
|
|
||||||
void ResolveVisibles(IsoAssocList<IsoObject> instances) {
|
void ResolveVisibles(IsoAssocList<IsoObject> instances) {
|
||||||
_oldVisibles.Clear();
|
Profiler.BeginSample("ProcessAllInstances");
|
||||||
|
ProcessAllInstances(instances);
|
||||||
|
Profiler.EndSample();
|
||||||
|
Profiler.BeginSample("ProcessNewVisibles");
|
||||||
|
ProcessNewVisibles();
|
||||||
|
Profiler.EndSample();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProcessAllInstances(IsoAssocList<IsoObject> instances) {
|
||||||
if ( instances.Count > 0 ) {
|
if ( instances.Count > 0 ) {
|
||||||
_minIsoXY.Set(float.MaxValue, float.MaxValue);
|
_minIsoXY.Set(float.MaxValue, float.MaxValue);
|
||||||
for ( int i = 0, e = instances.Count; i < e; ++i ) {
|
for ( int i = 0, e = instances.Count; i < e; ++i ) {
|
||||||
@@ -191,36 +253,22 @@ namespace IsoTools.Internal {
|
|||||||
{
|
{
|
||||||
iso_object.FixIsoPosition();
|
iso_object.FixIsoPosition();
|
||||||
}
|
}
|
||||||
if ( IsIsoObjectVisible(iso_object) ) {
|
|
||||||
iso_object.Internal.Placed = false;
|
|
||||||
_oldVisibles.Add(iso_object);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_minIsoXY.Set(0.0f, 0.0f);
|
_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;
|
_curVisibles = _oldVisibles;
|
||||||
_oldVisibles = temp_visibles;
|
_oldVisibles = swap_tmp;
|
||||||
}
|
|
||||||
|
|
||||||
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<Renderer> GetIsoObjectRenderers(IsoObject iso_object) {
|
|
||||||
if ( iso_object.cacheRenderers ) {
|
|
||||||
return iso_object.Internal.Renderers;
|
|
||||||
} else {
|
|
||||||
iso_object.GetComponentsInChildren<Renderer>(_tmpRenderers);
|
|
||||||
return _tmpRenderers;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
@@ -230,24 +278,24 @@ namespace IsoTools.Internal {
|
|||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
|
|
||||||
void ResolveVisibleGrid(IsoWorld iso_world) {
|
void ResolveVisibleGrid(IsoWorld iso_world) {
|
||||||
_visibleGrid.ClearItems();
|
_screenGrid.ClearItems();
|
||||||
for ( int i = 0, e = _curVisibles.Count; i < e; ++i ) {
|
for ( int i = 0, e = _curVisibles.Count; i < e; ++i ) {
|
||||||
var iso_object = _curVisibles[i];
|
var iso_object = _curVisibles[i];
|
||||||
_visibleGrid.AddItem(iso_object);
|
_screenGrid.AddItem(iso_object);
|
||||||
}
|
}
|
||||||
var min_sector_size = IsoUtils.Vec2MaxF(
|
var min_sector_size = IsoUtils.Vec2MaxF(
|
||||||
iso_world.IsoToScreen(IsoUtils.vec3OneXY) -
|
iso_world.IsoToScreen(IsoUtils.vec3OneXY) -
|
||||||
iso_world.IsoToScreen(Vector3.zero));
|
iso_world.IsoToScreen(Vector3.zero));
|
||||||
_visibleGrid.RebuildGrid(min_sector_size);
|
_screenGrid.RebuildGrid(min_sector_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// LookUpSectorDepends
|
// LookUpCellForDepends
|
||||||
//
|
//
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
|
|
||||||
static void LookUpSectorDepends(IsoObject obj_a, IsoList<IsoObject> others) {
|
static void LookUpCellForLDepends(IsoObject obj_a, IsoList<IsoObject> others) {
|
||||||
for ( int i = 0, e = others.Count; i < e; ++i ) {
|
for ( int i = 0, e = others.Count; i < e; ++i ) {
|
||||||
var obj_b = others[i];
|
var obj_b = others[i];
|
||||||
if ( obj_a != obj_b && !obj_b.Internal.Dirty && IsIsoObjectDepends(obj_a, obj_b) ) {
|
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<IsoObject> others) {
|
static void LookUpCellForRDepends(IsoObject obj_a, IsoList<IsoObject> others) {
|
||||||
for ( int i = 0, e = others.Count; i < e; ++i ) {
|
for ( int i = 0, e = others.Count; i < e; ++i ) {
|
||||||
var obj_b = others[i];
|
var obj_b = others[i];
|
||||||
if ( obj_a != obj_b && !obj_b.Internal.Dirty && IsIsoObjectDepends(obj_b, obj_a) ) {
|
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_y = b_max.y - a_min.y;
|
||||||
var dB_z = a_max.z - b_min.z;
|
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 dD_x = dB_x - dA_x;
|
||||||
var dP_y = a_size.y + b_size.y - Mathf.Abs(dA_y - dB_y);
|
var dD_y = dB_y - dA_y;
|
||||||
var dP_z = a_size.z + b_size.z - Mathf.Abs(dA_z - dB_z);
|
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 ) {
|
if ( dP_x <= dP_y && dP_x <= dP_z ) {
|
||||||
return dA_x > dB_x;
|
return dA_x > dB_x;
|
||||||
|
|||||||
@@ -43,11 +43,11 @@ namespace IsoTools.Internal {
|
|||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
|
|
||||||
public bool StepSortingAction(IsoWorld iso_world, IsoScreenSolver screen_solver) {
|
public bool StepSortingAction(IsoWorld iso_world, IsoScreenSolver screen_solver) {
|
||||||
Profiler.BeginSample("ResolveVisibles");
|
Profiler.BeginSample("IsoSortingSolver.ResolveVisibles");
|
||||||
var dirty = ResolveVisibles(screen_solver);
|
var dirty = ResolveVisibles(screen_solver);
|
||||||
Profiler.EndSample();
|
Profiler.EndSample();
|
||||||
if ( dirty ) {
|
if ( dirty ) {
|
||||||
Profiler.BeginSample("PlaceAllVisibles");
|
Profiler.BeginSample("IsoSortingSolver.PlaceAllVisibles");
|
||||||
PlaceAllVisibles(iso_world, screen_solver);
|
PlaceAllVisibles(iso_world, screen_solver);
|
||||||
Profiler.EndSample();
|
Profiler.EndSample();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ namespace IsoTools {
|
|||||||
void Awake() {
|
void Awake() {
|
||||||
FixCachedTransform();
|
FixCachedTransform();
|
||||||
FixLastTransform();
|
FixLastTransform();
|
||||||
FixIsoPosition();
|
FixTransform();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnEnable() {
|
protected override void OnEnable() {
|
||||||
|
|||||||
@@ -25,3 +25,7 @@ EditorBuildSettings:
|
|||||||
path: Assets/IsoTools/Examples/Scenes/Scene08.unity
|
path: Assets/IsoTools/Examples/Scenes/Scene08.unity
|
||||||
- enabled: 1
|
- enabled: 1
|
||||||
path: Assets/IsoTools/Examples/Scenes/Scene09.unity
|
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
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
--- !u!129 &1
|
--- !u!129 &1
|
||||||
PlayerSettings:
|
PlayerSettings:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
serializedVersion: 8
|
serializedVersion: 10
|
||||||
productGUID: 0ae4d8e5611a65d45bd97550aa4471af
|
productGUID: 0ae4d8e5611a65d45bd97550aa4471af
|
||||||
AndroidProfiler: 0
|
AndroidProfiler: 0
|
||||||
defaultScreenOrientation: 4
|
defaultScreenOrientation: 4
|
||||||
@@ -14,21 +14,46 @@ PlayerSettings:
|
|||||||
productName: UnityIso
|
productName: UnityIso
|
||||||
defaultCursor: {fileID: 0}
|
defaultCursor: {fileID: 0}
|
||||||
cursorHotspot: {x: 0, y: 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_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_VirtualRealitySplashScreen: {fileID: 0}
|
||||||
|
m_HolographicTrackingLossScreen: {fileID: 0}
|
||||||
defaultScreenWidth: 1024
|
defaultScreenWidth: 1024
|
||||||
defaultScreenHeight: 768
|
defaultScreenHeight: 768
|
||||||
defaultScreenWidthWeb: 960
|
defaultScreenWidthWeb: 960
|
||||||
defaultScreenHeightWeb: 600
|
defaultScreenHeightWeb: 600
|
||||||
m_RenderingPath: 1
|
m_StereoRenderingPath: 0
|
||||||
m_MobileRenderingPath: 1
|
|
||||||
m_ActiveColorSpace: 0
|
m_ActiveColorSpace: 0
|
||||||
m_MTRendering: 1
|
m_MTRendering: 1
|
||||||
m_MobileMTRendering: 0
|
m_MobileMTRendering: 0
|
||||||
m_StackTraceTypes: 010000000100000001000000010000000100000001000000
|
m_StackTraceTypes: 010000000100000001000000010000000100000001000000
|
||||||
iosShowActivityIndicatorOnLoading: -1
|
iosShowActivityIndicatorOnLoading: -1
|
||||||
androidShowActivityIndicatorOnLoading: -1
|
androidShowActivityIndicatorOnLoading: -1
|
||||||
|
tizenShowActivityIndicatorOnLoading: -1
|
||||||
iosAppInBackgroundBehavior: 0
|
iosAppInBackgroundBehavior: 0
|
||||||
displayResolutionDialog: 1
|
displayResolutionDialog: 1
|
||||||
iosAllowHTTPDownload: 1
|
iosAllowHTTPDownload: 1
|
||||||
@@ -43,7 +68,7 @@ PlayerSettings:
|
|||||||
defaultIsNativeResolution: 1
|
defaultIsNativeResolution: 1
|
||||||
runInBackground: 1
|
runInBackground: 1
|
||||||
captureSingleScreen: 0
|
captureSingleScreen: 0
|
||||||
Override IPod Music: 0
|
muteOtherAudioSources: 0
|
||||||
Prepare IOS For Recording: 0
|
Prepare IOS For Recording: 0
|
||||||
submitAnalytics: 1
|
submitAnalytics: 1
|
||||||
usePlayerLog: 1
|
usePlayerLog: 1
|
||||||
@@ -75,7 +100,6 @@ PlayerSettings:
|
|||||||
xboxOneResolution: 0
|
xboxOneResolution: 0
|
||||||
xboxOneMonoLoggingLevel: 0
|
xboxOneMonoLoggingLevel: 0
|
||||||
xboxOneLoggingLevel: 1
|
xboxOneLoggingLevel: 1
|
||||||
ps3SplashScreen: {fileID: 0}
|
|
||||||
videoMemoryForVertexBuffers: 0
|
videoMemoryForVertexBuffers: 0
|
||||||
psp2PowerMode: 0
|
psp2PowerMode: 0
|
||||||
psp2AcquireBGM: 1
|
psp2AcquireBGM: 1
|
||||||
@@ -97,9 +121,9 @@ PlayerSettings:
|
|||||||
bundleIdentifier: com.Company.ProductName
|
bundleIdentifier: com.Company.ProductName
|
||||||
bundleVersion: 1.0
|
bundleVersion: 1.0
|
||||||
preloadedAssets: []
|
preloadedAssets: []
|
||||||
metroEnableIndependentInputSource: 0
|
metroInputSource: 0
|
||||||
|
m_HolographicPauseOnTrackingLoss: 1
|
||||||
xboxOneDisableKinectGpuReservation: 0
|
xboxOneDisableKinectGpuReservation: 0
|
||||||
singlePassStereoRendering: 0
|
|
||||||
protectGraphicsMemory: 0
|
protectGraphicsMemory: 0
|
||||||
AndroidBundleVersionCode: 1
|
AndroidBundleVersionCode: 1
|
||||||
AndroidMinSdkVersion: 9
|
AndroidMinSdkVersion: 9
|
||||||
@@ -120,10 +144,10 @@ PlayerSettings:
|
|||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Bits: 238
|
m_Bits: 238
|
||||||
iPhoneSdkVersion: 988
|
iPhoneSdkVersion: 988
|
||||||
iPhoneTargetOSVersion: 22
|
iOSTargetOSVersionString: 6.0
|
||||||
tvOSSdkVersion: 0
|
tvOSSdkVersion: 0
|
||||||
tvOSTargetOSVersion: 900
|
|
||||||
tvOSRequireExtendedGameController: 0
|
tvOSRequireExtendedGameController: 0
|
||||||
|
tvOSTargetOSVersionString: 9.0
|
||||||
uIPrerenderedIcon: 0
|
uIPrerenderedIcon: 0
|
||||||
uIRequiresPersistentWiFi: 0
|
uIRequiresPersistentWiFi: 0
|
||||||
uIRequiresFullScreen: 1
|
uIRequiresFullScreen: 1
|
||||||
@@ -144,6 +168,7 @@ PlayerSettings:
|
|||||||
tvOSSmallIconLayers: []
|
tvOSSmallIconLayers: []
|
||||||
tvOSLargeIconLayers: []
|
tvOSLargeIconLayers: []
|
||||||
tvOSTopShelfImageLayers: []
|
tvOSTopShelfImageLayers: []
|
||||||
|
tvOSTopShelfImageWideLayers: []
|
||||||
iOSLaunchScreenType: 0
|
iOSLaunchScreenType: 0
|
||||||
iOSLaunchScreenPortrait: {fileID: 0}
|
iOSLaunchScreenPortrait: {fileID: 0}
|
||||||
iOSLaunchScreenLandscape: {fileID: 0}
|
iOSLaunchScreenLandscape: {fileID: 0}
|
||||||
@@ -163,6 +188,8 @@ PlayerSettings:
|
|||||||
iOSLaunchScreeniPadCustomXibPath:
|
iOSLaunchScreeniPadCustomXibPath:
|
||||||
iOSDeviceRequirements: []
|
iOSDeviceRequirements: []
|
||||||
iOSURLSchemes: []
|
iOSURLSchemes: []
|
||||||
|
iOSBackgroundModes: 0
|
||||||
|
iOSMetalForceHardShadows: 0
|
||||||
appleDeveloperTeamID:
|
appleDeveloperTeamID:
|
||||||
AndroidTargetDevice: 0
|
AndroidTargetDevice: 0
|
||||||
AndroidSplashScreenScale: 0
|
AndroidSplashScreenScale: 0
|
||||||
@@ -187,6 +214,63 @@ PlayerSettings:
|
|||||||
m_Height: 0
|
m_Height: 0
|
||||||
m_BuildTargetBatching: []
|
m_BuildTargetBatching: []
|
||||||
m_BuildTargetGraphicsAPIs: []
|
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
|
webPlayerTemplate: APPLICATION:Default
|
||||||
m_TemplateCustomTags: {}
|
m_TemplateCustomTags: {}
|
||||||
wiiUTitleID: 0005000011000000
|
wiiUTitleID: 0005000011000000
|
||||||
@@ -224,24 +308,6 @@ PlayerSettings:
|
|||||||
xboxAdditionalTitleMemorySize: 0
|
xboxAdditionalTitleMemorySize: 0
|
||||||
xboxDeployKinectHeadOrientation: 0
|
xboxDeployKinectHeadOrientation: 0
|
||||||
xboxDeployKinectHeadPosition: 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
|
ps4NPAgeRating: 12
|
||||||
ps4NPTitleSecret:
|
ps4NPTitleSecret:
|
||||||
ps4NPTrophyPackPath:
|
ps4NPTrophyPackPath:
|
||||||
@@ -283,8 +349,8 @@ PlayerSettings:
|
|||||||
ps4pnFriends: 1
|
ps4pnFriends: 1
|
||||||
ps4pnGameCustomData: 1
|
ps4pnGameCustomData: 1
|
||||||
playerPrefsSupport: 0
|
playerPrefsSupport: 0
|
||||||
ps4UseResolutionFallback: 0
|
|
||||||
restrictedAudioUsageRights: 0
|
restrictedAudioUsageRights: 0
|
||||||
|
ps4UseResolutionFallback: 0
|
||||||
ps4ReprojectionSupport: 0
|
ps4ReprojectionSupport: 0
|
||||||
ps4UseAudio3dBackend: 0
|
ps4UseAudio3dBackend: 0
|
||||||
ps4SocialScreenEnabled: 0
|
ps4SocialScreenEnabled: 0
|
||||||
@@ -351,8 +417,36 @@ PlayerSettings:
|
|||||||
psp2InfoBarColor: 0
|
psp2InfoBarColor: 0
|
||||||
psp2UseDebugIl2cppLibs: 0
|
psp2UseDebugIl2cppLibs: 0
|
||||||
psmSplashimage: {fileID: 0}
|
psmSplashimage: {fileID: 0}
|
||||||
|
splashScreenBackgroundSourceLandscape: {fileID: 0}
|
||||||
|
splashScreenBackgroundSourcePortrait: {fileID: 0}
|
||||||
spritePackerPolicy:
|
spritePackerPolicy:
|
||||||
|
webGLMemorySize: 256
|
||||||
|
webGLExceptionSupport: 0
|
||||||
|
webGLDataCaching: 0
|
||||||
|
webGLDebugSymbols: 0
|
||||||
|
webGLEmscriptenArgs:
|
||||||
|
webGLModulesDirectory:
|
||||||
|
webGLTemplate: APPLICATION:Default
|
||||||
|
webGLAnalyzeBuildSize: 0
|
||||||
|
webGLUseEmbeddedResources: 0
|
||||||
|
webGLUseWasm: 0
|
||||||
|
webGLCompressionFormat: 1
|
||||||
scriptingDefineSymbols: {}
|
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
|
metroPackageName: UnityIso
|
||||||
metroPackageVersion:
|
metroPackageVersion:
|
||||||
metroCertificatePath:
|
metroCertificatePath:
|
||||||
@@ -383,6 +477,8 @@ PlayerSettings:
|
|||||||
tizenSigningProfileName:
|
tizenSigningProfileName:
|
||||||
tizenGPSPermissions: 0
|
tizenGPSPermissions: 0
|
||||||
tizenMicrophonePermissions: 0
|
tizenMicrophonePermissions: 0
|
||||||
|
tizenDeploymentTarget:
|
||||||
|
tizenDeploymentTargetType: -256
|
||||||
tizenMinOSVersion: 0
|
tizenMinOSVersion: 0
|
||||||
n3dsUseExtSaveData: 0
|
n3dsUseExtSaveData: 0
|
||||||
n3dsCompressStaticMem: 1
|
n3dsCompressStaticMem: 1
|
||||||
@@ -413,141 +509,27 @@ PlayerSettings:
|
|||||||
XboxOnePackageEncryption: 0
|
XboxOnePackageEncryption: 0
|
||||||
XboxOnePackageUpdateGranularity: 2
|
XboxOnePackageUpdateGranularity: 2
|
||||||
XboxOneDescription:
|
XboxOneDescription:
|
||||||
|
XboxOneLanguage:
|
||||||
|
- enus
|
||||||
|
XboxOneCapability: []
|
||||||
|
XboxOneGameRating: {}
|
||||||
XboxOneIsContentPackage: 0
|
XboxOneIsContentPackage: 0
|
||||||
XboxOneEnableGPUVariability: 0
|
XboxOneEnableGPUVariability: 0
|
||||||
XboxOneSockets: {}
|
XboxOneSockets: {}
|
||||||
XboxOneSplashScreen: {fileID: 0}
|
XboxOneSplashScreen: {fileID: 0}
|
||||||
XboxOneAllowedProductIds: []
|
XboxOneAllowedProductIds: []
|
||||||
XboxOnePersistentLocalStorageSize: 0
|
XboxOnePersistentLocalStorageSize: 0
|
||||||
intPropertyNames:
|
vrEditorSettings: {}
|
||||||
- Android::ScriptingBackend
|
cloudServicesEnabled:
|
||||||
- Standalone::ScriptingBackend
|
Analytics: 0
|
||||||
- WebGL::ScriptingBackend
|
Build: 0
|
||||||
- WebGL::audioCompressionFormat
|
Collab: 0
|
||||||
- WebGL::exceptionSupport
|
ErrorHub: 0
|
||||||
- WebGL::memorySize
|
Game_Performance: 0
|
||||||
- iOS::Architecture
|
Hub: 0
|
||||||
- iOS::EnableIncrementalBuildSupportForIl2cpp
|
Purchasing: 0
|
||||||
- iOS::ScriptingBackend
|
UNet: 0
|
||||||
- tvOS::Architecture
|
Unity_Ads: 0
|
||||||
- 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: []
|
|
||||||
cloudProjectId:
|
cloudProjectId:
|
||||||
projectName:
|
projectName:
|
||||||
organizationId:
|
organizationId:
|
||||||
|
|||||||
Reference in New Issue
Block a user