Exemple #1
0
        /// <summary>
        /// Turns encryption OFF ands unsets any existing password
        /// </summary>
        public static void UnsetEncryptionPassword()
        {
            var thisSettings = GetEncryptionSettings();

            if (thisSettings == null)
            {
                thisSettings = new UMAABMSettingsStore();
            }
            thisSettings.encryptionEnabled  = false;
            thisSettings.encryptionPassword = "";
            File.WriteAllText(Path.Combine(GetSettingsFolderPath(), SETTINGS_FILENAME), JsonUtility.ToJson(thisSettings));
            AssetDatabase.Refresh();
        }
Exemple #2
0
        public static void SetEncryptionSettings(bool encryptionEnabled, string encryptionPassword = "", string encryptionSuffix = "", bool?encodeNames = null)
        {
            var thisSettings = GetEncryptionSettings();

            if (thisSettings == null)
            {
                thisSettings = new UMAABMSettingsStore();
            }
            thisSettings.encryptionEnabled  = encryptionEnabled;
            thisSettings.encryptionPassword = encryptionPassword != "" ? encryptionPassword : thisSettings.encryptionPassword;
            thisSettings.encryptionSuffix   = encryptionSuffix != "" ? encryptionSuffix : thisSettings.encryptionSuffix;
            thisSettings.encodeNames        = encodeNames != null ? (bool)encodeNames : thisSettings.encodeNames;
            File.WriteAllText(Path.Combine(GetSettingsFolderPath(), SETTINGS_FILENAME), JsonUtility.ToJson(thisSettings));
            //need to make this show right in Unity when its inspected

            /*TextAsset textAsset = (TextAsset)AssetDatabase.LoadAssetAtPath(Path.Combine(GetSettingsFolderPath(), SETTINGS_FILENAME), typeof(TextAsset));
             * EditorUtility.SetDirty(textAsset);
             * AssetDatabase.SaveAssets();*/
            AssetDatabase.Refresh();
            //AssetDatabase.ImportAsset(Path.Combine(GetSettingsFolderPath(), SETTINGS_FILENAME), typeof(TextAsset));
        }
Exemple #3
0
        public static void ClearEncryptionSettings()
        {
            var thisSettings = new UMAABMSettingsStore();

            File.WriteAllText(Path.Combine(GetSettingsFolderPath(), SETTINGS_FILENAME), JsonUtility.ToJson(thisSettings));
        }