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);
}
}