Serializable url for native asset. For internal usage.
内部使用。
Whether the asset is loaded or not
Indicates whether its dependent raw assets can support deferred load if the owner scene (or prefab) is marked as asyncLoadAssets
.
Indicates whether its native object should be preloaded from native url.
The actual data of the mesh
The hash of the mesh
Indicates whether the object is not yet destroyed. (It will not be available after being destroyed)
When an object's destroy
is called, it is actually destroyed after the end of this frame.
So isValid
will return false from the next frame, while isValid
in the current frame will still be true.
If you want to determine whether the current frame has called destroy
, use isValid(obj, true)
,
but this is often caused by a particular logical requirements, which is not normally required.
The index of the joint buffer of all sub meshes in the joint map buffers
The maximum position of all vertices in the mesh
The minimum position of all vertices in the mesh
The name of the object.
The name of the object.
Returns the url of this asset's native object, if none it will returns an empty string.
The sub meshes for rendering. Mesh could be split into different sub meshes for rendering.
The struct of the mesh
The sub meshes count of the mesh.
Clear all references in the instance.
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; } } }
Set native file name for this asset.
Reset the struct and data of the mesh
The new struct
The new data
Read the requested attribute of the given sub mesh and fill into the given buffer.
Sub mesh index
Attribute name
The target array buffer
Byte distance between two attributes in the target buffer
The offset of the first attribute in the target buffer
Return false if failed to access attribute, return true otherwise.
Read the indices data of the given sub mesh and fill into the given array
Sub mesh index
The target output array
Return false if failed to access the indices data, return true otherwise.
Create a new node using this asset in the scene.
If this type of asset dont have its corresponding node type, this method should be null.
Destroy the mesh and release all related GPU resources
Release all related GPU resources
Trigger an event directly with the event name and necessary arguments.
event type
Checks whether there is correspond event listener registered on the given event.
Event type.
Callback function when event triggered.
Callback callee.
Removes the listeners previously registered with the same type, callback, target and or useCapture, if only type is passed as parameter, all listeners registered with that type will be removed.
A string representing the event type being removed.
The callback to remove.
Register an callback of a specific event type on the EventTarget.
This type of event should be triggered via emit
.
A string representing the event type to listen for.
The callback that will be invoked when the event is dispatched. The callback is ignored if it is a duplicate (the callbacks are unique).
The target (this object) to invoke the callback, can be null
Register an callback of a specific event type on the EventTarget, the callback will remove itself after the first time it is triggered.
A string representing the event type to listen for.
The callback that will be invoked when the event is dispatched. The callback is ignored if it is a duplicate (the callbacks are unique).
Read the requested attribute of the given sub mesh
Sub mesh index
Attribute name
Return null if not found or can't read, otherwise, will create a large enough typed array to contain all data of the attribute, the array type will match the data type of the attribute.
Read the indices data of the given sub mesh
Sub mesh index
Return null if not found or can't read, otherwise, will create a large enough typed array to contain all indices data, the array type will use the corresponding stride size.
Removes all callbacks registered in a certain event type or all callbacks registered with a certain target
The event type or target with which the listeners will be removed
Reset the mesh with mesh creation information
Mesh creation information including struct and data
应 AssetDB 要求提供这个方法。 返回一个序列化后的对象
Removes all callbacks previously registered with the same target (passed as parameter). This is not for removing all listeners in the current event target, and this is not for removing all listeners the target parameter have registered. It's only for removing all listeners (callback and target couple) registered on the current event target by the target parameter.
The target to be searched for all related listeners
Returns the string representation of the object.
The Asset
object overrides the toString()
method of the Object
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.
For assets of the native type, it will return this.nativeUrl
.
Otherwise, an empty string is returned.
This method may be overwritten by subclasses.
Validation for whether the given mesh can be merged into the current mesh. To pass the validation, it must satisfy either of these two requirements:
Same mesh layout means:
The other mesh to be validated
应 AssetDB 要求提供这个方法。
内部使用。
Generated using TypeDoc
Mesh asset