//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
// 此文件由工具自动生成，请勿直接修改。
// 生成时间：2022-01-18 17:00:23.091
//------------------------------------------------------------

using GameFramework;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using UnityEngine;
using UnityGameFramework.Runtime;

namespace MetaClient
{
    /// <summary>
    /// 捏人系统界面。
    /// </summary>
    public class DRCustomRole : DataRowBase
    {
        private int m_Id = 0;

        /// <summary>
        /// 获取按钮id。
        /// </summary>
        public override int Id
        {
            get
            {
                return m_Id;
            }
        }

        /// <summary>
        /// 获取按钮名称。
        /// </summary>
        public string Name
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取是否显示。
        /// </summary>
        public int IsActive
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取按钮类型。
        /// </summary>
        public int ButtonStyple
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取按钮控制类型。
        /// </summary>
        public string ButtonPushFun
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取图片icon名称。
        /// </summary>
        public string Icon
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取是否传输内容。
        /// </summary>
        public int IsSendContent
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取传输对应类型。
        /// </summary>
        public int SendContent
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取接收到的对应数据。
        /// </summary>
        public int Receive
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取对应身体部位。
        /// </summary>
        public int Part
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取是否保持子物体缩放。
        /// </summary>
        public bool IsKeepChildrenScale
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取是否左右一样。
        /// </summary>
        public bool IsMirror
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取缩放最小值。
        /// </summary>
        public float ScaleRangeMin
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取缩放最大值。
        /// </summary>
        public float ScaleRangeMax
        {
            get;
            private set;
        }

        /// <summary>
        /// 获取缩放类型。
        /// </summary>
        public int ModifyType
        {
            get;
            private set;
        }

        public override bool ParseDataRow(string dataRowString, object userData)
        {
            string[] columnStrings = dataRowString.Split(DataTableExtension.DataSplitSeparators);
            for (int i = 0; i < columnStrings.Length; i++)
            {
                columnStrings[i] = columnStrings[i].Trim(DataTableExtension.DataTrimSeparators);
            }

            int index = 0;
            index++;
            m_Id = int.Parse(columnStrings[index++]);
            Name = columnStrings[index++];
            IsActive = int.Parse(columnStrings[index++]);
            ButtonStyple = int.Parse(columnStrings[index++]);
            ButtonPushFun = columnStrings[index++];
            Icon = columnStrings[index++];
            IsSendContent = int.Parse(columnStrings[index++]);
            SendContent = int.Parse(columnStrings[index++]);
            Receive = int.Parse(columnStrings[index++]);
            Part = int.Parse(columnStrings[index++]);
            IsKeepChildrenScale = bool.Parse(columnStrings[index++]);
            IsMirror = bool.Parse(columnStrings[index++]);
            ScaleRangeMin = float.Parse(columnStrings[index++]);
            ScaleRangeMax = float.Parse(columnStrings[index++]);
            ModifyType = int.Parse(columnStrings[index++]);

            GeneratePropertyArray();
            return true;
        }

        public override bool ParseDataRow(byte[] dataRowBytes, int startIndex, int length, object userData)
        {
            using (MemoryStream memoryStream = new MemoryStream(dataRowBytes, startIndex, length, false))
            {
                using (BinaryReader binaryReader = new BinaryReader(memoryStream, Encoding.UTF8))
                {
                    m_Id = binaryReader.Read7BitEncodedInt32();
                    Name = binaryReader.ReadString();
                    IsActive = binaryReader.Read7BitEncodedInt32();
                    ButtonStyple = binaryReader.Read7BitEncodedInt32();
                    ButtonPushFun = binaryReader.ReadString();
                    Icon = binaryReader.ReadString();
                    IsSendContent = binaryReader.Read7BitEncodedInt32();
                    SendContent = binaryReader.Read7BitEncodedInt32();
                    Receive = binaryReader.Read7BitEncodedInt32();
                    Part = binaryReader.Read7BitEncodedInt32();
                    IsKeepChildrenScale = binaryReader.ReadBoolean();
                    IsMirror = binaryReader.ReadBoolean();
                    ScaleRangeMin = binaryReader.ReadSingle();
                    ScaleRangeMax = binaryReader.ReadSingle();
                    ModifyType = binaryReader.Read7BitEncodedInt32();
                }
            }

            GeneratePropertyArray();
            return true;
        }

        private void GeneratePropertyArray()
        {

        }
    }
}
