qianzhuqing 3 years ago
parent
commit
2d4674b2fe
27 changed files with 88991 additions and 117 deletions
  1. BIN
      Assets/GameMain/DataTables/CustomBody.bytes
  2. BIN
      Assets/GameMain/DataTables/CustomBody.txt
  3. 1 1
      Assets/GameMain/Meshes/Player/Torso.mat
  4. 27 27
      Assets/GameMain/Meshes/Player/baseani.controller
  5. 45392 0
      Assets/GameMain/Meshes/Player/walk 1.anim
  6. 8 0
      Assets/GameMain/Meshes/Player/walk 1.anim.meta
  7. 41875 0
      Assets/GameMain/Meshes/Player/walk.anim
  8. 8 0
      Assets/GameMain/Meshes/Player/walk.anim.meta
  9. BIN
      Assets/GameMain/Meshes/Player/标准女.FBX
  10. 1338 0
      Assets/GameMain/Meshes/Player/标准女.FBX.meta
  11. 208 0
      Assets/GameMain/Scenes/CustomRole.unity
  12. 1 1
      Assets/GameMain/Scripts/DataTable/DRAircraft.cs
  13. 1 1
      Assets/GameMain/Scripts/DataTable/DRArmor.cs
  14. 1 1
      Assets/GameMain/Scripts/DataTable/DRAsteroid.cs
  15. 56 1
      Assets/GameMain/Scripts/DataTable/DRCustomBody.cs
  16. 1 1
      Assets/GameMain/Scripts/DataTable/DREntity.cs
  17. 1 1
      Assets/GameMain/Scripts/DataTable/DRMusic.cs
  18. 1 1
      Assets/GameMain/Scripts/DataTable/DRScene.cs
  19. 1 1
      Assets/GameMain/Scripts/DataTable/DRSound.cs
  20. 1 1
      Assets/GameMain/Scripts/DataTable/DRThruster.cs
  21. 1 1
      Assets/GameMain/Scripts/DataTable/DRUIForm.cs
  22. 1 1
      Assets/GameMain/Scripts/DataTable/DRUISound.cs
  23. 1 1
      Assets/GameMain/Scripts/DataTable/DRWeapon.cs
  24. 37 3
      Assets/GameMain/Scripts/Game/CustomRole/CustomManager.cs
  25. 2 2
      Assets/GameMain/Scripts/Game/CustomRole/CustomRoleController.cs
  26. 26 70
      Assets/GameMain/Scripts/Utility/CustomRoleUtility.cs
  27. 2 2
      Assets/GameMain/UI/UIForms/CustomRoleForm.prefab

BIN
Assets/GameMain/DataTables/CustomBody.bytes


BIN
Assets/GameMain/DataTables/CustomBody.txt


+ 1 - 1
Assets/GameMain/Meshes/Player/Torso.mat

@@ -73,5 +73,5 @@ Material:
     - _UVSec: 0
     - _ZWrite: 1
     m_Colors:
-    - _Color: {r: 0, g: 0, b: 0, a: 1}
+    - _Color: {r: 0.2264151, g: 0.2264151, b: 0.2264151, a: 1}
     - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

+ 27 - 27
Assets/GameMain/Meshes/Player/baseani.controller

@@ -1,6 +1,28 @@
 %YAML 1.1
 %TAG !u! tag:unity3d.com,2011:
---- !u!1102 &-5244027479717722202
+--- !u!91 &9100000
+AnimatorController:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: baseani
+  serializedVersion: 5
+  m_AnimatorParameters: []
+  m_AnimatorLayers:
+  - serializedVersion: 5
+    m_Name: Base Layer
+    m_StateMachine: {fileID: 3767549705516674691}
+    m_Mask: {fileID: 0}
+    m_Motions: []
+    m_Behaviours: []
+    m_BlendingMode: 0
+    m_SyncedLayerIndex: -1
+    m_DefaultWeight: 0
+    m_IKPass: 0
+    m_SyncedLayerAffectsTiming: 0
+    m_Controller: {fileID: 9100000}
+--- !u!1102 &3585764400497714350
 AnimatorState:
   serializedVersion: 5
   m_ObjectHideFlags: 1
