From 1215c5f36e3a8cce6b0a0804316aca12c5be4d59 Mon Sep 17 00:00:00 2001 From: Hazim Bin Ijaz Date: Thu, 3 Apr 2025 23:34:54 +0500 Subject: [PATCH] Changed constants to the same Playfab Backend --- Assets/GoogleSigninSDK/GoogleSignInManager.cs | 4 ++-- Assets/Scripts/Dev/GameConstants.cs | 7 ++++--- Assets/Scripts/Dev/PlayFab/PlayFabInit.cs | 9 --------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/Assets/GoogleSigninSDK/GoogleSignInManager.cs b/Assets/GoogleSigninSDK/GoogleSignInManager.cs index 2952d65e..8e72fa37 100644 --- a/Assets/GoogleSigninSDK/GoogleSignInManager.cs +++ b/Assets/GoogleSigninSDK/GoogleSignInManager.cs @@ -162,10 +162,10 @@ public class GoogleSignInManager : MonoBehaviour private void LoginToPlayFab(string authCode) { - PlayFabSettings.staticSettings.TitleId = "1879F5"; + PlayFabSettings.staticSettings.TitleId = GameConstants.PlayfabTitleId; var request = new LoginWithGoogleAccountRequest { - TitleId = "1879F5", + TitleId = GameConstants.PlayfabTitleId, ServerAuthCode = authCode, CreateAccount = true }; diff --git a/Assets/Scripts/Dev/GameConstants.cs b/Assets/Scripts/Dev/GameConstants.cs index 489837dd..6f352e52 100644 --- a/Assets/Scripts/Dev/GameConstants.cs +++ b/Assets/Scripts/Dev/GameConstants.cs @@ -1,13 +1,14 @@ public class GameConstants { - - public static string LevelCompletedStatsKey = "LevelsCompleted"; + public static string GameNamePrefix = "HeroesOfLabyrinth"; + public static string LevelCompletedStatsKey = GameNamePrefix+"_LevelsCompleted"; public static string NameEnteredCheckKey = "IsNameEntered"; public static string AvatarSelectedCheckKey = "AvatarSelected"; public static string AvatarSelectedIndex = "AvatarSelectedIndex"; public static string DisplayNameKey = "DisplayName"; - + public static string PlayfabTitleId = "168AE2"; + #region MyRegion public static string Ach_CompleteEasyLevelKey = "Completed_Easy_Level"; diff --git a/Assets/Scripts/Dev/PlayFab/PlayFabInit.cs b/Assets/Scripts/Dev/PlayFab/PlayFabInit.cs index 279b53bc..aeb689a3 100644 --- a/Assets/Scripts/Dev/PlayFab/PlayFabInit.cs +++ b/Assets/Scripts/Dev/PlayFab/PlayFabInit.cs @@ -7,15 +7,6 @@ using UnityEngine.SceneManagement; public class PlayFabInit : MonoBehaviour { - public string playFabTitleId = "7D3B9"; // Replace with your PlayFab Title ID - - void Start() - { - if (string.IsNullOrEmpty(PlayFabSettings.TitleId)) - { - PlayFabSettings.TitleId = playFabTitleId; - } - } // 🚀 Called from GoogleSignInManager when Google Sign-In is successful public void LoginToPlayFabWithGoogle(string idToken)