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 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.
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.
The current EffectAsset.
Name of the current EffectAsset.
The hash value of this material.
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 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 passes defined in this material.
The current technique index.
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.
Copy the target material.
The material to be copied.
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.
Trigger an event directly with the event name and necessary arguments.
event type
Get the specified uniform value for this material.
Note that only uniforms set through Material.setProperty can be acquired here.
For the complete rendering data, use Pass.getUniform instead.
The property or uniform name.
The target pass index. If not specified, return the first found value in all passes.
Checks whether there is correspond event listener registered on the given event.
Event type.
Callback function when event triggered.
Callback callee.
Initialize this material with the given information.
Material description info.
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
Callback function after material is loaded in Loader. Initialize the resources automatically.
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).
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 all the uniforms to the default value specified in EffectAsset.
Will the rendering data be cleared too?
应 AssetDB 要求提供这个方法。 返回一个序列化后的对象
Convenient property setter provided for quick material setup.
Pass.setUniform should be used instead if you need to do per-frame uniform update.
The target uniform name.
The target value.
The pass to apply to. Will apply to all passes if not specified.
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.
应 AssetDB 要求提供这个方法。
Get hash for a material
内部使用。
Generated using TypeDoc
材质实例,当有材质修改需求时,根据材质资源创建的,可任意定制的实例。