Manages the connection between the game and the F4F framework (code named Phoenix) and the F4F game lifecycle. More...
Public Member Functions | |
delegate void | OnStateInitialized () |
Delegate for OnStateInitialized. | |
delegate void | OnStateSetUnityAsReady () |
Delegate for OnSetUnityAsReady. | |
delegate void | OnStateSendAlive () |
Delegate for OnStateSendAlive. | |
void | SetUnityAsReady () |
Call this method to tell the F4F framework that the Unity application has launched successfully. If this method is not called within 10 seconds after game launch, the F4F framework will shut down the Unity game process and display an error message to the user. More... | |
void | ResetIdleTime () |
Resets the idle timer back to 0.0f. The idle timer makes sure to shut down a game if no user interaction has happened for more than 120 seconds. More... | |
float | GetIdleTime () |
Retrieves the current idle time. See ResetIdleTime() documentation for more information about the idle timer. More... | |
bool | SendLongAliveUpdate () |
Sends a long alive message to the F4F framework. A long alive message is worth about 5 seconds. If you have an operation which last longer than the 3 seconds from the SendAliveUpdate, you can call the SendLongAliveUpdate() manually before the operation starts. More... | |
bool | SendAliveUpdate () |
Sends a standard short alive message to Phoenix. Is usually called automatically by the PhoenixController every 2 seconds. If you have an operation which last longer than the 2 seconds, you can call it manually. A standard short alive message is worth about 3 seconds. More... | |
int | GetCurrentCredits () |
Retrieves the current credit balance on the machine. More... | |
bool | UseContinue () |
Tries to activate a "Continue" for the player/s. The credit balance needs to be covering the continue costs. More... | |
int | GetContinuePrice () |
Retrieves the current credit cost for a "Continue". See the UseContinue() method for more information about this feature. More... | |
int | GetMaxContinueCount () |
Retrieves the max continue count for the game. A value of -1 equals to unlimited continues. All positive values represent the maximal count a continue for one player can be used. More... | |
void | DoPlayerJoin (int playerTableId) |
Add a player at an previously unused place to the game. Only added players will have the ability to enter high scores. Before calling this function make sure that any player can be added to the game with CanPlayerJoin. More... | |
bool | CanPlayerJoin () |
This function is used to determine, if another player can be added to the game. The credit account is checked with this function, too to make sure that sufficient credits are available. Use this function before calling DoPlayerJoin to be sure that a player can be added. More... | |
int | GetJoinPrice () |
Retrieves the current credit cost for a "Join". See the DoPlayerJoin() method for more information about this feature. More... | |
void | SetScore (int playerIndex, int score) |
Writes a score entry to the F4F framework. The scores are then managed by the F4F framework independently from the game itself (e.g. by generating highscores, or by publishing the scores to the TAB ChampionsNet(TM) global highscore database). You should call this method for every player at the end of the game. More... | |
List< bool > | LoadPlayerPositionsFromPhoenix () |
Loads a list of all player positions from the F4F framework. Each player position is set to either true (there is a player) or false (there is no player). The list count is based on the number of maximum allowed players for this game. More... | |
List< int > | LoadPlayerMobileIdFromPhoenix () |
This is a method used for mobile device integration. If you want to get more information about F4F mobile device integration, please visit the mobile integration section within this Mobile device Integration documentation. More... | |
bool | IsMultiTouchSystem () |
This method can be used to determine if a multi touch Fun4Four device is connected to the current system. More... | |
void | SendMessageToMobilePlayer (int mobileId, string message) |
This is a method used for mobile device integration. If you want to get more information about F4F mobile device integration, please visit the mobile integration section within this Mobile device Integration documentation. More... | |
string | GetLanguageISOCode () |
Retrieve the currently set F4F language. More... | |
string | GetText (string tag) |
Get a translated text for a given tag. The tags must be specified in one of the localization .resx files. The resource files are just containing key - value pairs. The key-names have to be same for all language files. If the current selected language is not available, the default language file (English) will be chosen. More... | |
Static Public Member Functions | |
static void | InvokeLater (Action task) |
Internal use. Do not use directly. More... | |
Static Public Attributes | |
static OnStateInitialized | onStateInitialized = null |
static OnStateSetUnityAsReady | onStateSetUnityAsReady = null |
static OnStateSendAlive | onStateSendAlive = null |
Properties | |
static PhoenixController | Instance [get] |
The global Phoenix controller instance. The PhoenixController class is a singleton class, which you can retrieve through the static member Instance. More... | |
Manages the connection between the game and the F4F framework (code named Phoenix) and the F4F game lifecycle.
Covered functional areas:
bool TABUnitySDK.PhoenixController.CanPlayerJoin | ( | ) |
This function is used to determine, if another player can be added to the game. The credit account is checked with this function, too to make sure that sufficient credits are available. Use this function before calling DoPlayerJoin to be sure that a player can be added.
void TABUnitySDK.PhoenixController.DoPlayerJoin | ( | int | playerTableId | ) |
Add a player at an previously unused place to the game. Only added players will have the ability to enter high scores. Before calling this function make sure that any player can be added to the game with CanPlayerJoin.
playerTableId | The index for the place where the player wants to join. (See layouts) |
int TABUnitySDK.PhoenixController.GetContinuePrice | ( | ) |
Retrieves the current credit cost for a "Continue". See the UseContinue() method for more information about this feature.
int TABUnitySDK.PhoenixController.GetCurrentCredits | ( | ) |
Retrieves the current credit balance on the machine.
float TABUnitySDK.PhoenixController.GetIdleTime | ( | ) |
Retrieves the current idle time. See ResetIdleTime() documentation for more information about the idle timer.
int TABUnitySDK.PhoenixController.GetJoinPrice | ( | ) |
Retrieves the current credit cost for a "Join". See the DoPlayerJoin() method for more information about this feature.
string TABUnitySDK.PhoenixController.GetLanguageISOCode | ( | ) |
Retrieve the currently set F4F language.
int TABUnitySDK.PhoenixController.GetMaxContinueCount | ( | ) |
Retrieves the max continue count for the game. A value of -1 equals to unlimited continues. All positive values represent the maximal count a continue for one player can be used.
string TABUnitySDK.PhoenixController.GetText | ( | string | tag | ) |
Get a translated text for a given tag. The tags must be specified in one of the localization .resx files. The resource files are just containing key - value pairs. The key-names have to be same for all language files. If the current selected language is not available, the default language file (English) will be chosen.
tag | One of the tags specified in the resource files |
|
static |
Internal use. Do not use directly.
task | Internal use. Do not use directly. |
bool TABUnitySDK.PhoenixController.IsMultiTouchSystem | ( | ) |
This method can be used to determine if a multi touch Fun4Four device is connected to the current system.
List<int> TABUnitySDK.PhoenixController.LoadPlayerMobileIdFromPhoenix | ( | ) |
This is a method used for mobile device integration. If you want to get more information about F4F mobile device integration, please visit the mobile integration section within this Mobile device Integration documentation.
List<bool> TABUnitySDK.PhoenixController.LoadPlayerPositionsFromPhoenix | ( | ) |
Loads a list of all player positions from the F4F framework. Each player position is set to either true (there is a player) or false (there is no player). The list count is based on the number of maximum allowed players for this game.
void TABUnitySDK.PhoenixController.ResetIdleTime | ( | ) |
Resets the idle timer back to 0.0f. The idle timer makes sure to shut down a game if no user interaction has happened for more than 120 seconds.
Once the idle timer triggers, the whole Unity process hosting the game will be shut down by the F4F framework. It is recommended to reset the idle timer on every input made by a player.
bool TABUnitySDK.PhoenixController.SendAliveUpdate | ( | ) |
Sends a standard short alive message to Phoenix. Is usually called automatically by the PhoenixController every 2 seconds. If you have an operation which last longer than the 2 seconds, you can call it manually. A standard short alive message is worth about 3 seconds.
bool TABUnitySDK.PhoenixController.SendLongAliveUpdate | ( | ) |
Sends a long alive message to the F4F framework. A long alive message is worth about 5 seconds. If you have an operation which last longer than the 3 seconds from the SendAliveUpdate, you can call the SendLongAliveUpdate() manually before the operation starts.
void TABUnitySDK.PhoenixController.SendMessageToMobilePlayer | ( | int | mobileId, |
string | message | ||
) |
This is a method used for mobile device integration. If you want to get more information about F4F mobile device integration, please visit the mobile integration section within this Mobile device Integration documentation.
mobileId | |
message |
void TABUnitySDK.PhoenixController.SetScore | ( | int | playerIndex, |
int | score | ||
) |
Writes a score entry to the F4F framework. The scores are then managed by the F4F framework independently from the game itself (e.g. by generating highscores, or by publishing the scores to the TAB ChampionsNet(TM) global highscore database). You should call this method for every player at the end of the game.
playerIndex | The index value for the player. The index is 0 (zero) based. |
score | The score for the player. If a time highscore is used, convert the time in a int value representing the needed time in milliseconds. |
void TABUnitySDK.PhoenixController.SetUnityAsReady | ( | ) |
Call this method to tell the F4F framework that the Unity application has launched successfully. If this method is not called within 10 seconds after game launch, the F4F framework will shut down the Unity game process and display an error message to the user.
bool TABUnitySDK.PhoenixController.UseContinue | ( | ) |
Tries to activate a "Continue" for the player/s. The credit balance needs to be covering the continue costs.
A "Continue" is the option to continue the game after all of the player's lives have been lost or after the game time ran out, rather than ending the game and restarting it from the very beginning. There may or may not be a penalty for doing this, such as losing a certain number of points or being unable to access bonus stages.
The F4F framework makes sure that there are enough credits in the F4F to cover the continue costs, and then reduces the F4F credit balance accordingly. The method returns false if the continue is not possible (because there are not enough credits available, or because the F4F framework is not available).
|
static |
Called once when the F4F framework setup finishes. Once when the scene is loaded.
To add a function to a static delegate:
-> PhoenixController.onStateInitialized += MethodToAddToDelegate;
To remove the function from a static delegate:
-> PhoenixController.onStateInitialized -= MethodToRemoveFromDelegate;
|
static |
Is called when an alive signal is sent to the F4F framework. This happens every 2 seconds.
To add a function to a static delegate:
-> PhoenixController.onStateSendAlive += MethodToAddToDelegate;
To remove the function from a static delegate:
-> PhoenixController.onStateSendAlive -= MethodToRemoveFromDelegate;
|
static |
Is called once when the method SetUnityAsReady() is called.
To add a function to a static delegate:
-> PhoenixController.onStateSetUnityAsReady += MethodToAddToDelegate;
To remove the function from a static delegate:
-> PhoenixController.onStateSetUnityAsReady -= MethodToRemoveFromDelegate;
|
staticget |
The global Phoenix controller instance. The PhoenixController class is a singleton class, which you can retrieve through the static member Instance.