private void OnStateChanged(bool value)
 {
     HMSMainEditorSettings.Instance.Settings.SetBool(RemoteConfigEnabled, value);
     if (value)
     {
         if (GameObject.FindObjectOfType <HMSRemoteConfigManager>() == null)
         {
             GameObject obj = new GameObject("HMSRemoteConfigManager");
             obj.AddComponent <HMSRemoteConfigManager>();
             EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
         }
         _dependentToggle.SetToggle();
         _tabBar.AddTab(_tabView);
     }
     else
     {
         var remoteConfigManagers = GameObject.FindObjectsOfType <HMSRemoteConfigManager>();
         if (remoteConfigManagers.Length > 0)
         {
             for (int i = 0; i < remoteConfigManagers.Length; i++)
             {
                 GameObject.DestroyImmediate(remoteConfigManagers[i].gameObject);
             }
         }
         _tabBar.RemoveTab(_tabView);
     }
 }
Ejemplo n.º 2
0
 private void OnStateChanged(bool value)
 {
     if (value)
     {
         _tabBar.AddTab(_tabView);
         if (GameObject.FindObjectOfType <HMSGameManager>() == null)
         {
             GameObject obj = new GameObject("HMSGameManager");
             obj.AddComponent <HMSGameManager>();
             obj.AddComponent <HMSAchievementsManager>();
             obj.AddComponent <HMSLeaderboardManager>();
             obj.AddComponent <HMSSaveGameManager>();
             EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
         }
         _dependentToggle.SetToggle();
     }
     else
     {
         var gameKitManagers = GameObject.FindObjectsOfType <HMSGameManager>();
         if (gameKitManagers.Length > 0)
         {
             for (int i = 0; i < gameKitManagers.Length; i++)
             {
                 GameObject.DestroyImmediate(gameKitManagers[i].gameObject);
             }
         }
         _tabBar.RemoveTab(_tabView);
     }
     HMSMainEditorSettings.Instance.Settings.SetBool(GameServiceEnabled, value);
 }
Ejemplo n.º 3
0
 private void OnStateChanged(bool value)
 {
     if (value)
     {
         if (GameObject.FindObjectOfType <HMSCloudDBManager>() == null)
         {
             GameObject obj = new GameObject("HMSCloudDBManager");
             obj.AddComponent <HMSCloudDBManager>();
             EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
         }
         _dependentToggle.SetToggle();
     }
     else
     {
         var cloudDBManagers = GameObject.FindObjectsOfType <HMSCloudDBManager>();
         if (cloudDBManagers.Length > 0)
         {
             for (int i = 0; i < cloudDBManagers.Length; i++)
             {
                 GameObject.DestroyImmediate(cloudDBManagers[i].gameObject);
             }
         }
     }
     HMSMainEditorSettings.Instance.Settings.SetBool(CloudDBEnabled, value);
 }
Ejemplo n.º 4
0
 private void OnStateChanged(bool value)
 {
     if (value)
     {
         CreateManagers();
         _dependentToggle.SetToggle();
     }
     else
     {
         DestroyManagers();
     }
     HMSMainEditorSettings.Instance.Settings.SetBool(CrashKitEnabled, value);
 }
 private void OnStateChanged(bool value)
 {
     if (value)
     {
         CreateManagers();
         _dependentToggle.SetToggle();
         _tabBar.AddTab(_tabView);
     }
     else
     {
         DestroyManagers();
         _tabBar.RemoveTab(_tabView);
     }
     HMSMainEditorSettings.Instance.Settings.SetBool(CloudDBEnabled, value);
 }