Author Topic: DestroyImmediate NGUITOOLS  (Read 2320 times)

winresh24

  • Guest
DestroyImmediate NGUITOOLS
« 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);
      }
   }

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: DestroyImmediate NGUITOOLS
« Reply #1 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