EditorPrefs.GetString public static string GetString (string key, string defaultValue= ""); 説明 キーが存在する場合、key に対応する値を取得します。 If the value doesn't exist, it will return defaultValue. Note that EditorPrefs does not support null strings, so if defaultValue is null, ...
EditorPrefs.GetString public static stringGetString(stringkey, stringdefaultValue= ""); 説明 キーが存在する場合、keyに対応する値を取得します。 If the value doesn't exist, it will returndefaultValue. Note that EditorPrefs does not support null strings, so ifdefaultValueis null, an empty string...
SetString 存储字符串值。 SetVector3 存储Vector3。 官方地址:https://docs.unity3d.com/cn/2020.3/ScriptReference/SessionState.html 2. EditorPrefs 描述 存储和访问 Unity 编辑器偏好设置。 在macOS 上,EditorPrefs 存储在~/Library/Preferences/com.unity3d.UnityEditor5.x.plist。 在Windows 上,EditorPrefs 存...
5.SetString(); 保存字符串型数据; 6.GetString(); 读取字符串型数据; EditorPrefs.DeleteKey (key : string) 删除指定数据; EditorPrefs.DeleteAll() 删除全部键 ; EditorPrefs.HasKey (key : string) 判断数据是否存在; 3.2 EditorUserSettings.Set / GetConfigValue (以二进制形式保存) 此方法存储的值是以...
主要使用 EditorPrefs.SetInt/SetString()方法等进行存档 EditorPrefs.GetInt/GetString();进行读档。下面是一个简单的例子。 [MenuItem("Test/Dialog")] static void Dialog() { ScriptableWizard.DisplayWizard<DialogBox>("第一个对话框","ChangeNameAndClose","ChangeName"); ...
GetString返回偏好设置文件中与 key 对应的值(如果存在)。 HasKey如果偏好设置文件中存在 /key/,则返回 true。 SetBool设置由 key 标识的偏好设置的值。 SetFloat设置由 key 标识的偏好设置的浮点值。 SetInt将由键标识的偏好设置的值设置为整数。 SetString设置由 key 标识的偏好设置的值。请注意,EditorPrefs 不...
stringpath = EditorUtility.SaveFilePanel(target.ToString(), EditorPrefs.GetString("BuildPath"), PlayerSettings.productName,"exe"); if(string.IsNullOrEmpty(path)) return; BuildPlayerOptions _buildOption =newBuildPlayerOptions(); _buildOption.locationPathName = path; ...
string buildPath = EditorPrefs.GetString("BuildPath", ""); if (!Directory.Exists(buildPath)) { Debug.LogError("Please set build path!"); return; } BuildTarget target = (BuildTarget)EditorPrefs.GetInt("BuildTarget", 5); BuildPipeline.BuildAssetBundles(buildPath, BuildAssetBundleOptions.None, tar...
一、EditorPrefs Unity编辑器为开发者提供了类似PlayerPrefs的数据保存方式EditorPrefs。EditorPrefs是适用于编辑器模式,而PlayerPrefs适用于游戏运行时。 EditorPrefs提供了四种数据的保存:int,float,string,bool。通过Set方法保存数据,下次则通过Get方法来获取数据,HasKey方法可以判断是否存在该数据的保存,删除数据调用DeleteKey方...
void GetPathByMemory() { addr2linePath = EditorPrefs.GetString("addr2linePath"); il2cppdebugsoPath = EditorPrefs.GetString("il2cppdebugsoPath"); unitydebugsoPath = EditorPrefs.GetString("unitydebugsoPath"); if (string.IsNullOrEmpty(unitydebugsoPath)) ...