Browse Source

1.事件添加类型参数

qianzhuqing 3 years ago
parent
commit
5c49dc75ff

BIN
Assets/GameMain/DataTables/CustomFace.bytes


BIN
Assets/GameMain/DataTables/CustomFace.txt


+ 1 - 1
Assets/GameMain/Scripts/DataTable/DRAircraft.cs

@@ -5,7 +5,7 @@
 // Feedback: mailto:ellan@gameframework.cn
 //------------------------------------------------------------
 // 此文件由工具自动生成,请勿直接修改。
-// 生成时间:2022-01-25 20:25:37.094
+// 生成时间:2022-01-25 20:36:36.434
 //------------------------------------------------------------
 
 using GameFramework;

+ 1 - 1
Assets/GameMain/Scripts/DataTable/DRArmor.cs

@@ -5,7 +5,7 @@
 // Feedback: mailto:ellan@gameframework.cn
 //------------------------------------------------------------
 // 此文件由工具自动生成,请勿直接修改。
-// 生成时间:2022-01-25 20:25:37.107
+// 生成时间:2022-01-25 20:36:36.446
 //------------------------------------------------------------
 
 using GameFramework;

+ 1 - 1
Assets/GameMain/Scripts/DataTable/DRAsteroid.cs

@@ -5,7 +5,7 @@
 // Feedback: mailto:ellan@gameframework.cn
 //------------------------------------------------------------
 // 此文件由工具自动生成,请勿直接修改。
-// 生成时间:2022-01-25 20:25:37.111
+// 生成时间:2022-01-25 20:36:36.450
 //------------------------------------------------------------
 
 using GameFramework;

+ 1 - 1
Assets/GameMain/Scripts/DataTable/DRCustomBody.cs

@@ -5,7 +5,7 @@
 // Feedback: mailto:ellan@gameframework.cn
 //------------------------------------------------------------
 // 此文件由工具自动生成,请勿直接修改。
-// 生成时间:2022-01-25 20:25:37.144
+// 生成时间:2022-01-25 20:36:36.481
 //------------------------------------------------------------
 
 using GameFramework;

+ 35 - 56
Assets/GameMain/Scripts/DataTable/DRCustomFace.cs

@@ -5,7 +5,7 @@
 // Feedback: mailto:ellan@gameframework.cn
 //------------------------------------------------------------
 // 此文件由工具自动生成,请勿直接修改。
-// 生成时间:2022-01-25 20:25:37.152
+// 生成时间:2022-01-25 20:36:36.488
 //------------------------------------------------------------
 
 using GameFramework;
@@ -19,7 +19,7 @@ using UnityGameFramework.Runtime;
 namespace MetaClient
 {
     /// <summary>
-    /// 自定义身体
+    /// 自定义面部
     /// </summary>
     public class DRCustomFace : DataRowBase
     {
@@ -109,126 +109,108 @@ namespace MetaClient
         }
 
         /// <summary>
-        /// 获取对应身体部位。
-        /// </summary>
-        public int Part
-        {
-            get;
-            private set;
-        }
-
-        /// <summary>
-        /// 获取是否保持子物体缩放。
-        /// </summary>
-        public bool IsKeepChildrenScale
-        {
-            get;
-            private set;
-        }
-
-        /// <summary>
-        /// 获取是否左右一样。
+        /// 获取缩放最小值。
         /// </summary>
-        public bool IsMirror
+        public float ScaleRangeMin
         {
             get;
             private set;
         }
 
         /// <summary>
-        /// 获取缩放最值。
+        /// 获取缩放最大值。
         /// </summary>
-        public float ScaleRangeMin
+        public float ScaleRangeMax
         {
             get;
             private set;
         }
 
         /// <summary>
-        /// 获取缩放最大值
+        /// 获取缩放类型。
         /// </summary>
-        public float ScaleRangeMax
+        public int ModifyType
         {
             get;
             private set;
         }
 
         /// <summary>
-        /// 获取缩放修改
+        /// 获取骨骼名称
         /// </summary>
-        public Vector3 ScaleChange
+        public string BoneName
         {
             get;
             private set;
         }
 
         /// <summary>
-        /// 获取位置修改
+        /// 获取对应的图片类别
         /// </summary>
-        public Vector3 PositionChange
+        public int ParentStyple
         {
             get;
             private set;
         }
 
         /// <summary>
-        /// 获取角度修改
+        /// 获取是否使用变形器
         /// </summary>
-        public Vector3 RotationChange
+        public bool IsBlend
         {
             get;
             private set;
         }
 
         /// <summary>
-        /// 获取骨骼名称
+        /// 获取放大变形器
         /// </summary>
-        public string BoneName
+        public string BiggerBlendName
         {
             get;
             private set;
         }
 
         /// <summary>
-        /// 获取对应的图片类别
+        /// 获取变形器默认值
         /// </summary>
-        public int ParentStyple
+        public float DefaultBlendValue
         {
             get;
             private set;
         }
 
         /// <summary>
-        /// 获取是否使用变形器。
+        /// 获取缩小变形器。
         /// </summary>
-        public bool IsBlend
+        public string SmallerBlendName
         {
             get;
             private set;
         }
 
         /// <summary>
-        /// 获取放大变形器
+        /// 获取缩放修改
         /// </summary>
-        public string BiggerBlendName
+        public Vector3 ScaleChange
         {
             get;
             private set;
         }
 
         /// <summary>
-        /// 获取变形器默认值
+        /// 获取位置修改
         /// </summary>
-        public float DefaultBlendValue
+        public Vector3 PositionChange
         {
             get;
             private set;
         }
 
         /// <summary>
-        /// 获取缩小变形器
+        /// 获取角度修改
         /// </summary>
-        public string SmallerBlendName
+        public Vector3 RotationChange
         {
             get;
             private set;
@@ -253,20 +235,19 @@ namespace MetaClient
             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++]);
