Created
June 26, 2020 05:25
-
-
Save sathyarajshetigar/8e8a639da5d8e166c6cf5f1a84fcb9ef to your computer and use it in GitHub Desktop.
onGameOver
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void onGameOver(int winner, bool isDraw) | |
{ | |
//Dictionary that gives all Game Details from the In-Game Gameplay of the Player | |
Dictionary<string, IList> scoreData = new Dictionary<string, IList>(); | |
Player player = GameManager.instance.FindPlayerWithID(winner); | |
//A list to store the Scene Name of your game, | |
// we might change the name so please create it as a constant variable somewhere | |
List<string> sceneName = new List<string> | |
{ | |
SceneManager.GetActiveScene().name | |
}; | |
// List<int> timelist = new List<int> | |
//{ | |
// (int)_turnTime | |
//}; | |
List<string> winnerList = new List<string> | |
{ | |
player.playerProfile.winzoID | |
}; | |
List<int> scoreList = new List<int> | |
{ | |
player.playerType == PlayerType.LocalPlayer ? 1 : isDraw ? 1 : 0 | |
}; | |
//Add all lists to the list | |
scoreData.Add("scenename", sceneName); | |
// scoreData.Add("time", timelist); | |
scoreData.Add("winnerID", winnerList); | |
scoreData.Add("scoreList", scoreList); | |
this.InvokeDelayed(() => | |
{ | |
WinzoEventManager.TriggerEvent("SubmitScore", scoreData); | |
}, 1f); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment