Serializable url for native asset. For internal usage.
Whether the asset is loaded or not
The texture filter mode enum
The pixel format enum.
The wrap mode enum.
Indicates whether its dependent native 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.
Pixel height of the texture
Level 0 mipmap image.
Be noted, this.image = img
equals this.mipmaps = [img]
,
sets image will clear all previous mipmaps.
Level 0 mipmap image.
Be noted, this.image = img
equals this.mipmaps = [img]
,
sets image will clear all previous mipmaps.
Whether the pixel data is compressed.
The mipmap level of the texture
All levels of mipmap images, be noted, automatically generated mipmaps are not included. When setup mipmap, the size of the texture and pixel format could be modified.
All levels of mipmap images, be noted, automatically generated mipmaps are not included. When setup mipmap, the size of the texture and pixel format could be modified.
Returns the url of this asset's native object, if none it will returns an empty string.
The number of reference
Pixel width of the texture
Set mipmap level of this texture.
The value is passes as presumed info to this._getGfxTextureCreateInfo()
.
The mipmap level.
Set native file name for this asset.
Add references of asset
itself
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.
Reduce references of asset and it will be auto released when refCount equals 0.
itself
销毁此贴图,清空所有 Mipmap 并释放占用的 GPU 资源。
Gets the anisotropy
The anisotropy
Gets the sampler resource for the texture
The GFX Texture resource
Gets the texture hash.
Gets the id of the texture
The id
Gets the pixel format
The pixel format
Gets the internal GFX sampler hash.
Release used GPU resources.
Reset the current texture with given size, pixel format and mipmap images. After reset, the gfx resource will become invalid, you must use uploadData explicitly to upload the new mipmaps to GPU resources.
The create information
应 AssetDB 要求提供这个方法。 返回一个序列化后的对象
Sets the texture's anisotropy
Sets the texture's mip filter
Filter mode for scale down
Sets the wrap mode of the texture. Be noted, if the size of the texture is not power of two, only WrapMode.CLAMP_TO_EDGE is allowed.
S(U) coordinate wrap mode
T(V) coordinate wrap mode
R(W) coordinate wrap mode
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.
Update the level 0 mipmap image.
Upload data to the given mipmap level. The size of the image will affect how the mipmap is updated.
The source image or image data
Mipmap level to upload the image to
The array index
应 AssetDB 要求提供这个方法。
Create a texture cube with an array of Texture2D which represents 6 faces of the texture cube.
Texture array, the texture count must be multiple of 6. Every 6 textures are 6 faces of a mipmap level. The order should obey FaceIndex order.
Output texture cube, if not given, will create a new texture cube.
The created texture cube.
Generated using TypeDoc
The texture cube asset. Each mipmap level of a texture cube have 6 ImageAsset, represents 6 faces of the cube.