The underlying native asset of this asset if one is available.This property can be used to access additional details or functionality releated to the asset.This property will be initialized by the loader if _native is available.
cc.log(node.isValid);//true, still valid inthis frame
// after a frame...
cc.log(node.isValid);//false, destroyed in the end of last frame
方法
compileCreateFunction
Dynamically translation prefab data into minimized code.This method will be called automatically before the first time the prefab being instantiated,but you can re-call to refresh the create function once you modified the original prefab data in script.
meta
description
定义于
cocos2d/core/assets/CCPrefab.js:145
toString
Returns the asset's url.
The Asset object overrides the toString() method of the Object object.For Asset objects, the toString() method returns a string representation of the object.JavaScript calls the toString() method automatically when an asset is to be represented as a text value or when a texture is referred to in a string concatenation.
NOTE: this method will not clear the getter or setter functions which defined in the instance of CCObject. You can override the _destruct method if you need, for example: _destruct: function () { for (var key in this) { if (this.hasOwnProperty(key)) { switch (typeof this[key]) { case 'string': this[key] = ''; break; case 'object': case 'function': this[key] = null; break; } } }
meta
description
定义于
cocos2d/core/platform/CCObject.js:430
_onPreDestroy
Called before the object being destroyed.
meta
description
定义于
cocos2d/core/platform/CCObject.js:463
_serialize
The customized serialization for this object. (Editor Only)