@@ -20,35 +42,13 @@ AnimatorState:
   m_MirrorParameterActive: 0
   m_CycleOffsetParameterActive: 0
   m_TimeParameterActive: 0
-  m_Motion: {fileID: -3419257869308726280, guid: 1af50795f5cfada4f88a13671ba266a1,
+  m_Motion: {fileID: -3419257869308726280, guid: 087ede0f360019a4cbae4000a58f6fb7,
     type: 3}
   m_Tag: 
   m_SpeedParameter: 
   m_MirrorParameter: 
   m_CycleOffsetParameter: 
   m_TimeParameter: 
---- !u!91 &9100000
-AnimatorController:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_Name: baseani
-  serializedVersion: 5
-  m_AnimatorParameters: []
-  m_AnimatorLayers:
-  - serializedVersion: 5
-    m_Name: Base Layer
-    m_StateMachine: {fileID: 3767549705516674691}
-    m_Mask: {fileID: 0}
-    m_Motions: []
-    m_Behaviours: []
-    m_BlendingMode: 0
-    m_SyncedLayerIndex: -1
-    m_DefaultWeight: 0
-    m_IKPass: 0
-    m_SyncedLayerAffectsTiming: 0
-    m_Controller: {fileID: 9100000}
 --- !u!1107 &3767549705516674691
 AnimatorStateMachine:
   serializedVersion: 5
@@ -59,8 +59,8 @@ AnimatorStateMachine:
   m_Name: Base Layer
   m_ChildStates:
   - serializedVersion: 1
-    m_State: {fileID: -5244027479717722202}
-    m_Position: {x: 136, y: 306, z: 0}
+    m_State: {fileID: 3585764400497714350}
+    m_Position: {x: 274, y: 378, z: 0}
   m_ChildStateMachines: []
   m_AnyStateTransitions: []
   m_EntryTransitions: []
@@ -70,4 +70,4 @@ AnimatorStateMachine:
   m_EntryPosition: {x: 50, y: 120, z: 0}
   m_ExitPosition: {x: 800, y: 120, z: 0}
   m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
-  m_DefaultState: {fileID: -5244027479717722202}
+  m_DefaultState: {fileID: 3585764400497714350}

File diff suppressed because it is too large
+ 45392 - 0
Assets/GameMain/Meshes/Player/walk 1.anim


+ 8 - 0
Assets/GameMain/Meshes/Player/walk 1.anim.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f2d3472e85b4f6e44abf832adc5c26af
+NativeFormatImporter:
+  externalObjects: {}
+  mainObjectFileID: 7400000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

File diff suppressed because it is too large
+ 41875 - 0
Assets/GameMain/Meshes/Player/walk.anim


+ 8 - 0
Assets/GameMain/Meshes/Player/walk.anim.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 9d0b445f4a96c9b4caf0e97c2352242b
+NativeFormatImporter:
+  externalObjects: {}
+  mainObjectFileID: 7400000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/GameMain/Meshes/Player/标准女.FBX


File diff suppressed because it is too large
+ 1338 - 0
Assets/GameMain/Meshes/Player/标准女.FBX.meta


+ 208 - 0
Assets/GameMain/Scenes/CustomRole.unity

@@ -754,12 +754,215 @@ Transform:
     type: 3}
   m_PrefabInstance: {fileID: 332438135}
   m_PrefabAsset: {fileID: 0}
