Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: winresh24 on October 01, 2012, 08:50:13 AM

Title: DestroyImmediate NGUITOOLS
Post by: winresh24 on October 01, 2012, 08:50:13 AM
I dont know what is wrong here plss help me..Its first error is There something wrong with Destroyimmediate but when i change it to destroy its working fine but there still an error and the erro is this::

error!!!!

Destroy may not be called from edit mode! Use DestroyImmediate instead.
Also think twice if you really want to destroy something in edit mode. Since this will destroy objects permanently.
UnityEngine.Object:Destroy(Object)
NGUITools:DestroyImmediate(Object) (at Assets/Plugins/Internal/NGUITools.cs:459)
UIPanel:OnDisable() (at Assets/Plugins/UI/UIPanel.cs:524)


Here is the code of the editor Nguitools

static public void DestroyImmediate (UnityEngine.Object obj)
   {
      if (obj != null)
      {
         if (Application.isEditor) UnityEngine.Object.Destroy(obj);
         else UnityEngine.Object.Destroy(obj);
      }
   }
Title: Re: DestroyImmediate NGUITOOLS
Post by: ArenMook on October 01, 2012, 04:49:25 PM
There is no point in making duplicate posts: http://www.tasharen.com/forum/index.php?topic=1417.0