Commit 3b54011a authored by Pingu's avatar Pingu
Browse files
parents c3604dcf d9880c04
......@@ -260,7 +260,7 @@ MonoBehaviour:
prefabindex: 0
roomIndex: 0
ownIndexAtOtherRoom: 0
roomstoKeep: 0500000006000000
roomstoKeep: 05000000
--- !u!1 &108791592
GameObject:
m_ObjectHideFlags: 0
......@@ -405,7 +405,7 @@ MonoBehaviour:
prefabindex: 0
roomIndex: 0
ownIndexAtOtherRoom: 0
roomstoKeep: 0500000006000000
roomstoKeep: 05000000
--- !u!1 &341899303
GameObject:
m_ObjectHideFlags: 0
......@@ -520,7 +520,7 @@ MonoBehaviour:
prefabindex: 0
roomIndex: 0
ownIndexAtOtherRoom: 0
roomstoKeep: 0500000006000000
roomstoKeep: 05000000
--- !u!1 &681513306
GameObject:
m_ObjectHideFlags: 0
......@@ -937,7 +937,7 @@ MonoBehaviour:
prefabindex: 0
roomIndex: 0
ownIndexAtOtherRoom: 0
roomstoKeep: 0500000006000000
roomstoKeep: 05000000
--- !u!1 &864292782
GameObject:
m_ObjectHideFlags: 0
......@@ -1632,7 +1632,7 @@ MonoBehaviour:
prefabindex: 0
roomIndex: 0
ownIndexAtOtherRoom: 0
roomstoKeep: 0500000006000000
roomstoKeep: 05000000
--- !u!1 &1184949596
GameObject:
m_ObjectHideFlags: 0
......@@ -2538,7 +2538,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &1514270265
Transform:
m_ObjectHideFlags: 0
......@@ -2949,7 +2949,7 @@ MonoBehaviour:
prefabindex: 0
roomIndex: 0
ownIndexAtOtherRoom: 0
roomstoKeep: 0500000006000000
roomstoKeep: 05000000
--- !u!1 &2071923429
GameObject:
m_ObjectHideFlags: 0
......@@ -6396,6 +6396,9 @@ MonoBehaviour:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
released: 1
markedForDespawn: 0
roomsToKeepNext:
--- !u!64 &1969524764
MeshCollider:
m_ObjectHideFlags: 0
......@@ -14259,7 +14262,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: -8167803586671635322, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_RootOrder
value: 31
value: 32
objectReference: {fileID: 0}
- target: {fileID: -8161961977166255781, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_Materials.Array.data[0]
......@@ -14291,7 +14294,7 @@ PrefabInstance:
objectReference: {fileID: 2100000, guid: 1ed9e4d05f592a14484dccb05d197627, type: 2}
- target: {fileID: -7384859867155080166, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_RootOrder
value: 34
value: 35
objectReference: {fileID: 0}
- target: {fileID: -7300149022842383511, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_Materials.Array.data[0]
......@@ -14307,7 +14310,7 @@ PrefabInstance:
objectReference: {fileID: 2100000, guid: d46feff2e0ebf1646a4d9cd1f164abdb, type: 2}
- target: {fileID: -6711177425811463290, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_RootOrder
value: 26
value: 27
objectReference: {fileID: 0}
- target: {fileID: -5625554210944756139, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_Materials.Array.data[0]
......@@ -14395,7 +14398,7 @@ PrefabInstance:
objectReference: {fileID: 2100000, guid: 1bb783a800c6e2340881bb912b92c7fa, type: 2}
- target: {fileID: -3710570476263892384, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_RootOrder
value: 25
value: 26
objectReference: {fileID: 0}
- target: {fileID: -3689128815529482529, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_Materials.Array.data[0]
......@@ -14427,7 +14430,7 @@ PrefabInstance:
objectReference: {fileID: 2100000, guid: 6eebf47168f5831468a1e48c044b0d1e, type: 2}
- target: {fileID: -2488099719101185781, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_RootOrder
value: 27
value: 25
objectReference: {fileID: 0}
- target: {fileID: -2172214697703963796, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_RootOrder
......@@ -14435,7 +14438,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: -1848562485195081181, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_RootOrder
value: 38
value: 37
objectReference: {fileID: 0}
- target: {fileID: -1726652662448800911, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_RootOrder
......@@ -14519,7 +14522,7 @@ PrefabInstance:
objectReference: {fileID: 2100000, guid: 4b9020c67e3c38f478ef8151bcae0574, type: 2}
- target: {fileID: -535096135545600878, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_RootOrder
value: 29
value: 30
objectReference: {fileID: 0}
- target: {fileID: -301955968732919267, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_Materials.Array.data[0]
......@@ -14567,7 +14570,7 @@ PrefabInstance:
objectReference: {fileID: 2100000, guid: 1bb783a800c6e2340881bb912b92c7fa, type: 2}
- target: {fileID: 468280374974786894, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_RootOrder
value: 37
value: 38
objectReference: {fileID: 0}
- target: {fileID: 546519281650867030, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_Materials.Array.data[0]
......@@ -14599,7 +14602,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 1130862567565287352, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_RootOrder
value: 28
value: 29
objectReference: {fileID: 0}
- target: {fileID: 1590145021408479703, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_RootOrder
......@@ -14643,7 +14646,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 2566551046182968474, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_RootOrder
value: 35
value: 34
objectReference: {fileID: 0}
- target: {fileID: 2605314364698861380, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_Materials.Array.data[0]
......@@ -14759,7 +14762,7 @@ PrefabInstance:
objectReference: {fileID: 2100000, guid: 1ed9e4d05f592a14484dccb05d197627, type: 2}
- target: {fileID: 5835674365303095518, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_RootOrder
value: 32
value: 31
objectReference: {fileID: 0}
- target: {fileID: 5916506483399481368, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_Materials.Array.data[0]
......@@ -14775,7 +14778,7 @@ PrefabInstance:
objectReference: {fileID: 2100000, guid: 1bb783a800c6e2340881bb912b92c7fa, type: 2}
- target: {fileID: 6285465371517215962, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_RootOrder
value: 30
value: 28
objectReference: {fileID: 0}
- target: {fileID: 7012645957558218805, guid: 3fac09cced12b7142bdfb180c7c9a814, type: 3}
propertyPath: m_Materials.Array.data[0]
......
......@@ -8,9 +8,9 @@ public class Room : MonoBehaviour
public Room[] roomPrefabs;
public Transform[] roomAnchors;
public Room[] Neighbours;
bool released = true;
bool markedForDespawn = false;
List<int> roomsToKeepNext;
public bool released = true;
public bool markedForDespawn = false;
public List<int> roomsToKeepNext;
private void Update() {
if (markedForDespawn && released) {
......
......@@ -19,15 +19,21 @@ public class RoomTrigger : MonoBehaviour
private void OnTriggerEnter(Collider other)
{
if (spawn) room.SpawnNeighbour(prefabindex, roomIndex, ownIndexAtOtherRoom);
if (spawn) {
Debug.Log("unreleased by: " + gameObject.name);
room.SpawnNeighbour(prefabindex, roomIndex, ownIndexAtOtherRoom);
}
if (deSpawn)
{
room.DeSpawnNeighbour((roomstoKeep != null) ? roomstoKeep : new List<int>());
Debug.Log("Despawning by: " + gameObject.name);
room.DeSpawnNeighbour((roomstoKeep != null) ? roomstoKeep : new List<int>());
}
}
private void OnTriggerExit(Collider other) {
if (spawn) room.ReleaseNeighbours();
if (spawn||true) {
Debug.Log("released by: " + gameObject.name);
room.ReleaseNeighbours();
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment