Events and Listeners
Last updated
Last updated
Events and Listeners:
WinZO provides various events with separate functionalities that are used to communicate between your Game and WinZO.
GameLoaded Event: This event is responsible for acknowledging to WinZO that the main Game Script has been loaded. The Game Client needs to trigger this event and then WinZO will start the game setup process.
SetUpGame and Listener: This event is responsible for the initializations of all the basic variables (like time, speed, difficulty) in the game. In this event you will get all the game configurations from WinZO’s server which is required to start your game. Below is the explanation of Game configuration.
Game Config: Game Config will include all the necessary information required to start/play the game, such as: Game time, game level, difficulty, player information, opponent information etc.
*All the configurable keys along with their value range must be communicated to WinZO and they should all be in Camel Case. Please share the configurable kets in the below format. In the SetUpGame callback, WinZO will provide the values of the configurable keys.
How to Use:
Create a script which will handle all the work related to WinZO, such as setting up the game, updating score, receiving game config and calling game over. For example - WinzoManager.
Use the following code in your class (WinzoManager) , and this class should be the entry point for your game from start to finish. You can write the following functions that are shown below and modify it as per your requirement. 1. SetUpGame 2. UpdateScore 3. SubmitScore Event
Please check the given code below for more information on how to use WinZO’s data in your game.
Start() of WinzoManager.cs