Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sathyarajshetigar/8e8a639da5d8e166c6cf5f1a84fcb9ef to your computer and use it in GitHub Desktop.
Save sathyarajshetigar/8e8a639da5d8e166c6cf5f1a84fcb9ef to your computer and use it in GitHub Desktop.
onGameOver
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