Example #1
0
        public static uint GetUInt(string key, uint defaultValue)
        {
            string encryptedPrefsString = ObscuredPrefs.GetEncryptedPrefsString(key, ObscuredPrefs.EncryptKey(key));

            if (encryptedPrefsString == "{not_found}")
            {
                return(defaultValue);
            }
            return(ObscuredPrefs.DecryptUIntValue(key, encryptedPrefsString, defaultValue));
        }
Example #2
0
        public static Color32 GetColor(string key, Color32 defaultValue)
        {
            string encryptedPrefsString = ObscuredPrefs.GetEncryptedPrefsString(key, ObscuredPrefs.EncryptKey(key));

            if (encryptedPrefsString == "{not_found}")
            {
                return(defaultValue);
            }
            uint num1 = ObscuredPrefs.DecryptUIntValue(key, encryptedPrefsString, 16777216U);
            byte num2 = (byte)(num1 >> 24);

            return(new Color32((byte)(num1 >> 16), (byte)(num1 >> 8), (byte)num1, num2));
        }
Example #3
0
        public static Color32 GetColor(string key, Color32 defaultValue)
        {
            string encryptedPrefsString = ObscuredPrefs.GetEncryptedPrefsString(key, ObscuredPrefs.EncryptKey(key));

            if (encryptedPrefsString == "{not_found}")
            {
                return(defaultValue);
            }
            uint num = ObscuredPrefs.DecryptUIntValue(key, encryptedPrefsString, 16777216u);
            byte a   = (byte)(num >> 24);
            byte r   = (byte)(num >> 16);
            byte g   = (byte)(num >> 8);
            byte b   = (byte)num;

            return(new Color32(r, g, b, a));
        }