public void ResetGameSession() { SceneManager.LoadScene("Game Over"); stats = new PlayFabController(); stats.SetStats(); DontDestroyOnLoad(stats); // leaderboard = new PlayFabController(); // leaderboard.GetLeaderboarder(); //Destroy(gameObject); }
// PlayFabController cloudStats; private void OnTriggerEnter2D(Collider2D collision) { FindObjectOfType <GameSession>().AddToScore(pointsForCoinPickUp); AudioSource.PlayClipAtPoint(coinPickUpSFX, Camera.main.transform.position); Destroy(gameObject); stats = new PlayFabController(); stats.SetStats(); // cloudStats = new PlayFabController(); // cloudStats.StartCloudUpdatePlayerStats(); }