| 
									
										
										
										
											2025-08-31 12:29:24 +00:00
										 |  |  | using System.Collections; | 
					
						
							|  |  |  | using System.Collections.Generic; | 
					
						
							|  |  |  | using UnityEngine; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-09-01 10:32:50 +00:00
										 |  |  | namespace WZ | 
					
						
							| 
									
										
										
										
											2025-08-31 12:29:24 +00:00
										 |  |  | { | 
					
						
							|  |  |  |     public class PlayerPrefsUtils | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         private const string BXSdk_PREFIX = "Sdk_"; | 
					
						
							|  |  |  |         public static float GetPlayerPrefsFloat(string _key, float _dValue = 0.0f) | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             float value = PlayerPrefs.GetFloat(string.Format("{0}{1}", BXSdk_PREFIX, _key), _dValue); | 
					
						
							|  |  |  |             return value; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         public static void SavePlayerPrefsFloat(string _key, float _nValue) | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             PlayerPrefs.SetFloat(string.Format("{0}{1}", BXSdk_PREFIX, _key), _nValue); | 
					
						
							|  |  |  |             PlayerPrefs.Save(); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         public static int GetPlayerPrefsInt(string _key, int _dValue = 0) | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             int value = PlayerPrefs.GetInt(string.Format("{0}{1}", BXSdk_PREFIX, _key), _dValue); | 
					
						
							|  |  |  |             return value; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         public static void SavePlayerPrefsInt(string _key, int _nValue) | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             PlayerPrefs.SetInt(string.Format("{0}{1}", BXSdk_PREFIX, _key), _nValue); | 
					
						
							|  |  |  |             PlayerPrefs.Save(); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         public static string GetPlayerPrefsString(string _key, string _dValue = "") | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             string value = PlayerPrefs.GetString(string.Format("{0}{1}", BXSdk_PREFIX, _key), _dValue); | 
					
						
							|  |  |  |             return value; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         public static void SavePlayerPrefsString(string _key, string _nValue) | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             PlayerPrefs.SetString(string.Format("{0}{1}", BXSdk_PREFIX, _key), _nValue); | 
					
						
							|  |  |  |             PlayerPrefs.Save(); | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2025-08-31 14:18:31 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         public static bool IfFirstCheckPlayerPrefs(string _key) | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             var isFirstClick = PlayerPrefs.GetInt(_key, 0) == 0; | 
					
						
							|  |  |  |             PlayerPrefs.SetInt(_key, 1); | 
					
						
							|  |  |  |             PlayerPrefs.Save(); | 
					
						
							|  |  |  |             return isFirstClick; | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2025-09-01 05:44:32 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         public static void DeletePlayerPrefs(string _key) | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             PlayerPrefs.DeleteKey(_key); | 
					
						
							|  |  |  |             PlayerPrefs.Save(); | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2025-08-31 12:29:24 +00:00
										 |  |  |     } | 
					
						
							|  |  |  | } |