Ruined Town Sectors fix, Dark Wood - Sectors

This commit is contained in:
szczuras4
2025-12-05 06:16:25 +01:00
parent 06ae2e180e
commit 53fa05e246
4 changed files with 1005 additions and 1102 deletions

View File

@@ -15,7 +15,7 @@ MonoBehaviour:
m_DefaultGroup: bc074d00982114f0388e9c98de91d44f
m_currentHash:
serializedVersion: 2
Hash: ef672e941747c2eb6b19db828d740a6a
Hash: 00000000000000000000000000000000
m_OptimizeCatalogSize: 0
m_BuildRemoteCatalog: 0
m_CatalogRequestsTimeout: 0

File diff suppressed because it is too large Load Diff

View File

@@ -226392,15 +226392,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 454388, guid: 9eafe0fd75c2e264e9df989997667656, type: 3}
propertyPath: m_LocalPosition.x
value: -109.738
value: -109.739
objectReference: {fileID: 0}
- target: {fileID: 454388, guid: 9eafe0fd75c2e264e9df989997667656, type: 3}
propertyPath: m_LocalPosition.y
value: 18.072
value: 18.103
objectReference: {fileID: 0}
- target: {fileID: 454388, guid: 9eafe0fd75c2e264e9df989997667656, type: 3}
propertyPath: m_LocalPosition.z
value: 65.225
value: 65.224
objectReference: {fileID: 0}
- target: {fileID: 454388, guid: 9eafe0fd75c2e264e9df989997667656, type: 3}
propertyPath: m_LocalRotation.w

View File

@@ -7,6 +7,9 @@ namespace Beyond
[RequireComponent(typeof(BoxCollider))]
public class BoxVolume : StreamingAsset
{
// DODANE: Licznik koliderów wewn¹trz woluminu
private int enteredCollidersCount = 0;
protected override void Draw()
{
if (collider == null)
@@ -49,9 +52,13 @@ namespace Beyond
protected override void OnTriggerEnter(Collider other)
{
if (collisionLayer == 1 << other.gameObject.layer)
// Sprawdzenie warunków kolizji
if (collisionLayer == 1 << other.gameObject.layer && tagMask.IsInTagMask(other.tag))
{
if (tagMask.IsInTagMask(other.tag))
enteredCollidersCount++;
// Aktywacja nastêpuje tylko przy pierwszym wejœciu (licznik = 1)
if (enteredCollidersCount == 1)
{
CancelDeactivationCoroutine();
SetActive(true);
@@ -61,13 +68,20 @@ namespace Beyond
protected override void OnTriggerExit(Collider other)
{
if (collisionLayer == 1 << other.gameObject.layer)
// Sprawdzenie warunków kolizji
if (collisionLayer == 1 << other.gameObject.layer && tagMask.IsInTagMask(other.tag))
{
if (tagMask.IsInTagMask(other.tag))
enteredCollidersCount--;
// Zabezpieczenie na wypadek b³êdu fizyki
if (enteredCollidersCount < 0) enteredCollidersCount = 0;
// Dezaktywacja nastêpuje tylko, gdy ostatni obiekt opuœci wolumin (licznik = 0)
if (enteredCollidersCount == 0)
{
SetActive(false);
}
}
}
}
}
}