-            ScaleChange = DataTableExtension.ParseVector3(columnStrings[index++]);
-            PositionChange = DataTableExtension.ParseVector3(columnStrings[index++]);
-            RotationChange = DataTableExtension.ParseVector3(columnStrings[index++]);
+            ModifyType = int.Parse(columnStrings[index++]);
             BoneName = columnStrings[index++];
             ParentStyple = int.Parse(columnStrings[index++]);
             IsBlend = bool.Parse(columnStrings[index++]);
             BiggerBlendName = columnStrings[index++];
             DefaultBlendValue = float.Parse(columnStrings[index++]);
             SmallerBlendName = columnStrings[index++];
+            ScaleChange = DataTableExtension.ParseVector3(columnStrings[index++]);
+            PositionChange = DataTableExtension.ParseVector3(columnStrings[index++]);
+            RotationChange = DataTableExtension.ParseVector3(columnStrings[index++]);
+            index++;
 
             GeneratePropertyArray();
             return true;
@@ -287,20 +268,18 @@ namespace MetaClient
                     IsSendContent = binaryReader.Read7BitEncodedInt32();
                     SendContent = binaryReader.Read7BitEncodedInt32();
                     Receive = binaryReader.Read7BitEncodedInt32();
-                    Part = binaryReader.Read7BitEncodedInt32();
-                    IsKeepChildrenScale = binaryReader.ReadBoolean();
-                    IsMirror = binaryReader.ReadBoolean();
                     ScaleRangeMin = binaryReader.ReadSingle();
                     ScaleRangeMax = binaryReader.ReadSingle();
-                    ScaleChange = binaryReader.ReadVector3();
-                    PositionChange = binaryReader.ReadVector3();
-                    RotationChange = binaryReader.ReadVector3();
+                    ModifyType = binaryReader.Read7BitEncodedInt32();
                     BoneName = binaryReader.ReadString();
                     ParentStyple = binaryReader.Read7BitEncodedInt32();
                     IsBlend = binaryReader.ReadBoolean();
                     BiggerBlendName = binaryReader.ReadString();
                     DefaultBlendValue = binaryReader.ReadSingle();
                     SmallerBlendName = binaryReader.ReadString();
+                    ScaleChange = binaryReader.ReadVector3();
+                    PositionChange = binaryReader.ReadVector3();
+                    RotationChange = binaryReader.ReadVector3();
                 }
             }
 

+ 1 - 1
Assets/GameMain/Scripts/DataTable/DREntity.cs

@@ -5,7 +5,7 @@
 // Feedback: mailto:ellan@gameframework.cn
 //------------------------------------------------------------
 // 此文件由工具自动生成,请勿直接修改。
-// 生成时间:2022-01-25 20:25:37.118
+// 生成时间:2022-01-25 20:36:36.455
 //------------------------------------------------------------
 
 using GameFramework;

+ 1 - 1
Assets/GameMain/Scripts/DataTable/DRMusic.cs

@@ -5,7 +5,7 @@
 // Feedback: mailto:ellan@gameframework.cn
 //------------------------------------------------------------
 // 此文件由工具自动生成,请勿直接修改。
-// 生成时间:2022-01-25 20:25:37.121
+// 生成时间:2022-01-25 20:36:36.459
 //------------------------------------------------------------
 
 using GameFramework;

+ 1 - 1
Assets/GameMain/Scripts/DataTable/DRScene.cs

@@ -5,7 +5,7 @@
 // Feedback: mailto:ellan@gameframework.cn
 //------------------------------------------------------------
 // 此文件由工具自动生成,请勿直接修改。
