Пример #1
0
        public static HashUser GetUserFromSerializedData(SerializedHashUser serializedUser)
        {
            DebugUtil.AssertContext(serializedUser == null, "Null user", serializedUser);

            var result = new HashUser();

            result.Username = serializedUser.UserName;
            result.Password = serializedUser.Password;
            return(result);
        }
Пример #2
0
        private void OnValidate()
        {
            if (Type == HashFileType.Text)
            {
                DebugUtil.AssertContext((Content as TextAsset) == null, "Text file with a invalid text asset", this);
            }
            else if (Type == HashFileType.Image)
            {
                DebugUtil.AssertContext((Content as Texture2D) == null, "Image file with a invalid texture asset", this);
            }
            else
            {
                DebugUtil.AssertContext(true, "File with invalid type!", this);
            }

            if (Status == FileStatus.Encrypted && string.IsNullOrEmpty(Password))
            {
                Debug.LogError("The file is encrypted but has no password!", this);
            }
        }