fix FirstPersonOcclusion invalid event handle error

This commit is contained in:
2026-01-29 19:26:16 +02:00
parent 4c6fbb30bc
commit a0d1ee35cd
9 changed files with 18 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
### TODO
* user flow: grab item? mida krabada
* võtta spawnitud mudeli mõõtmed: meshcollideri max x, max y, etc? bounding box?
* võtta spawnitud mudeli mõõtmed: meshcollideri max x, max y, etc? bounding box? ja kontrollida spawnimisel scale'i
* shape scanner:
* peenikesemad kiired
* mitte lihtsalt ontriggerenter ja -exit, sest kui mitu objekti lähevad samal ajal sisse

View File

@@ -430,11 +430,12 @@ public class AudioManager : MonoBehaviour
{
foreach (EventInstance eventInstance in eventInstances)
{
eventInstance.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);
eventInstance.release();
if (eventInstance.isValid()) {
eventInstance.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);
eventInstance.release();
}
}
}
}
private void OnDestroy()
{

View File

@@ -75,7 +75,7 @@ public class FirstPersonOcclusion : MonoBehaviour
AudioOccluded.start();
// 4. Releasing Instance (This allows the event to self-manage its lifetime, which is fine)
AudioOccluded.release();
//AudioOccluded.release();
managedInstances.Add(AudioOccluded); // ADDED