FAST SDK Coding Reference 1.0.3
Loading...
Searching...
No Matches
ImagePlayerFromFile Class Reference

A class to help use an image sequence asset loaded from the file system as FAST.ImagePlayer.sprites for the current skin in multiple languages. More...

Inheritance diagram for ImagePlayerFromFile:
AssetFromFile

Public Member Functions

override void Load (string language)
 
IEnumerator LoadCoroutine (string language)
 Loads the asset from FAST.Application.assets dictionary using language and FAST.AssetFromFile.fileName.
 
- Public Member Functions inherited from AssetFromFile
void Load (string language)
 Loads the asset from FAST.Application.assets dictionary using language and FAST.AssetFromFile.fileName.
 

Protected Member Functions

override void Awake ()
 
override void SetNameWithFileExtension ()
 When you right-click on FAST.AssetFromFile.baseFileName in the Inspector, this function will run in the Editor to get the filename of the Image.sprite assigned to the FAST.ImagePlayer.uiImage of FAST.ImagePlayerFromFile.imagePlayer.
 
- Protected Member Functions inherited from AssetFromFile
void LogAssetNotLoadedError ()
 Call this to log an error when an FAST.AssetFromFile cannot be loaded.
 
void SetNameWithFileExtension ()
 When you right-click on FAST.AssetFromFile.baseFileName in the Inspector, this function will run in the Editor to get the filename of an asset assigned to a corresponding Component.
 
void UpdateFileName (string language)
 Updates FAST.AssetFromFile.fileName using language, FAST.AssetSettings, FAST.AssetFromFile.prefixFileName, FAST.AssetFromFile.baseFileName, and FAST.AssetFromFile.suffixFileName.
 

Private Member Functions

void SetImageSettings ()
 When you right-click on FAST.ImagePlayerFromFile.imageSettings in the Inspector, this function will run in the Editor to get the TextureImporterSettings of the Image.sprite assigned to the FAST.ImagePlayer.uiImage of FAST.ImagePlayerFromFile.imagePlayer.
 

Private Attributes

ImagePlayer imagePlayer
 Inspector, Runtime
The FAST.ImagePlayer component that the image sequence asset is loaded into.
 
ImageSettings imageSettings = new()
 Inspector
The image import settings to use when loading the image sequence asset as a Sprite[].
 

Additional Inherited Members

- Public Attributes inherited from AssetFromFile
string baseFileName
 Inspector, Code
The name of the asset with the file extension, but without the prefix or suffix.
 
- Static Public Attributes inherited from AssetFromFile
const string kSharedLanguage = "Shared"
 Use this string as the language name for assets that are the same across all languages and can be shared.
 
- Protected Attributes inherited from AssetFromFile
string fileName
 Runtime
The full file name combined from the FAST.AssetFromFile.prefixFileName, FAST.AssetFromFile.baseFileName, and FAST.AssetFromFile.suffixFileName at runtime.
 
bool isSharedByAllLanguages
 Inspector
Set to true if this asset is the same across all languages and can be shared.
 
string prefixFileName
 Settings
A string loaded from FAST.AssetSettings that will be added to the front of the FAST.AssetFromFile.baseFileName at runtime.
 
string suffixFileName
 Settings
A string loaded from FAST.AssetSettings that will be inserted to the end of the FAST.AssetFromFile.baseFileName, but before the extension, at runtime.
 
- Static Protected Attributes inherited from AssetFromFile
const string kLanguageTag = "#Language"
 Use this string in the FAST.AssetSettings.prefixFileName or FAST.AssetSettings.suffixFileName to be replaced with the FAST.Application.language at runtime.
 
const string kProductNameTag = "#ProductName"
 Use this string in the FAST.AssetSettings.prefixFileName or FAST.AssetSettings.suffixFileName to be replaced with the UnityEngine.Application.productName at runtime.
 
const string kSkinTag = "#Skin"
 Use this string in the FAST.AssetSettings.prefixFileName or FAST.AssetSettings.suffixFileName to be replaced with the FAST.AssetSettings.skin at runtime.
 

Detailed Description

A class to help use an image sequence asset loaded from the file system as FAST.ImagePlayer.sprites for the current skin in multiple languages.

Assets are stored in FAST.Application.assets dictionary. This class will load the asset by looking it up in the dictionary using language in FAST.AssetFromFile.Load(string) and FAST.AssetFromFile.fileName.

See also
UnityEngine.Application
UnityEngine.Sprite
UnityEngine.UI.Image
UnityEditor.TextureImporterSettings

Member Function Documentation

◆ Awake()

override void Awake ( )
protectedvirtual

When the script is loaded, FAST.AssetFromFile.UpdateFileName(string) is called to initialize FAST.AssetFromFile.fileName.

Retrieves the FAST.ImagePlayer component at runtime if FAST.ImagePlayerFromFile.imagePlayer isn't assigned in the Inspector at runtime.

Reimplemented from AssetFromFile.

◆ Load()

override void Load ( string language)

Loads the asset from FAST.Application.assets dictionary using language and FAST.AssetFromFile.fileName.

Parameters
languageThe language of the asset to load.

FAST.ImageFromFile.imageSettings are used to load the image sequence asset as a Sprite[] into FAST.ImagePlayerFromFile.imagePlayer. The FAST.ImagePlayer.uiImage of FAST.ImagePlayerFromFile.imagePlayer is also initialized with the first element of the Sprite[].

◆ LoadCoroutine()

IEnumerator LoadCoroutine ( string language)

Loads the asset from FAST.Application.assets dictionary using language and FAST.AssetFromFile.fileName.

Parameters
languageThe language of the asset to load.

Loading is performed in a coroutine so it doesn't block execution.

FAST.ImageFromFile.imageSettings are used to load the image sequence asset as a Sprite[] into FAST.ImagePlayerFromFile.imagePlayer. The FAST.ImagePlayer.uiImage of FAST.ImagePlayerFromFile.imagePlayer is also initialized with the first element of the Sprite[].

◆ SetImageSettings()

void SetImageSettings ( )
private

When you right-click on FAST.ImagePlayerFromFile.imageSettings in the Inspector, this function will run in the Editor to get the TextureImporterSettings of the Image.sprite assigned to the FAST.ImagePlayer.uiImage of FAST.ImagePlayerFromFile.imagePlayer.

◆ SetNameWithFileExtension()

override void SetNameWithFileExtension ( )
protected

When you right-click on FAST.AssetFromFile.baseFileName in the Inspector, this function will run in the Editor to get the filename of the Image.sprite assigned to the FAST.ImagePlayer.uiImage of FAST.ImagePlayerFromFile.imagePlayer.

Member Data Documentation

◆ imagePlayer

ImagePlayer imagePlayer
private

Inspector, Runtime
The FAST.ImagePlayer component that the image sequence asset is loaded into.

Retrieved at runtime from FAST.ImagePlayerFromFile.Awake if no FAST.ImagePlayer is assigned in the Inspector.

◆ imageSettings

ImageSettings imageSettings = new()
private

Inspector
The image import settings to use when loading the image sequence asset as a Sprite[].


The documentation for this class was generated from the following file: