void OnDestroy() { if (!isQuitting) { HandleGameEvent(EmitterGameEvent.ObjectDestroy); if (instance != null && instance.isValid()) { RuntimeManager.DetachInstanceFromGameObject(instance); } if (Preload) { eventDescription.unloadSampleData(); } } }
void OnDestroy() { if (!isQuitting) { HandleGameEvent(EmitterGameEvent.ObjectDestroy); if (instance.isValid()) { RuntimeManager.DetachInstanceFromGameObject(instance); if (eventDescription.isValid() && isOneshot) { instance.release(); instance.clearHandle(); } } if (Preload) { eventDescription.unloadSampleData(); } } }
/// <summary> /// Unloads all non-streaming sounds for the event. /// </summary> public void UnloadSampleData() => Native.unloadSampleData();