FAST SDK Coding Reference 1.0.3
Loading...
Searching...
No Matches
ScreenManagerTemplate< T > Class Template Referenceabstract

A base class used to manage screen states, respond to interaction, change the screen, or change the language. More...

Public Member Functions

virtual void ChangeScreen (string newScreenName)
 Default behavior changes screens by setting the old screen's GameObject inactive and the new screen's GameObject active.
 
virtual void OnLanguageChange ()
 Default behavior stops all Coroutines and starts the FAST.ScreenManagerTemplate<T>.ChangeLanguage() Coroutine.
 
virtual void OnRestart ()
 Default behavior calls FAST.ScreenManagerTemplate<T>.Start().
 

Protected Member Functions

virtual void Awake ()
 Default behavior is to copy the FAST.ScreenManagerTemplate<T>.screensList to FAST.ScreenManagerTemplate<T>.screens, set the FAST.ScreenManagerTemplate<T>.currentScreenName, and get all the FAST.AudioClipFromFiles that are children of this GameObject and add them to FAST.ScreenTemplate.audioLUT.
 
virtual IEnumerator ChangeLanguage ()
 Default behavior clears the current screen, changes to the next language, loads the new language assets, and then plays the current screen.
 
virtual void Start ()
 Default behavior sets the current screen to FAST.ScreenManagerTemplate<T>.currentScreenName, which is the first screen in the FAST.ScreenManagerTemplate<T>.screensList.
 

Protected Attributes

Dictionary< string, AudioClipFromFileaudioLUT = new()
 Code
All the FAST.AudioClipFromFiles that are children of this GameObject and should be considered audio available to use that isn't specific to any screen.
 
AudioPlayer audioPlayer
 Inspector, Code
A reference to a FAST.AudioPlayer that will be used for playback of sequential audio that isn't specific to any screen.
 
string currentScreenName
 Inspector, Code
The name of the current, active screen state.
 
Dictionary< string, T > screens = new()
 The FAST.ScreenManagerTemplate<T>.screensList converted to a Dictionary<TKey, TValue> for easier lookup and use.
 
NamedObject< T >[] screensList
 Inspector, Code
A list of all the screen states as FAST.ScreenTemplates.
 

Detailed Description

A base class used to manage screen states, respond to interaction, change the screen, or change the language.

Inherit from this class to define a screen manager class with modified or additional functionality specific to your activity.

Template Parameters
TThe screen base class that you define and inherits from FAST.ScreenTemplate.
See also
UnityEngine.GameObject
UnityEngine.Coroutine
Type Constraints
T :ScreenTemplate 

Member Function Documentation

◆ Awake()

virtual void Awake ( )
protectedvirtual

Default behavior is to copy the FAST.ScreenManagerTemplate<T>.screensList to FAST.ScreenManagerTemplate<T>.screens, set the FAST.ScreenManagerTemplate<T>.currentScreenName, and get all the FAST.AudioClipFromFiles that are children of this GameObject and add them to FAST.ScreenTemplate.audioLUT.

◆ ChangeLanguage()

virtual IEnumerator ChangeLanguage ( )
protectedvirtual

Default behavior clears the current screen, changes to the next language, loads the new language assets, and then plays the current screen.

◆ ChangeScreen()

virtual void ChangeScreen ( string newScreenName)
virtual

Default behavior changes screens by setting the old screen's GameObject inactive and the new screen's GameObject active.

Parameters
newScreenNameThe name of the new screen.

◆ OnLanguageChange()

virtual void OnLanguageChange ( )
virtual

Default behavior stops all Coroutines and starts the FAST.ScreenManagerTemplate<T>.ChangeLanguage() Coroutine.

◆ OnRestart()

virtual void OnRestart ( )
virtual

Default behavior calls FAST.ScreenManagerTemplate<T>.Start().

◆ Start()

virtual void Start ( )
protectedvirtual

Default behavior sets the current screen to FAST.ScreenManagerTemplate<T>.currentScreenName, which is the first screen in the FAST.ScreenManagerTemplate<T>.screensList.

Member Data Documentation

◆ audioLUT

Dictionary<string, AudioClipFromFile> audioLUT = new()
protected

Code
All the FAST.AudioClipFromFiles that are children of this GameObject and should be considered audio available to use that isn't specific to any screen.

◆ audioPlayer

AudioPlayer audioPlayer
protected

Inspector, Code
A reference to a FAST.AudioPlayer that will be used for playback of sequential audio that isn't specific to any screen.

◆ currentScreenName

string currentScreenName
protected

Inspector, Code
The name of the current, active screen state.

This is set to the first screen in the FAST.ScreenManagerTemplate<T>.screensList on FAST.ScreenManagerTemplate<T>.Awake().

◆ screens

Dictionary<string, T> screens = new()
protected

The FAST.ScreenManagerTemplate<T>.screensList converted to a Dictionary<TKey, TValue> for easier lookup and use.

◆ screensList

NamedObject<T> [] screensList
protected

Inspector, Code
A list of all the screen states as FAST.ScreenTemplates.

This list exists to serialize/deserialize FAST.ScreenManagerTemplate<T>.screens so it can be edited in the Inspector. Also, the first screen in the list is set as the FAST.ScreenManagerTemplate<T>.currentScreenName on FAST.ScreenManagerTemplate<T>.Awake().


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