3. SubmitScore Event
3. SubmitScore Event
This event is responsible for submitting the game score to the server when the game ends. The game client should trigger this event when the game ends along with its parameters like score, scene_name, time etc.
Arguments should be provided by the game client and can be built using following approach: Create a Dictionary - Dictionary<string, IList> scoredata = new Dictionary<string, IList > (); This dictionary has the following Lists added to the IList
List<string> scenename - Pass WinZO’s game scene name. SceneNames class is present in WinZO’s SDK. Use SceneNames.WINZO_GAME_SCENE.
List<int> time - Time taken by user. i.e for how much time the user has played the game. Total time is provided by the WinZO server in config. You need to calculate elapsed time and pass it to this parameter.
List<int> opponentScore - If your game is a multiplayer game then you need to send the opponent score as well, It should not be the score array rather it should be the total score of the opponent player. eg. 55, it should be of Int type.
List<ObscuredInt> scores - It is the score array of the local player. Its type should be ObscuredInt. scores should be an array in which every element contains score increase or decrease (delta) whenever there is a change in score. For example, If a player collects a coin and it gains +5 points, then +5 will be added to this array and call WinZO’s UpdateScore function with the current score of the game to display the score on the UI. If a player collects poison, then -5 will be added to this array. This array is sent in the submitScore event.
How to Use SubmitScore
Last updated