Base class for all resource providers. Providers are the implementation for Asset.
For example: VideoTextureProvider is the implementation for a Texture backed by a video file.
In most cases, providers can be accessed via the control property of an asset.
control
For example, we can jump to the last frame of an animated texture:
// @input Asset.Texture myAnimatedTextureconst myAnimatedTextureProvider = script.myAnimatedTexture.control;const frameCountOfTexture = myAnimatedTextureProvider.getFramesCount();myAnimatedTextureProvider.pauseAtFrame(frameCountOfTexture - 1); Copy
// @input Asset.Texture myAnimatedTextureconst myAnimatedTextureProvider = script.myAnimatedTexture.control;const frameCountOfTexture = myAnimatedTextureProvider.getFramesCount();myAnimatedTextureProvider.pauseAtFrame(frameCountOfTexture - 1);
Or do it in TypeScript:
@componentexport class ProviderExample extends BaseScriptComponent { @input() myAnimatedTexture: Texture; onAwake() { const myAnimatedTextureProvider = this.myAnimatedTexture.control as AnimatedTextureFileProvider; const frameCountOfTexture = myAnimatedTextureProvider.getFramesCount(); myAnimatedTextureProvider.pauseAtFrame(frameCountOfTexture - 1); }} Copy
@componentexport class ProviderExample extends BaseScriptComponent { @input() myAnimatedTexture: Texture; onAwake() { const myAnimatedTextureProvider = this.myAnimatedTexture.control as AnimatedTextureFileProvider; const frameCountOfTexture = myAnimatedTextureProvider.getFramesCount(); myAnimatedTextureProvider.pauseAtFrame(frameCountOfTexture - 1); }}
Protected
Returns the name of this object's type.
Returns true if the object matches or derives from the passed in type.
Returns true if this object is the same as other. Useful for checking if two references point to the same thing.
other
Base class for all resource providers. Providers are the implementation for Asset.
Remarks
For example: VideoTextureProvider is the implementation for a Texture backed by a video file.
Example
In most cases, providers can be accessed via the
control
property of an asset.For example, we can jump to the last frame of an animated texture:
Or do it in TypeScript: