Object.DestroyImmediate 立即销毁

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

Description描述

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

立即销毁物体obj,强烈建议使用Destroy代替。

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!

该函数只在写编辑器代码时使用,因为延时的销毁永远不会在编辑模式下调用。在游戏代码推荐使用Object.Destroy代替。销毁总是延迟的(但在同一帧内执行),小心使用该函数,因为它能永久销毁资源。

Page last updated: 2014-1-3