Object.DestroyImmediate 立即销毁

static function DestroyImmediate (obj : Object, allowDestroyingAssets : bool = false) : void
static void DestroyImmediate(Object obj, bool allowDestroyingAssets = false);


Destroys the object obj immediately. It is strongly recommended to use Destroy instead.


This function should only be used when writing editor code since the delayed destruction will never be invoked in edit mode. In game code it is recommended to use Object.Destroy instead. Destroy is always delayed (but executed within the same frame) Use this function with care since it can destroy assets permanently!


Page last updated: 2014-1-3