-// 生成时间:2022-01-25 20:25:37.123
+// 生成时间:2022-01-25 20:36:36.460
 //------------------------------------------------------------
 
 using GameFramework;

+ 1 - 1
Assets/GameMain/Scripts/DataTable/DRSound.cs

@@ -5,7 +5,7 @@
 // Feedback: mailto:ellan@gameframework.cn
 //------------------------------------------------------------
 // 此文件由工具自动生成,请勿直接修改。
-// 生成时间:2022-01-25 20:25:37.126
+// 生成时间:2022-01-25 20:36:36.462
 //------------------------------------------------------------
 
 using GameFramework;

+ 1 - 1
Assets/GameMain/Scripts/DataTable/DRThruster.cs

@@ -5,7 +5,7 @@
 // Feedback: mailto:ellan@gameframework.cn
 //------------------------------------------------------------
 // 此文件由工具自动生成,请勿直接修改。
-// 生成时间:2022-01-25 20:25:37.129
+// 生成时间:2022-01-25 20:36:36.465
 //------------------------------------------------------------
 
 using GameFramework;

+ 1 - 1
Assets/GameMain/Scripts/DataTable/DRUIForm.cs

@@ -5,7 +5,7 @@
 // Feedback: mailto:ellan@gameframework.cn
 //------------------------------------------------------------
 // 此文件由工具自动生成,请勿直接修改。
-// 生成时间:2022-01-25 20:25:37.131
+// 生成时间:2022-01-25 20:36:36.468
 //------------------------------------------------------------
 
 using GameFramework;

+ 1 - 1
Assets/GameMain/Scripts/DataTable/DRUISound.cs

@@ -5,7 +5,7 @@
 // Feedback: mailto:ellan@gameframework.cn
 //------------------------------------------------------------
 // 此文件由工具自动生成,请勿直接修改。
-// 生成时间:2022-01-25 20:25:37.134
+// 生成时间:2022-01-25 20:36:36.470
 //------------------------------------------------------------
 
 using GameFramework;

+ 1 - 1
Assets/GameMain/Scripts/DataTable/DRWeapon.cs

@@ -5,7 +5,7 @@
 // Feedback: mailto:ellan@gameframework.cn
 //------------------------------------------------------------
 // 此文件由工具自动生成,请勿直接修改。
-// 生成时间:2022-01-25 20:25:37.136
+// 生成时间:2022-01-25 20:36:36.472
 //------------------------------------------------------------
 
 using GameFramework;

+ 3 - 1
Assets/GameMain/Scripts/Event/CustomRoleBodyEventArgs.cs

@@ -28,12 +28,14 @@ namespace MetaClient
             }
         }
 
+        public ECustomStyple Type { get; set; }
         public int Part { get; set; }
         public Vector3 ChangeValue { get; set; }
 
-        public static CustomRoleBodyEventArgs Create(int part, Vector3 value)
+        public static CustomRoleBodyEventArgs Create(ECustomStyple type,int part, Vector3 value)
         {
             CustomRoleBodyEventArgs customRoleFaceEvent = ReferencePool.Acquire<CustomRoleBodyEventArgs>();
+            customRoleFaceEvent.Type = type;
             customRoleFaceEvent.Part = part;
             customRoleFaceEvent.ChangeValue = value;
             return customRoleFaceEvent;

+ 46 - 3
Assets/GameMain/Scripts/Game/CustomRole/CustomManager.cs

@@ -35,7 +35,7 @@ namespace MetaClient
             testPlayer = GameObject.Find("10").GetComponent<CustomRoleController>();
 
             bodyData = new RoleCustomData();
-            //初始化
+            //初始化身体部分
             IDataTable<DRCustomBody> drCB = GameEntry.DataTable.GetDataTable<DRCustomBody>();
             DRCustomBody[] dtCB = drCB.GetAllDataRows();
             for (int i = 0; i < dtCB.Length; i++)
@@ -55,6 +55,26 @@ namespace MetaClient
                     );
                 bodyData.bodyList.Add(dtCB[i].Id, partData);
             }
+            //初始化脸部分
+            IDataTable<DRCustomFace> drCF = GameEntry.DataTable.GetDataTable<DRCustomFace>();
+            DRCustomFace[] dtCF = drCF.GetAllDataRows();
+            for (int i = 0; i < dtCF.Length; i++)
+            {
+                var partData = new PartData(
+                    dtCF[i].Id,
+                    dtCF[i].BoneName.Split(','),
+                    dtCF[i].ScaleRangeMin,
+                    dtCF[i].ScaleRangeMax,
+                    dtCF[i].ScaleChange,
+                    dtCF[i].PositionChange,
+                    dtCF[i].RotationChange,
+                    dtCF[i].IsBlend,
+                    dtCF[i].BiggerBlendName,
+                    dtCF[i].SmallerBlendName,
+                    dtCF[i].DefaultBlendValue
+                    );
+                bodyData.faceList.Add(dtCF[i].Id, partData);
+            }
 
             bones.Clear();
             foreach (var item in bodyData.bodyList)