+--- !u!1 &765798888 stripped
+GameObject:
+  m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 087ede0f360019a4cbae4000a58f6fb7,
+    type: 3}
+  m_PrefabInstance: {fileID: 894915655}
+  m_PrefabAsset: {fileID: 0}
+--- !u!114 &765798889
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 765798888}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 7c3559daf63a51d44965d9864233a269, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  Chest: []
+  UpperArmUp: []
+  UpperArmDown: []
+  UpperLegUp: []
+  UpperLegDown: []
+  LowerLegUp: []
+  LowerLegDown: []
+--- !u!95 &765798890
+Animator:
+  serializedVersion: 3
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 765798888}
+  m_Enabled: 1
+  m_Avatar: {fileID: 9000000, guid: 087ede0f360019a4cbae4000a58f6fb7, type: 3}
+  m_Controller: {fileID: 9100000, guid: c2825d2c1b851744691862abc76c2ecc, type: 2}
+  m_CullingMode: 0
+  m_UpdateMode: 0
+  m_ApplyRootMotion: 0
+  m_LinearVelocityBlending: 0
+  m_WarningMessage: 
+  m_HasTransformHierarchy: 1
+  m_AllowConstantClipSamplingOptimization: 1
+  m_KeepAnimatorControllerStateOnDisable: 0
 --- !u!4 &822812140 stripped
 Transform:
   m_CorrespondingSourceObject: {fileID: -3911755362409789297, guid: a83bf52c2391bc247be837a410a359b3,
     type: 3}
   m_PrefabInstance: {fileID: 332438135}
   m_PrefabAsset: {fileID: 0}
