Method LoadFromStreamingAssets
LoadFromStreamingAssets(string, bool, uint, uint, uint, bool)
Loads a KTX or Basis Universal texture from the StreamingAssets folder see https://docs.unity3d.com/Manual/StreamingAssets.html
Declaration
public Task<TextureResult> LoadFromStreamingAssets(string filePath, bool linear = false, uint layer = 0, uint faceSlice = 0, uint mipLevel = 0, bool mipChain = true)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filePath | Path to the file, relative to StreamingAssets |
| bool | linear | Depicts if texture is sampled in linear or sRGB gamma color space. |
| uint | layer | Texture array layer to import |
| uint | faceSlice | Cubemap face or 3D/volume texture slice to import. |
| uint | mipLevel | Lowest mipmap level to import (where 0 is the highest resolution). Lower mipmap levels (of higher resolution) are being discarded. Useful to limit texture resolution. |
| bool | mipChain | If true, a mipmap chain (if present) is imported. |
Returns
| Type | Description |
|---|---|
| Task<TextureResult> | A TextureResult that contains an ErrorCode, the resulting texture and its orientation. |
LoadFromStreamingAssets(string, GraphicsFormat, uint, uint, uint, bool)
Loads a KTX or Basis Universal texture from the StreamingAssets folder see https://docs.unity3d.com/Manual/StreamingAssets.html
Declaration
public Task<TextureResult> LoadFromStreamingAssets(string filePath, GraphicsFormat targetFormat, uint layer = 0, uint faceSlice = 0, uint mipLevel = 0, bool mipChain = true)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filePath | Path to the file, relative to StreamingAssets |
| GraphicsFormat | targetFormat | Desired texture format |
| uint | layer | Texture array layer to import |
| uint | faceSlice | Cubemap face or 3D/volume texture slice to import. |
| uint | mipLevel | Lowest mipmap level to import (where 0 is the highest resolution). Lower mipmap levels (of higher resolution) are being discarded. Useful to limit texture resolution. |
| bool | mipChain | If true, a mipmap chain (if present) is imported. |
Returns
| Type | Description |
|---|---|
| Task<TextureResult> | A TextureResult that contains an ErrorCode, the resulting texture and its orientation. |