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