+--- !u!1001 &894915655
+PrefabInstance:
+  m_ObjectHideFlags: 0
+  serializedVersion: 2
+  m_Modification:
+    m_TransformParent: {fileID: 0}
+    m_Modifications:
+    - target: {fileID: -8679921383154817045, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_RootOrder
+      value: 7
+      objectReference: {fileID: 0}
+    - target: {fileID: -8679921383154817045, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_LocalPosition.x
+      value: -0.3
+      objectReference: {fileID: 0}
+    - target: {fileID: -8679921383154817045, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_LocalPosition.y
+      value: -1.3
+      objectReference: {fileID: 0}
+    - target: {fileID: -8679921383154817045, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_LocalPosition.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: -8679921383154817045, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_LocalRotation.w
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: -8679921383154817045, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_LocalRotation.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: -8679921383154817045, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_LocalRotation.y
+      value: 1
+      objectReference: {fileID: 0}
+    - target: {fileID: -8679921383154817045, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_LocalRotation.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: -8679921383154817045, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_LocalEulerAnglesHint.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: -8679921383154817045, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_LocalEulerAnglesHint.y
+      value: 180
+      objectReference: {fileID: 0}
+    - target: {fileID: -8679921383154817045, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_LocalEulerAnglesHint.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: -8320970944476345463, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_IsActive
+      value: 1
+      objectReference: {fileID: 0}
+    - target: {fileID: 919132149155446097, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_Name
+      value: "\u6807\u51C6\u5973"
+      objectReference: {fileID: 0}
+    - target: {fileID: 919132149155446097, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_IsActive
+      value: 1
+      objectReference: {fileID: 0}
+    - target: {fileID: 4721406824358839022, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_LocalScale.z
+      value: 1.35
+      objectReference: {fileID: 0}
+    - target: {fileID: 7483789912442921702, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_Materials.Array.data[0]
+      value: 
+      objectReference: {fileID: 2100000, guid: 159c8cbdb64bceb4783b8a9189c1ae47, type: 2}
+    - target: {fileID: 7483789912442921702, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_Materials.Array.data[1]
+      value: 
+      objectReference: {fileID: 2100000, guid: acc6163e8a63dfa4c88bd4597f2a223e, type: 2}
+    - target: {fileID: 7483789912442921702, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_Materials.Array.data[2]
+      value: 
+      objectReference: {fileID: 2100000, guid: 5e07c2dcefde2b44397def2ca5459b7c, type: 2}
+    - target: {fileID: 7483789912442921702, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_Materials.Array.data[3]
+      value: 
+      objectReference: {fileID: 2100000, guid: 0a0aedaa352d2984a80b1ff99de3119f, type: 2}
+    - target: {fileID: 7483789912442921702, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_Materials.Array.data[4]
+      value: 
+      objectReference: {fileID: 2100000, guid: 19338570021349846af7145776c27072, type: 2}
+    - target: {fileID: 7483789912442921702, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_Materials.Array.data[5]
+      value: 
+      objectReference: {fileID: 2100000, guid: 7138ef9eb40b6c641b341820d4e77eb2, type: 2}
+    - target: {fileID: 7483789912442921702, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_Materials.Array.data[6]
+      value: 
+      objectReference: {fileID: 2100000, guid: a6aa3a78a349560428b6b3435964f1ca, type: 2}
+    - target: {fileID: 7483789912442921702, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_Materials.Array.data[7]
+      value: 
+      objectReference: {fileID: 2100000, guid: 405f468f778e93b4f9cf83c1d32f3d45, type: 2}
+    - target: {fileID: 7483789912442921702, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_Materials.Array.data[8]
+      value: 
+      objectReference: {fileID: 2100000, guid: dbd0dd2d87cc73a42a4a01d103f5f984, type: 2}
+    - target: {fileID: 7483789912442921702, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_Materials.Array.data[9]
+      value: 
+      objectReference: {fileID: 2100000, guid: 05e5ae4d01b8966489142b6014287049, type: 2}
+    - target: {fileID: 7483789912442921702, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_Materials.Array.data[10]
+      value: 
+      objectReference: {fileID: 2100000, guid: 4eafe122dc7178f41b0233be303f242e, type: 2}
+    - target: {fileID: 7483789912442921702, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_Materials.Array.data[11]
+      value: 
+      objectReference: {fileID: 2100000, guid: f617db28b90bad148a74b4a3ab76b5fb, type: 2}
+    - target: {fileID: 7483789912442921702, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_Materials.Array.data[12]
+      value: 
+      objectReference: {fileID: 2100000, guid: 4dfe6694e670f3e409164e135ac6a6ee, type: 2}
+    - target: {fileID: 7483789912442921702, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_Materials.Array.data[13]
+      value: 
+      objectReference: {fileID: 2100000, guid: ec29de4adbcee6e41aa51e1ecf446e98, type: 2}
+    - target: {fileID: 7483789912442921702, guid: 087ede0f360019a4cbae4000a58f6fb7,
+        type: 3}
+      propertyPath: m_Materials.Array.data[14]
+      value: 
+      objectReference: {fileID: 2100000, guid: 04513c542aa764049959015bf044ce55, type: 2}
+    m_RemovedComponents: []
+  m_SourcePrefab: {fileID: 100100000, guid: 087ede0f360019a4cbae4000a58f6fb7, type: 3}
 --- !u!4 &938409878 stripped
 Transform:
   m_CorrespondingSourceObject: {fileID: 5928295957050342215, guid: a83bf52c2391bc247be837a410a359b3,
@@ -994,6 +1197,11 @@ PrefabInstance:
       propertyPath: m_Name
       value: biaozhunnv
       objectReference: {fileID: 0}
+    - target: {fileID: 919132149155446097, guid: 1af50795f5cfada4f88a13671ba266a1,
+        type: 3}
+      propertyPath: m_IsActive
+      value: 0
+      objectReference: {fileID: 0}
     - target: {fileID: 5866666021909216657, guid: 1af50795f5cfada4f88a13671ba266a1,
         type: 3}
       propertyPath: m_Controller

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

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

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

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

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

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

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

@@ -5,7 +5,7 @@
 // Feedback: mailto:ellan@gameframework.cn
 //------------------------------------------------------------
 // 此文件由工具自动生成,请勿直接修改。
-// 生成时间:2022-01-20 10:11:25.912
+// 生成时间:2022-01-20 20:43:45.778
 //------------------------------------------------------------
 
 using GameFramework;
@@ -162,6 +162,51 @@ namespace MetaClient
             private set;
         }
 
+        /// <summary>
+        /// 获取缩放修改。
+        /// </summary>
+        public Vector3 ScaleChange
+        {
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// 获取位置修改。
+        /// </summary>
+        public Vector3 PositionChange
+        {
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// 获取角度修改。
+        /// </summary>
+        public Vector3 RotationChange
+        {
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// 获取骨骼名称。
+        /// </summary>
+        public string BoneName
+        {
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// 获取对应的图片类别。
+        /// </summary>
+        public int ParentStyple
+        {
+            get;
+            private set;
+        }
+
         public override bool ParseDataRow(string dataRowString, object userData)
         {
             string[] columnStrings = dataRowString.Split(DataTableExtension.DataSplitSeparators);
@@ -187,6 +232,11 @@ namespace MetaClient
             ScaleRangeMin = float.Parse(columnStrings[index++]);
             ScaleRangeMax = float.Parse(columnStrings[index++]);
             ModifyType = int.Parse(columnStrings[index++]);
+            ScaleChange = DataTableExtension.ParseVector3(columnStrings[index++]);
+            PositionChange = DataTableExtension.ParseVector3(columnStrings[index++]);
+            RotationChange = DataTableExtension.ParseVector3(columnStrings[index++]);
+            BoneName = columnStrings[index++];
+            ParentStyple = int.Parse(columnStrings[index++]);
 
             GeneratePropertyArray();
             return true;
@@ -213,6 +263,11 @@ namespace MetaClient
                     ScaleRangeMin = binaryReader.ReadSingle();
                     ScaleRangeMax = binaryReader.ReadSingle();
                     ModifyType = binaryReader.Read7BitEncodedInt32();
+                    ScaleChange = binaryReader.ReadVector3();
+                    PositionChange = binaryReader.ReadVector3();
+                    RotationChange = binaryReader.ReadVector3();
+                    BoneName = binaryReader.ReadString();
+                    ParentStyple = binaryReader.Read7BitEncodedInt32();
                 }
             }
 

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@@ -25,7 +25,7 @@ namespace MetaClient
         {
             GameEntry.Event.Subscribe(CustomRoleBodyEventArgs.EventId, UpdateBody);
 
-            testPlayer = GameObject.Find("biaozhunnv").GetComponent<CustomRoleController>();
+            testPlayer = GameObject.Find("标准女").GetComponent<CustomRoleController>();
 
             bodyData = new RoleCustomData();
             //初始化
@@ -33,7 +33,7 @@ namespace MetaClient
             DRCustomBody[] dtCB = drCB.GetAllDataRows();
             for (int i = 0; i < dtCB.Length; i++)
             {
-                bodyData.bodyList.Add(i, new PartData(dtCB[i].Id,(EditableBodyPart)dtCB[i].Part, (ModifyType)dtCB[i].ModifyType));
+                bodyData.bodyList.Add(dtCB[i].Id, new PartData(dtCB[i].Id,(EditableBodyPart)dtCB[i].Part, (ModifyType)dtCB[i].ModifyType));
             }
 
             //初始缩放
@@ -61,10 +61,44 @@ namespace MetaClient
             CustomRoleBodyEventArgs crf = (CustomRoleBodyEventArgs)e;
             if (crf != null)
             {
+                //更新数据
+                IDataTable<DRCustomBody> drCB = GameEntry.DataTable.GetDataTable<DRCustomBody>();
+                var formData = drCB.GetDataRow(crf.Part);
+                if(formData == null)
+                {
+                    Debug.LogError(crf.Part + ":  表里不存在此行数据");
+                    return;
+                }
                 bodyData.bodyList[crf.Part].floatValue = 1 + (crf.ChangeValue.x - 0.5f) * valueFloating;
+
+                //通过更新的数据更新骨骼缩放
                 if (testPlayer != null)
                 {
-                    testPlayer.UpdateBoneScale((EditableBodyPart)crf.Part, bodyData.bodyList[crf.Part].floatValue);
+                    switch ((ModifyType)formData.ModifyType)
+                    {
+                        case ModifyType.Length:
+                            testPlayer.UpdateBoneScale((EditableBodyPart)formData.Part, new Vector3(0, 0, 1), formData.IsKeepChildrenScale, bodyData.bodyList[crf.Part].floatValue);
+                            break;
+                        case ModifyType.Width:
+                            testPlayer.UpdateBoneScale((EditableBodyPart)formData.Part, new Vector3(0, 1, 0), formData.IsKeepChildrenScale, bodyData.bodyList[crf.Part].floatValue);
+                            break;
+                        case ModifyType.Thick:
+                            testPlayer.UpdateBoneScale((EditableBodyPart)formData.Part, new Vector3(1, 0, 0), formData.IsKeepChildrenScale, bodyData.bodyList[crf.Part].floatValue);
+                            break;
+                        case ModifyType.LengthWidthThick:
+                            testPlayer.UpdateBoneScale((EditableBodyPart)formData.Part, new Vector3(1, 1, 1), formData.IsKeepChildrenScale, bodyData.bodyList[crf.Part].floatValue);
+                            break;
+                        case ModifyType.Angle:
+                            break;
+                        case ModifyType.UpDown:
+                            break;
+                        case ModifyType.LeftRight:
+                            break;
+                        case ModifyType.ForwardBehind:
+                            break;
+                        default:
+                            break;
+                    }
                 }
             }
         }

+ 2 - 2
Assets/GameMain/Scripts/Game/CustomRole/CustomRoleController.cs

@@ -37,9 +37,9 @@ public class CustomRoleController : MonoBehaviour
         transform.SetPositionY(y * 0.2f + transform.position.y * 0.8f);
     }
 
-    public void UpdateBoneScale(EditableBodyPart part,float value)
+    public void UpdateBoneScale(EditableBodyPart part,Vector3 scale,bool isKeep,float value)
     {
-        CustomRoleUtility.UpdateBoneScale(ani, part, value);
+        CustomRoleUtility.UpdateBoneScale(ani, part,scale, isKeep, value);
     }
 
     public List<Transform> GetBonesTrans()

+ 26 - 70
Assets/GameMain/Scripts/Utility/CustomRoleUtility.cs

@@ -66,86 +66,42 @@ public enum ModifyType
 
 public static class CustomRoleUtility
 {
-    public static void UpdateBoneScale(Animator ani,EditableBodyPart part,float value)
+    public static void UpdateBoneScale(Animator ani,EditableBodyPart part, Vector3 scale,bool keepChildWorldScale, float value)
     {
-        Transform transL = null;
-        Transform transR = null;
+        Transform[] transList = GetRelativeTransform(ani,part);
         Vector3 beforeScale = Vector3.one;
-        List<Transform> childList = new List<Transform>();
-        
-        bool keepChildWorldScale = false;
-        switch (part)
+
+        if(transList == null)
         {
-            case EditableBodyPart.UpperArm:
-                transL = ani.GetBoneTransform(HumanBodyBones.LeftUpperArm);
-                transR = ani.GetBoneTransform(HumanBodyBones.RightUpperArm);
-                break;
-            case EditableBodyPart.LowerArm:
-                transL = ani.GetBoneTransform(HumanBodyBones.LeftLowerArm);
-                transR = ani.GetBoneTransform(HumanBodyBones.RightLowerArm);
-                break;
-            case EditableBodyPart.Hand:
-                transL = ani.GetBoneTransform(HumanBodyBones.LeftHand);
-                transR = ani.GetBoneTransform(HumanBodyBones.RightHand);
-                break;
-            case EditableBodyPart.UpperLeg:
-                transL = ani.GetBoneTransform(HumanBodyBones.LeftUpperLeg);
-                transR = ani.GetBoneTransform(HumanBodyBones.RightUpperLeg);
-                keepChildWorldScale = true;
-                break;
-            case EditableBodyPart.LowerLeg:
-                transL = ani.GetBoneTransform(HumanBodyBones.LeftLowerLeg);
-                transR = ani.GetBoneTransform(HumanBodyBones.RightLowerLeg);
-                break;
-            case EditableBodyPart.Foot:
-                transL = ani.GetBoneTransform(HumanBodyBones.LeftFoot);
-                transR = ani.GetBoneTransform(HumanBodyBones.RightFoot);
-                break;
-            case EditableBodyPart.None:
-                break;
-            default:
-                break;
+            return;
         }
-
-        if(transL != null)
+        for (int i = 0; i < transList.Length; i++)
         {
-            beforeScale = transL.localScale;
-            var world_l = transL.lossyScale;
-            transL.SetLocalScaleX(transL.localScale.x * value / world_l.x);
-            transL.SetLocalScaleY(transL.localScale.y * value / world_l.y);
-            transL.SetLocalScaleZ(transL.localScale.z * value / world_l.z);
-
-            var lcount = transL.childCount;
-            for (int i = 0; i < lcount; i++)
+            var trans = transList[i];
+            if(trans == null)
             {
-                childList.Add(transL.GetChild(i));
+                continue;
             }
-        }
-        if(transR != null)
-        {
-            beforeScale = transR.localScale;
-            var world_r = transR.lossyScale;
-            transR.SetLocalScaleX(transR.localScale.x * value / world_r.x);
-            transR.SetLocalScaleY(transR.localScale.y * value / world_r.y);
-            transR.SetLocalScaleZ(transR.localScale.z * value / world_r.z);
+            beforeScale = trans.localScale;
+            var world_l = trans.lossyScale;
+            if (scale.x == 1) trans.SetLocalScaleX(trans.localScale.x * value / world_l.x);
+            if (scale.y == 1) trans.SetLocalScaleY(trans.localScale.y * value / world_l.y);
+            if (scale.z == 1) trans.SetLocalScaleZ(trans.localScale.z * value / world_l.z);
 
-            var rcount = transR.childCount;
-            for (int i = 0; i < rcount; i++)
+            //修改子物体的缩放
+            if (!keepChildWorldScale)
             {
-                childList.Add(transR.GetChild(i));
+                continue;
+            }
+            var lcount = trans.childCount;
+            for (int j = 0; j < lcount; j++)
+            {
+                var childTrans = trans.GetChild(j);
+                var oldScale = childTrans.localScale;
+                if (scale.x == 1) childTrans.SetLocalScaleX(oldScale.x * beforeScale.x / value);
+                if (scale.y == 1) childTrans.SetLocalScaleY(oldScale.y * beforeScale.y / value);
+                if (scale.z == 1) childTrans.SetLocalScaleZ(oldScale.z * beforeScale.z / value);
             }
-        }
-        if(!keepChildWorldScale)
-        {
-            return;
-        }
-        for (int i = 0; i < childList.Count; i++)
-        {
-            var childTrans = childList[i];
-            var oldScale = childTrans.localScale;
-            childTrans.SetLocalScaleX(oldScale.x * beforeScale.x / value);
-            childTrans.SetLocalScaleY(oldScale.y * beforeScale.y / value);
-            childTrans.SetLocalScaleZ(oldScale.z * beforeScale.z / value);
         }
     }
 

+ 2 - 2
Assets/GameMain/UI/UIForms/CustomRoleForm.prefab

@@ -1006,7 +1006,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0.5, y: 0.5}
   m_AnchorMax: {x: 0.5, y: 0.5}
-  m_AnchoredPosition: {x: 0, y: 489}
+  m_AnchoredPosition: {x: 0, y: 343}
   m_SizeDelta: {x: 200, y: 20}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!114 &6042361211319969144
@@ -1290,7 +1290,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0.5, y: 0.5}
   m_AnchorMax: {x: 0.5, y: 0.5}
-  m_AnchoredPosition: {x: 0, y: 557}
+  m_AnchoredPosition: {x: 0, y: 419}
   m_SizeDelta: {x: 300, y: 50}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &8201164518370244266