mirror of
https://github.com/BlackMATov/unity-iso-tools.git
synced 2025-12-15 01:12:05 +07:00
new sorting wip
This commit is contained in:
@@ -40,6 +40,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 9a9c584f9a39449438abc7ba59a68778, type: 3}
|
m_Script: {fileID: 11500000, guid: 9a9c584f9a39449438abc7ba59a68778, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
Visited: 0
|
||||||
_size: {x: 1, y: 1, z: 1}
|
_size: {x: 1, y: 1, z: 1}
|
||||||
_position: {x: 0, y: 0, z: 0}
|
_position: {x: 0, y: 0, z: 0}
|
||||||
_isAlignment: 1
|
_isAlignment: 1
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 9a9c584f9a39449438abc7ba59a68778, type: 3}
|
m_Script: {fileID: 11500000, guid: 9a9c584f9a39449438abc7ba59a68778, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
Visited: 0
|
||||||
_size: {x: 1, y: 1, z: 3}
|
_size: {x: 1, y: 1, z: 3}
|
||||||
_position: {x: 0, y: 0, z: 0}
|
_position: {x: 0, y: 0, z: 0}
|
||||||
_isAlignment: 1
|
_isAlignment: 1
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 9a9c584f9a39449438abc7ba59a68778, type: 3}
|
m_Script: {fileID: 11500000, guid: 9a9c584f9a39449438abc7ba59a68778, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
Visited: 0
|
||||||
_size: {x: 1, y: 3, z: 1}
|
_size: {x: 1, y: 3, z: 1}
|
||||||
_position: {x: 0, y: 0, z: 0}
|
_position: {x: 0, y: 0, z: 0}
|
||||||
_isAlignment: 1
|
_isAlignment: 1
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 9a9c584f9a39449438abc7ba59a68778, type: 3}
|
m_Script: {fileID: 11500000, guid: 9a9c584f9a39449438abc7ba59a68778, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
Visited: 0
|
||||||
_size: {x: 3, y: 1, z: 1}
|
_size: {x: 3, y: 1, z: 1}
|
||||||
_position: {x: 0, y: 0, z: 0}
|
_position: {x: 0, y: 0, z: 0}
|
||||||
_isAlignment: 1
|
_isAlignment: 1
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 9a9c584f9a39449438abc7ba59a68778, type: 3}
|
m_Script: {fileID: 11500000, guid: 9a9c584f9a39449438abc7ba59a68778, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
Visited: 0
|
||||||
_size: {x: 3, y: 3, z: 0}
|
_size: {x: 3, y: 3, z: 0}
|
||||||
_position: {x: 0, y: 0, z: 0}
|
_position: {x: 0, y: 0, z: 0}
|
||||||
_isAlignment: 1
|
_isAlignment: 1
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -87,60 +87,6 @@ NavMeshSettings:
|
|||||||
cellSize: .166666672
|
cellSize: .166666672
|
||||||
manualCellSize: 0
|
manualCellSize: 0
|
||||||
m_NavMeshData: {fileID: 0}
|
m_NavMeshData: {fileID: 0}
|
||||||
--- !u!1001 &561255279
|
|
||||||
Prefab:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Modification:
|
|
||||||
m_TransformParent: {fileID: 0}
|
|
||||||
m_Modifications:
|
|
||||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
|
||||||
propertyPath: m_LocalPosition.x
|
|
||||||
value: 33.5754013
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
|
||||||
propertyPath: m_LocalPosition.y
|
|
||||||
value: 47.6849327
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
|
||||||
propertyPath: m_LocalPosition.z
|
|
||||||
value: 67
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
|
||||||
propertyPath: m_LocalRotation.x
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
|
||||||
propertyPath: m_LocalRotation.y
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
|
||||||
propertyPath: m_LocalRotation.z
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
|
||||||
propertyPath: m_LocalRotation.w
|
|
||||||
value: 1
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
|
||||||
propertyPath: m_RootOrder
|
|
||||||
value: 2
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
|
||||||
propertyPath: _position.x
|
|
||||||
value: 4.02953959
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
|
||||||
propertyPath: _position.y
|
|
||||||
value: 1.931077
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
|
||||||
propertyPath: _isAlignment
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
m_RemovedComponents: []
|
|
||||||
m_ParentPrefab: {fileID: 100100000, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
|
||||||
m_IsPrefabParent: 0
|
|
||||||
--- !u!1 &600542277
|
--- !u!1 &600542277
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -240,120 +186,224 @@ Transform:
|
|||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 3
|
m_RootOrder: 4
|
||||||
--- !u!1001 &1642840748
|
--- !u!1001 &854583122
|
||||||
Prefab:
|
Prefab:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Modification:
|
m_Modification:
|
||||||
m_TransformParent: {fileID: 0}
|
m_TransformParent: {fileID: 0}
|
||||||
m_Modifications:
|
m_Modifications:
|
||||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
propertyPath: m_LocalPosition.x
|
propertyPath: m_LocalPosition.x
|
||||||
value: -14.4245987
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
propertyPath: m_LocalPosition.y
|
propertyPath: m_LocalPosition.y
|
||||||
value: 23.6849327
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
propertyPath: m_LocalPosition.z
|
propertyPath: m_LocalPosition.z
|
||||||
value: 34
|
value: 25.75
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
propertyPath: m_LocalRotation.x
|
propertyPath: m_LocalRotation.x
|
||||||
value: 0
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
propertyPath: m_LocalRotation.y
|
propertyPath: m_LocalRotation.y
|
||||||
value: 0
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
propertyPath: m_LocalRotation.z
|
propertyPath: m_LocalRotation.z
|
||||||
value: 0
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
propertyPath: m_LocalRotation.w
|
propertyPath: m_LocalRotation.w
|
||||||
value: 1
|
value: 1
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
propertyPath: m_RootOrder
|
propertyPath: m_RootOrder
|
||||||
value: 1
|
value: 2
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 11462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
propertyPath: _position.y
|
propertyPath: Visited
|
||||||
value: 1.931077
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 11462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
propertyPath: _position.x
|
propertyPath: _position.x
|
||||||
value: 1.02953959
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 11462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
|
||||||
propertyPath: _isAlignment
|
|
||||||
value: 0
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
m_RemovedComponents: []
|
- target: {fileID: 117528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
m_ParentPrefab: {fileID: 100100000, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
|
||||||
m_IsPrefabParent: 0
|
|
||||||
--- !u!1001 &2127795033
|
|
||||||
Prefab:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Modification:
|
|
||||||
m_TransformParent: {fileID: 0}
|
|
||||||
m_Modifications:
|
|
||||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
|
||||||
propertyPath: m_LocalPosition.x
|
|
||||||
value: 1.57540131
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
|
||||||
propertyPath: m_LocalPosition.y
|
|
||||||
value: 15.6849327
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
|
||||||
propertyPath: m_LocalPosition.z
|
|
||||||
value: 1
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
|
||||||
propertyPath: m_LocalRotation.x
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
|
||||||
propertyPath: m_LocalRotation.y
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
|
||||||
propertyPath: m_LocalRotation.z
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
|
||||||
propertyPath: m_LocalRotation.w
|
|
||||||
value: 1
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
|
||||||
propertyPath: m_RootOrder
|
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 11462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
|
||||||
propertyPath: _position.x
|
|
||||||
value: 1.02953959
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 11462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
|
||||||
propertyPath: _position.y
|
|
||||||
value: .931077003
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 162204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
|
||||||
propertyPath: m_Name
|
propertyPath: m_Name
|
||||||
value: Cube_3x1x1 (1)
|
value: Cube_1x1x1 (1)
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 11462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
propertyPath: _isAlignment
|
propertyPath: _position.y
|
||||||
value: 0
|
|
||||||
objectReference: {fileID: 0}
|
|
||||||
- target: {fileID: 11462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
|
||||||
propertyPath: _position.z
|
|
||||||
value: 0
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
m_RemovedComponents: []
|
m_RemovedComponents: []
|
||||||
m_ParentPrefab: {fileID: 100100000, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
|
m_ParentPrefab: {fileID: 100100000, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
m_IsPrefabParent: 0
|
||||||
|
--- !u!1001 &1347240948
|
||||||
|
Prefab:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Modification:
|
||||||
|
m_TransformParent: {fileID: 0}
|
||||||
|
m_Modifications:
|
||||||
|
- target: {fileID: 463702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
|
||||||
|
propertyPath: m_LocalPosition.x
|
||||||
|
value: 16
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 463702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
|
||||||
|
propertyPath: m_LocalPosition.y
|
||||||
|
value: 8
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 463702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
|
||||||
|
propertyPath: m_LocalPosition.z
|
||||||
|
value: 75.25
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 463702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
|
||||||
|
propertyPath: m_LocalRotation.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 463702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
|
||||||
|
propertyPath: m_LocalRotation.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 463702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
|
||||||
|
propertyPath: m_LocalRotation.z
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 463702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
|
||||||
|
propertyPath: m_LocalRotation.w
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 463702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
|
||||||
|
propertyPath: m_RootOrder
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 11463702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
|
||||||
|
propertyPath: Visited
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 11463702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
|
||||||
|
propertyPath: _position.x
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
m_RemovedComponents: []
|
||||||
|
m_ParentPrefab: {fileID: 100100000, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
|
||||||
|
m_IsPrefabParent: 0
|
||||||
|
--- !u!1001 &1843868497
|
||||||
|
Prefab:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Modification:
|
||||||
|
m_TransformParent: {fileID: 0}
|
||||||
|
m_Modifications:
|
||||||
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: m_LocalPosition.x
|
||||||
|
value: 16
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: m_LocalPosition.y
|
||||||
|
value: -8
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: m_LocalPosition.z
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: m_LocalRotation.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: m_LocalRotation.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: m_LocalRotation.z
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: m_LocalRotation.w
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: m_RootOrder
|
||||||
|
value: 3
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: Visited
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: _position.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: _position.y
|
||||||
|
value: -1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
m_RemovedComponents: []
|
||||||
|
m_ParentPrefab: {fileID: 100100000, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
m_IsPrefabParent: 0
|
||||||
|
--- !u!1001 &2095666642
|
||||||
|
Prefab:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Modification:
|
||||||
|
m_TransformParent: {fileID: 0}
|
||||||
|
m_Modifications:
|
||||||
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: m_LocalPosition.x
|
||||||
|
value: 32
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: m_LocalPosition.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: m_LocalPosition.z
|
||||||
|
value: 50.5
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: m_LocalRotation.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: m_LocalRotation.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: m_LocalRotation.z
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: m_LocalRotation.w
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: m_RootOrder
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: Visited
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: _position.x
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 117528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: m_Name
|
||||||
|
value: Cube_1x1x1 (2)
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 11417528, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
|
propertyPath: _position.y
|
||||||
|
value: -1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
m_RemovedComponents: []
|
||||||
|
m_ParentPrefab: {fileID: 100100000, guid: c1b9b2ad3a021c549aa9190df3101248, type: 2}
|
||||||
m_IsPrefabParent: 0
|
m_IsPrefabParent: 0
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
@@ -8,6 +9,10 @@ namespace IsoTools {
|
|||||||
[ExecuteInEditMode, DisallowMultipleComponent]
|
[ExecuteInEditMode, DisallowMultipleComponent]
|
||||||
public class IsoObject : MonoBehaviour {
|
public class IsoObject : MonoBehaviour {
|
||||||
|
|
||||||
|
public bool Visited = false;
|
||||||
|
public HashSet<IsoObject> SelfDepends = new HashSet<IsoObject>();
|
||||||
|
public HashSet<IsoObject> TheirDepends = new HashSet<IsoObject>();
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// size
|
// size
|
||||||
@@ -166,38 +171,35 @@ namespace IsoTools {
|
|||||||
IsoWorld _isoWorld = null;
|
IsoWorld _isoWorld = null;
|
||||||
public IsoWorld isoWorld {
|
public IsoWorld isoWorld {
|
||||||
get {
|
get {
|
||||||
if ( (object)_isoWorld == null ) {
|
if ( !_isoWorld ) {
|
||||||
_isoWorld = GameObject.FindObjectOfType<IsoWorld>();
|
_isoWorld = GameObject.FindObjectOfType<IsoWorld>();
|
||||||
}
|
}
|
||||||
if ( (object)_isoWorld == null ) {
|
|
||||||
throw new UnityException("IsoObject. IsoWorld not found!");
|
|
||||||
}
|
|
||||||
return _isoWorld;
|
return _isoWorld;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResetIsoWorld() {
|
|
||||||
_isoWorld = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void FixTransform() {
|
public void FixTransform() {
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
if ( !Application.isPlaying && isAlignment ) {
|
if ( !Application.isPlaying && isAlignment ) {
|
||||||
_position = tilePosition;
|
_position = tilePosition;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
transform.position = IsoUtils.Vec3ChangeZ(
|
if ( isoWorld ) {
|
||||||
isoWorld.IsoToScreen(position),
|
transform.position = IsoUtils.Vec3ChangeZ(
|
||||||
transform.position.z);
|
isoWorld.IsoToScreen(position),
|
||||||
|
transform.position.z);
|
||||||
|
}
|
||||||
FixLastProperties();
|
FixLastProperties();
|
||||||
MartDirtyIsoWorld();
|
MartDirtyIsoWorld();
|
||||||
MarkEditorObjectDirty();
|
MarkEditorObjectDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void FixIsoPosition() {
|
public void FixIsoPosition() {
|
||||||
position = isoWorld.ScreenToIso(
|
if ( isoWorld ) {
|
||||||
transform.position,
|
position = isoWorld.ScreenToIso(
|
||||||
positionZ);
|
transform.position,
|
||||||
|
positionZ);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FixLastProperties() {
|
void FixLastProperties() {
|
||||||
@@ -209,7 +211,9 @@ namespace IsoTools {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MartDirtyIsoWorld() {
|
void MartDirtyIsoWorld() {
|
||||||
isoWorld.MarkDirty(this);
|
if ( isoWorld ) {
|
||||||
|
isoWorld.MarkDirty(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MarkEditorObjectDirty() {
|
void MarkEditorObjectDirty() {
|
||||||
@@ -230,9 +234,18 @@ namespace IsoTools {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void OnEnable() {
|
void OnEnable() {
|
||||||
|
if ( isoWorld ) {
|
||||||
|
isoWorld.AddIsoObject(this);
|
||||||
|
}
|
||||||
MartDirtyIsoWorld();
|
MartDirtyIsoWorld();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnDisable() {
|
||||||
|
if ( isoWorld ) {
|
||||||
|
isoWorld.RemoveIsoObject(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
void Reset() {
|
void Reset() {
|
||||||
size = Vector3.one;
|
size = Vector3.one;
|
||||||
@@ -245,7 +258,7 @@ namespace IsoTools {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void OnDrawGizmos() {
|
void OnDrawGizmos() {
|
||||||
if ( isShowBounds ) {
|
if ( isShowBounds && isoWorld ) {
|
||||||
IsoUtils.DrawCube(isoWorld, position + size * 0.5f, size, Color.red);
|
IsoUtils.DrawCube(isoWorld, position + size * 0.5f, size, Color.red);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,46 +6,13 @@ using UnityEditor;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace IsoTools {
|
namespace IsoTools {
|
||||||
|
|
||||||
[ExecuteInEditMode, DisallowMultipleComponent]
|
[ExecuteInEditMode, DisallowMultipleComponent]
|
||||||
public class IsoWorld : MonoBehaviour {
|
public class IsoWorld : MonoBehaviour {
|
||||||
|
|
||||||
class ObjectInfo {
|
bool _dirty = true;
|
||||||
public int index;
|
HashSet<IsoObject> _visibles = new HashSet<IsoObject>();
|
||||||
public IsoObject isoObject;
|
HashSet<IsoObject> _isoObjects = new HashSet<IsoObject>();
|
||||||
public Vector3 minSector;
|
|
||||||
public Vector3 maxSector;
|
|
||||||
|
|
||||||
public bool visited;
|
|
||||||
public int beginDepend;
|
|
||||||
public int endDepend;
|
|
||||||
|
|
||||||
public ObjectInfo(int index, IsoObject iso_object, Vector3 min_sector, Vector3 max_sector) {
|
|
||||||
this.index = index;
|
|
||||||
this.isoObject = iso_object;
|
|
||||||
this.minSector = min_sector;
|
|
||||||
this.maxSector = max_sector;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Init(int first_depend) {
|
|
||||||
this.visited = false;
|
|
||||||
this.beginDepend = first_depend;
|
|
||||||
this.endDepend = first_depend;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class SectorInfo {
|
|
||||||
public List<int> objects = new List<int>();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool _dirty = true;
|
|
||||||
List<SectorInfo> _sectors = new List<SectorInfo>();
|
|
||||||
List<ObjectInfo> _objects = new List<ObjectInfo>();
|
|
||||||
List<int> _depends = new List<int>();
|
|
||||||
HashSet<IsoObject> _visibles = new HashSet<IsoObject>();
|
|
||||||
float _objsSectorSize = 0.0f;
|
|
||||||
Vector3 _objsMinNumPos = Vector3.zero;
|
|
||||||
Vector3 _objsMaxNumPos = Vector3.zero;
|
|
||||||
Vector3 _objsNumPosCount = Vector3.zero;
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
@@ -89,8 +56,9 @@ namespace IsoTools {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void MarkDirty(IsoObject iso_object) {
|
public void MarkDirty(IsoObject iso_object) {
|
||||||
if ( !_dirty && iso_object && _visibles.Contains(iso_object) ) {
|
if ( iso_object && _visibles.Contains(iso_object) ) {
|
||||||
MarkDirty();
|
MarkDirty();
|
||||||
|
SetupIsoObjectDepends(iso_object);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,6 +81,15 @@ namespace IsoTools {
|
|||||||
iso_z);
|
iso_z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void AddIsoObject(IsoObject iso_object) {
|
||||||
|
_isoObjects.Add(iso_object);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveIsoObject(IsoObject iso_object) {
|
||||||
|
_isoObjects.Remove(iso_object);
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Private
|
// Private
|
||||||
@@ -144,19 +121,10 @@ namespace IsoTools {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplyToAllIsoObjects(System.Action<IsoObject> act) {
|
|
||||||
var iso_objects = GameObject.FindObjectsOfType<IsoObject>();
|
|
||||||
foreach ( var obj in iso_objects ) {
|
|
||||||
act(obj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void FixAllTransforms() {
|
void FixAllTransforms() {
|
||||||
ApplyToAllIsoObjects(obj => obj.FixTransform());
|
foreach ( var iso_object in _isoObjects ) {
|
||||||
}
|
iso_object.FixTransform();
|
||||||
|
}
|
||||||
void ResetAllIsoWorld() {
|
|
||||||
ApplyToAllIsoObjects(obj => obj.ResetIsoWorld());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChangeSortingProperty() {
|
void ChangeSortingProperty() {
|
||||||
@@ -164,59 +132,6 @@ namespace IsoTools {
|
|||||||
FixAllTransforms();
|
FixAllTransforms();
|
||||||
}
|
}
|
||||||
|
|
||||||
int SectorIndex(Vector3 num_pos) {
|
|
||||||
return Mathf.FloorToInt(
|
|
||||||
num_pos.x + _objsNumPosCount.x * (num_pos.y + num_pos.z * _objsNumPosCount.y));
|
|
||||||
}
|
|
||||||
|
|
||||||
Vector3 SectorNumPos(int index) {
|
|
||||||
var mz = _objsNumPosCount.x * _objsNumPosCount.y;
|
|
||||||
var my = _objsNumPosCount.x;
|
|
||||||
var vz = Mathf.FloorToInt(index / mz);
|
|
||||||
var vy = Mathf.FloorToInt((index - vz * mz) / my);
|
|
||||||
var vx = Mathf.FloorToInt(index - vz * mz - vy * my);
|
|
||||||
return new Vector3(vx, vy, vz);
|
|
||||||
}
|
|
||||||
|
|
||||||
SectorInfo FindSector(Vector3 num_pos) {
|
|
||||||
if ( num_pos.x < 0 || num_pos.y < 0 || num_pos.z < 0 ) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if ( num_pos.x >= _objsNumPosCount.x || num_pos.y >= _objsNumPosCount.y || num_pos.z >= _objsNumPosCount.z ) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return _sectors[SectorIndex(num_pos)];
|
|
||||||
}
|
|
||||||
|
|
||||||
void LookUpSectorDepends(Vector3 num_pos, System.Action<SectorInfo> act) {
|
|
||||||
var ms = FindSector(num_pos);
|
|
||||||
if ( ms != null ) {
|
|
||||||
act(ms);
|
|
||||||
var s1 = FindSector(num_pos + new Vector3(-1, 0, 0));
|
|
||||||
var s2 = FindSector(num_pos + new Vector3( 0, -1, 0));
|
|
||||||
var s3 = FindSector(num_pos + new Vector3(-1, -1, 0));
|
|
||||||
if ( s1 != null ) act(s1);
|
|
||||||
if ( s2 != null ) act(s2);
|
|
||||||
if ( s3 != null ) act(s3);
|
|
||||||
for ( var i = 0; i <= _objsNumPosCount.z; ++i ) {
|
|
||||||
var ss1 = FindSector(num_pos + new Vector3( 0 - i, 0 - i, i + 1));
|
|
||||||
var ss2 = FindSector(num_pos + new Vector3(-1 - i, 0 - i, i + 1));
|
|
||||||
var ss3 = FindSector(num_pos + new Vector3( 0 - i, -1 - i, i + 1));
|
|
||||||
var ss4 = FindSector(num_pos + new Vector3(-1 - i, -1 - i, i + 1));
|
|
||||||
var ss5 = FindSector(num_pos + new Vector3(-2 - i, -1 - i, i + 1));
|
|
||||||
var ss6 = FindSector(num_pos + new Vector3(-1 - i, -2 - i, i + 1));
|
|
||||||
var ss7 = FindSector(num_pos + new Vector3(-2 - i, -2 - i, i + 1));
|
|
||||||
if ( ss1 != null ) act(ss1);
|
|
||||||
if ( ss2 != null ) act(ss2);
|
|
||||||
if ( ss3 != null ) act(ss3);
|
|
||||||
if ( ss4 != null ) act(ss4);
|
|
||||||
if ( ss5 != null ) act(ss5);
|
|
||||||
if ( ss6 != null ) act(ss6);
|
|
||||||
if ( ss7 != null ) act(ss7);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IsDepends(Vector3 a_min, Vector3 a_size, Vector3 b_min, Vector3 b_size) {
|
bool IsDepends(Vector3 a_min, Vector3 a_size, Vector3 b_min, Vector3 b_size) {
|
||||||
var a_max = a_min + a_size;
|
var a_max = a_min + a_size;
|
||||||
var b_max = b_min + b_size;
|
var b_max = b_min + b_size;
|
||||||
@@ -237,123 +152,166 @@ namespace IsoTools {
|
|||||||
return a_yesno;
|
return a_yesno;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupVisibles(IsoObject[] iso_objects) {
|
bool IsDepends(IsoObject a, IsoObject b) {
|
||||||
|
return IsDepends(a.position, a.size, b.position, b.size);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
void CheckAlives() {
|
||||||
var new_visibles = new HashSet<IsoObject>();
|
var new_visibles = new HashSet<IsoObject>();
|
||||||
foreach ( var iso_object in iso_objects ) {
|
var new_objects = new List<IsoObject>();
|
||||||
|
foreach ( var iso_object in _isoObjects ) {
|
||||||
if ( IsIsoObjectVisible(iso_object) ) {
|
if ( IsIsoObjectVisible(iso_object) ) {
|
||||||
new_visibles.Add(iso_object);
|
new_visibles.Add(iso_object);
|
||||||
|
if ( !_visibles.Contains(iso_object) ) {
|
||||||
|
new_objects.Add(iso_object);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( !_visibles.IsSupersetOf(new_visibles) ) {
|
if ( !_visibles.IsSupersetOf(new_visibles) ) {
|
||||||
MarkDirty();
|
MarkDirty();
|
||||||
}
|
}
|
||||||
_visibles = new_visibles;
|
_visibles = new_visibles;
|
||||||
}
|
Debug.LogFormat("AllObjects: {0}, Visibles: {1}", _isoObjects.Count, _visibles.Count);
|
||||||
|
|
||||||
void SetupSectorSize() {
|
|
||||||
_objsSectorSize = 0.0f;
|
|
||||||
var objsSum = 0;
|
|
||||||
foreach ( var obj in _visibles ) {
|
|
||||||
++objsSum;
|
|
||||||
_objsSectorSize += IsoUtils.Vec3MaxF(obj.size);
|
|
||||||
}
|
|
||||||
_objsSectorSize = Mathf.Round(Mathf.Max(3.0f, _objsSectorSize / objsSum));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupObjects() {
|
void SetupObjects() {
|
||||||
_objects.Clear();
|
_objects.Clear();
|
||||||
_objsMinNumPos = Vector3.zero;
|
|
||||||
_objsMaxNumPos = Vector3.one;
|
|
||||||
foreach ( var obj in _visibles ) {
|
foreach ( var obj in _visibles ) {
|
||||||
var max_size = IsoUtils.Vec3Max(Vector3.one, obj.size);
|
_objects.Add(obj);
|
||||||
var min_npos = IsoUtils.Vec3DivFloor(obj.position, _objsSectorSize);
|
|
||||||
var max_npos = IsoUtils.Vec3DivCeil(obj.position + max_size, _objsSectorSize);
|
|
||||||
_objsMinNumPos = IsoUtils.Vec3Min(_objsMinNumPos, min_npos);
|
|
||||||
_objsMaxNumPos = IsoUtils.Vec3Max(_objsMaxNumPos, max_npos);
|
|
||||||
_objects.Add(new ObjectInfo(_objects.Count, obj, min_npos, max_npos));
|
|
||||||
}
|
}
|
||||||
_objsNumPosCount = _objsMaxNumPos - _objsMinNumPos;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupSectors() {
|
void SetupObjectDepends(IsoObject obj_ao) {
|
||||||
_sectors.Clear();
|
obj_ao.Visited = false;
|
||||||
_sectors.Capacity = Mathf.FloorToInt(_objsNumPosCount.x * _objsNumPosCount.y * _objsNumPosCount.z);
|
obj_ao.Depends.Clear();
|
||||||
while ( _sectors.Count < _sectors.Capacity ) {
|
for ( var obj_bi = 0; obj_bi < _objects.Count; ++obj_bi ) {
|
||||||
_sectors.Add(new SectorInfo());
|
var obj_bo = _objects[obj_bi];
|
||||||
|
if ( obj_ao != obj_bo && IsDepends(obj_ao.position, obj_ao.size, obj_bo.position, obj_bo.size) ) {
|
||||||
|
obj_ao.Depends.Add(obj_bi);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
foreach ( var obj in _objects ) {
|
}
|
||||||
obj.minSector -= _objsMinNumPos;
|
|
||||||
obj.maxSector -= _objsMinNumPos;
|
void SetupAllObjectDepends() {
|
||||||
IsoUtils.LookUpCube(obj.minSector, obj.maxSector, p => {
|
foreach ( var obj_ao in _objects ) {
|
||||||
var sector = FindSector(p);
|
obj_ao.Visited = false;
|
||||||
if ( sector != null ) {
|
obj_ao.Depends.Clear();
|
||||||
sector.objects.Add(obj.index);
|
for ( var obj_bi = 0; obj_bi < _objects.Count; ++obj_bi ) {
|
||||||
|
var obj_bo = _objects[obj_bi];
|
||||||
|
if ( obj_ao != obj_bo && IsDepends(obj_ao.position, obj_ao.size, obj_bo.position, obj_bo.size) ) {
|
||||||
|
obj_ao.Depends.Add(obj_bi);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
void SetupObjectDepends() {
|
float t_up = 0.0f;
|
||||||
_depends.Clear();
|
float t_pl = 0.0f;
|
||||||
foreach ( var obj_a in _objects ) {
|
|
||||||
obj_a.Init(_depends.Count);
|
|
||||||
var obj_ao = obj_a.isoObject;
|
|
||||||
IsoUtils.LookUpCube(obj_a.minSector, obj_a.maxSector, num_pos => {
|
|
||||||
LookUpSectorDepends(num_pos, sec => {
|
|
||||||
foreach ( var obj_bi in sec.objects ) {
|
|
||||||
var obj_bo = _objects[obj_bi].isoObject;
|
|
||||||
if ( obj_ao != obj_bo && IsDepends(obj_ao.position, obj_ao.size, obj_bo.position, obj_bo.size) ) {
|
|
||||||
_depends.Add(obj_bi);
|
|
||||||
++obj_a.endDepend;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void PlaceAllObjects() {
|
void OnGUI() {
|
||||||
var depth = minDepth;
|
GUILayout.Label("UpdateVisibles : " + (t_up * 1000).ToString());
|
||||||
foreach ( var info in _objects ) {
|
GUILayout.Label("PlaceAllVisibles: " + (t_pl * 1000).ToString());
|
||||||
depth = PlaceObject(info, depth);
|
|
||||||
}
|
|
||||||
_sectors.Clear();
|
|
||||||
_objects.Clear();
|
|
||||||
_depends.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
void PlaceObject(IsoObject obj, float depth) {
|
|
||||||
var trans = obj.transform;
|
|
||||||
trans.position = IsoUtils.Vec3ChangeZ(trans.position, depth);
|
|
||||||
}
|
|
||||||
|
|
||||||
float PlaceObject(ObjectInfo info, float depth) {
|
|
||||||
if ( info.visited ) {
|
|
||||||
return depth;
|
|
||||||
}
|
|
||||||
info.visited = true;
|
|
||||||
for ( var i = info.beginDepend; i < info.endDepend && i < _depends.Count; ++i ) {
|
|
||||||
var obj_index = _depends[i];
|
|
||||||
var obj = _objects[obj_index];
|
|
||||||
depth = PlaceObject(obj, depth);
|
|
||||||
}
|
|
||||||
PlaceObject(info.isoObject, depth);
|
|
||||||
return depth + (maxDepth - minDepth) / _objects.Count;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StepSort() {
|
void StepSort() {
|
||||||
var iso_objects = GameObject.FindObjectsOfType<IsoObject>();
|
var s_up = Time.realtimeSinceStartup;
|
||||||
SetupVisibles(iso_objects);
|
UpdateVisibles();
|
||||||
|
var e_up = Time.realtimeSinceStartup;
|
||||||
|
t_up = e_up - s_up;
|
||||||
if ( _dirty ) {
|
if ( _dirty ) {
|
||||||
SetupSectorSize();
|
var s_pl = Time.realtimeSinceStartup;
|
||||||
SetupObjects();
|
PlaceAllVisibles();
|
||||||
SetupSectors();
|
var e_pl = Time.realtimeSinceStartup;
|
||||||
SetupObjectDepends();
|
t_pl = e_pl - s_pl;
|
||||||
PlaceAllObjects();
|
|
||||||
_dirty = false;
|
_dirty = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UpdateVisibles() {
|
||||||
|
var old_all_visibles = _visibles;
|
||||||
|
var new_all_visibles = CalculateAllVisibles();
|
||||||
|
_visibles = new_all_visibles;
|
||||||
|
|
||||||
|
var new_visibles = new HashSet<IsoObject>(new_all_visibles);
|
||||||
|
new_visibles.ExceptWith(old_all_visibles);
|
||||||
|
if ( new_visibles.Count > 0 ) {
|
||||||
|
//Debug.LogFormat("New: {0}, Visibles: {1}, All: {2}", new_visibles.Count, _visibles.Count, _isoObjects.Count);
|
||||||
|
MarkDirty();
|
||||||
|
foreach ( var iso_object in new_visibles ) {
|
||||||
|
SetupIsoObjectDepends(iso_object);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HashSet<IsoObject> CalculateAllVisibles() {
|
||||||
|
var all_visibles = new HashSet<IsoObject>();
|
||||||
|
foreach ( var iso_object in _isoObjects ) {
|
||||||
|
if ( IsIsoObjectVisible(iso_object) ) {
|
||||||
|
iso_object.Visited = false;
|
||||||
|
all_visibles.Add(iso_object);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return all_visibles;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetupIsoObjectDepends(IsoObject iso_object) {
|
||||||
|
foreach ( var other_iso_object in iso_object.TheirDepends ) {
|
||||||
|
other_iso_object.SelfDepends.Remove(iso_object);
|
||||||
|
}
|
||||||
|
iso_object.SelfDepends.Clear();
|
||||||
|
iso_object.TheirDepends.Clear();
|
||||||
|
foreach ( var other_iso_object in _visibles ) {
|
||||||
|
if ( iso_object != other_iso_object ) {
|
||||||
|
if ( IsDepends(iso_object, other_iso_object) ) {
|
||||||
|
iso_object.SelfDepends.Add(other_iso_object);
|
||||||
|
other_iso_object.TheirDepends.Add(iso_object);
|
||||||
|
}
|
||||||
|
if ( IsDepends(other_iso_object, iso_object) ) {
|
||||||
|
other_iso_object.SelfDepends.Add(iso_object);
|
||||||
|
iso_object.TheirDepends.Add(other_iso_object);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
if ( IsDepends(other_iso_object, iso_object) ) {
|
||||||
|
other_iso_object.Depends.Add(iso_object);
|
||||||
|
} else {
|
||||||
|
other_iso_object.Depends.Remove(iso_object);
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int place_num = 0;
|
||||||
|
|
||||||
|
void PlaceAllVisibles() {
|
||||||
|
place_num = 0;
|
||||||
|
var depth = minDepth;
|
||||||
|
foreach ( var iso_object in _visibles ) {
|
||||||
|
depth = RecursivePlaceIsoObject(iso_object, depth);
|
||||||
|
}
|
||||||
|
//Debug.LogFormat("Place: {0}, All: {1}", _visibles.Count, _isoObjects.Count);
|
||||||
|
//Debug.LogFormat("PlaceNum: {0}", place_num);
|
||||||
|
}
|
||||||
|
|
||||||
|
float RecursivePlaceIsoObject(IsoObject iso_object, float depth) {
|
||||||
|
++place_num;
|
||||||
|
if ( iso_object.Visited ) {
|
||||||
|
return depth;
|
||||||
|
}
|
||||||
|
iso_object.Visited = true;
|
||||||
|
foreach ( var depend in iso_object.SelfDepends ) {
|
||||||
|
depth = RecursivePlaceIsoObject(depend, depth);
|
||||||
|
}
|
||||||
|
PlaceIsoObject(iso_object, depth);
|
||||||
|
return depth + (maxDepth - minDepth) / _visibles.Count;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlaceIsoObject(IsoObject iso_object, float depth) {
|
||||||
|
var trans = iso_object.transform;
|
||||||
|
trans.position = IsoUtils.Vec3ChangeZ(trans.position, depth);
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Messages
|
// Messages
|
||||||
@@ -370,11 +328,14 @@ namespace IsoTools {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void OnEnable() {
|
void OnEnable() {
|
||||||
|
_visibles.Clear();
|
||||||
|
_isoObjects = new HashSet<IsoObject>(FindObjectsOfType<IsoObject>());
|
||||||
MarkDirty();
|
MarkDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnDisable() {
|
void OnDisable() {
|
||||||
ResetAllIsoWorld();
|
_visibles.Clear();
|
||||||
|
_isoObjects.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ Global
|
|||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(MonoDevelopProperties) = preSolution
|
GlobalSection(MonoDevelopProperties) = preSolution
|
||||||
StartupItem = Assembly-CSharp.csproj
|
StartupItem = Assembly-CSharp.csproj
|
||||||
Policies = $0
|
Policies = $0
|
||||||
$0.TextStylePolicy = $1
|
$0.TextStylePolicy = $1
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ Global
|
|||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(MonoDevelopProperties) = preSolution
|
GlobalSection(MonoDevelopProperties) = preSolution
|
||||||
StartupItem = Assembly-CSharp.csproj
|
StartupItem = Assembly-CSharp.csproj
|
||||||
Policies = $0
|
Policies = $0
|
||||||
$0.TextStylePolicy = $1
|
$0.TextStylePolicy = $1
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
<Properties>
|
<Properties>
|
||||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
|
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" PreferredExecutionTarget="MonoDevelop.Default" />
|
||||||
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/IsoTools/Scripts/IsoObject.cs">
|
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/IsoTools/Scripts/IsoWorld.cs">
|
||||||
<Files>
|
<Files>
|
||||||
<File FileName="Assets/IsoTools/Scripts/IsoBoxCollider.cs" Line="1" Column="1" />
|
<File FileName="Assets/IsoTools/Scripts/IsoWorld.cs" Line="254" Column="51" />
|
||||||
<File FileName="Assets/IsoTools/Scripts/IsoObject.cs" Line="168" Column="9" />
|
<File FileName="Assets/IsoTools/Scripts/IsoObject.cs" Line="13" Column="54" />
|
||||||
<File FileName="Assets/IsoTools/Scripts/IsoWorld.cs" Line="1" Column="1" />
|
|
||||||
<File FileName="Assets/IsoTools/Editor/IsoObjectEditor.cs" Line="1" Column="1" />
|
|
||||||
</Files>
|
</Files>
|
||||||
</MonoDevelop.Ide.Workbench>
|
</MonoDevelop.Ide.Workbench>
|
||||||
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||||
|
|||||||
Reference in New Issue
Block a user