void OnDestroy() { if (!isQuitting) { HandleGameEvent(EmitterGameEvent.LevelEnd); if (instance != null && instance.isValid()) { RuntimeManager.DetachInstanceFromGameObject(instance); } } }
private void OnDestroy() { if (!isQuitting) { HandleGameEvent(EmitterGameEvent.ObjectDestroy); if (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(); } } }