@@ -218,9 +238,32 @@ namespace MetaClient
             RefreshRoleBone();
         }
 
-        public float GetBodyBoneValue(int id)
+        public float GetBodyBoneValue(ECustomStyple styple,int id)
         {
-            var partData = bodyData.bodyList[id];
+            PartData partData = null;
+            switch (styple)
+            {
+                case ECustomStyple.None:
+                    break;
+                case ECustomStyple.NieLian:
+                    partData = bodyData.faceList[id];
+                    break;
+                case ECustomStyple.Body:
+                    partData = bodyData.bodyList[id];
+                    break;
+                case ECustomStyple.Cloth:
+                    break;
+                case ECustomStyple.Ornament:
+                    break;
+                default:
+                    break;
+            }
+
+            if(partData == null)
+            {
+                return 0;
+            }
+
             if(partData.useBlend)
             {
                 return partData.floatValue;

+ 2 - 2
Assets/GameMain/Scripts/UI/CustomRoleForm.cs

@@ -83,7 +83,7 @@ namespace MetaClient
         private void RefreshSliderValue()
         {
             curShow.text = selectData.Name;
-            curSlider.value = CustomManager.Instance.GetBodyBoneValue(selectData.Id);
+            curSlider.value = CustomManager.Instance.GetBodyBoneValue(ECustomStyple.Body,selectData.Id);
         }
 
         public void OnSliderValueChange(float value)
@@ -93,7 +93,7 @@ namespace MetaClient
                 return;
             }
             
-            GameEntry.Event.Fire(this, CustomRoleBodyEventArgs.Create(selectData.Id, new Vector3(value, 0, 0)));
+            GameEntry.Event.Fire(this, CustomRoleBodyEventArgs.Create(ECustomStyple.Body,selectData.Id, new Vector3(value, 0, 0)));
         }
 
         private void UpdateCustomBodyBoneTransShow()

+ 15 - 14
Assets/GameMain/Scripts/UI/UICustom.cs

@@ -282,19 +282,20 @@ namespace MetaClient
         public void ScrollValueChange()
         {
             //Debug.Log(scrollbar.value);
-            switch (eCustomStyple)
-            {
-                case ECustomStyple.None:
-                    break;
-                case ECustomStyple.Body:
-                    GameEntry.Event.Fire(this, CustomRoleBodyEventArgs.Create(part, new Vector3(scrollbar.value, 0, 0)));
-                    break;
-                case ECustomStyple.NieLian:
-                    break;
-                case ECustomStyple.Cloth:
-                    break;
-            }
-           // GameEntry.Event.Fire(this, CustomRoleBodyEventArgs.Create(part, new Vector3(scrollbar.value, 0, 0)));
+            //switch (eCustomStyple)
+            //{
+            //    case ECustomStyple.None:
+            //        break;
+            //    case ECustomStyple.Body:
+            //        GameEntry.Event.Fire(this, CustomRoleBodyEventArgs.Create(part, new Vector3(scrollbar.value, 0, 0)));
+            //        break;
+            //    case ECustomStyple.NieLian:
+            //        break;
+            //    case ECustomStyple.Cloth:
+            //        break;
+            //}
+            GameEntry.Event.Fire(this, CustomRoleBodyEventArgs.Create(eCustomStyple,part, new Vector3(scrollbar.value, 0, 0)));
+            // GameEntry.Event.Fire(this, CustomRoleBodyEventArgs.Create(part, new Vector3(scrollbar.value, 0, 0)));
         }
 
         public void BackBtn_Fun()
@@ -520,7 +521,7 @@ namespace MetaClient
 
             //scrollbar.value = _value;
             part = _part;
-            scrollbar.value = CustomManager.Instance.GetBodyBoneValue(part);
+            scrollbar.value = CustomManager.Instance.GetBodyBoneValue(eCustomStyple,part);
         }
         /// <summary>
         /// 获得滑块值

+ 0 - 1
Assets/GameMain/Scripts/UI/UICustomDrag.cs

@@ -15,7 +15,6 @@ namespace MetaClient
         public void OnDrag(PointerEventData eventData)
         {
             //CustomManager.Instance
-            Debug.Log(eventData.delta.x + "");
             CustomManager.Instance.RotateModel(eventData.delta.x);
         }
         public void OnBeginDrag(PointerEventData eventData)