Browse Source

1.换装修改

qianzhuqing 3 years ago
parent
commit
f054b26a2f

+ 1 - 1
Assets/GameMain/Configs/ResourceBuilder.xml

@@ -2,7 +2,7 @@
 <UnityGameFramework>
   <ResourceBuilder>
     <Settings>
-      <InternalResourceVersion>12</InternalResourceVersion>
+      <InternalResourceVersion>13</InternalResourceVersion>
       <Platforms>32</Platforms>
       <AssetBundleCompression>1</AssetBundleCompression>
       <CompressionHelperTypeName>UnityGameFramework.Runtime.DefaultCompressionHelper</CompressionHelperTypeName>

+ 1 - 0
Assets/GameMain/Configs/ResourceCollection.xml

@@ -106,6 +106,7 @@
       <Asset Guid="4061f826e79dced46a9da3495d013b3f" ResourceName="metasprite" />
       <Asset Guid="4473d81b14ddb0143addf0e6050d8491" ResourceName="Scenes" />
       <Asset Guid="44c8db52241385c45bbb14a1718f17bf" ResourceName="Configs" />
+      <Asset Guid="45785b616a61b2b4083e30cda015aaff" ResourceName="UI/UIForms" />
       <Asset Guid="45c7317dcfc513945bc819f5ef5b2c40" ResourceName="metasprite" />
       <Asset Guid="486c851f54245084da2aec558132136b" ResourceName="metasprite" />
       <Asset Guid="4a17d2c656f5c6b44a31e3ee547a76b0" ResourceName="DataTables" />

+ 1 - 1
Assets/GameMain/Model/8.controller

@@ -49,7 +49,7 @@ 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: 4321239445375086989}
+  m_DefaultState: {fileID: 4312635860885776039}
 --- !u!1102 &4312635860885776039
 AnimatorState:
   serializedVersion: 5

BIN
Assets/GameMain/Model/cloth/kuzi.FBX


+ 100 - 0
Assets/GameMain/Model/cloth/kuzi.FBX.meta

@@ -0,0 +1,100 @@
+fileFormatVersion: 2
+guid: 3bcd81d8d7efb934da678160cf4d43fa
+ModelImporter:
+  serializedVersion: 19301
+  internalIDToNameTable:
+  - first:
+      74: 1827226128182048838
+    second: Take 001
+  externalObjects: {}
+  materials:
+    materialImportMode: 1
+    materialName: 0
+    materialSearch: 1
+    materialLocation: 1
+  animations:
+    legacyGenerateAnimations: 4
+    bakeSimulation: 0
+    resampleCurves: 1
+    optimizeGameObjects: 0
+    motionNodeName: 
+    rigImportErrors: 
+    rigImportWarnings: 
+    animationImportErrors: 
+    animationImportWarnings: 
+    animationRetargetingWarnings: 
+    animationDoRetargetingWarnings: 0
+    importAnimatedCustomProperties: 0
+    importConstraints: 0
+    animationCompression: 3
+    animationRotationError: 0.5
+    animationPositionError: 0.5
+    animationScaleError: 0.5
+    animationWrapMode: 0
+    extraExposedTransformPaths: []
+    extraUserProperties: []
+    clipAnimations: []
+    isReadable: 0
+  meshes:
+    lODScreenPercentages: []
+    globalScale: 1
+    meshCompression: 0
+    addColliders: 0
+    useSRGBMaterialColor: 1
+    sortHierarchyByName: 1
+    importVisibility: 1
+    importBlendShapes: 1
+    importCameras: 1
+    importLights: 1
+    fileIdsGeneration: 2
+    swapUVChannels: 0
+    generateSecondaryUV: 0
+    useFileUnits: 1
+    keepQuads: 0
+    weldVertices: 1
+    preserveHierarchy: 0
+    skinWeightsMode: 0
+    maxBonesPerVertex: 4
+    minBoneWeight: 0.001
+    meshOptimizationFlags: -1
+    indexFormat: 0
+    secondaryUVAngleDistortion: 8
+    secondaryUVAreaDistortion: 15.000001
+    secondaryUVHardAngle: 88
+    secondaryUVPackMargin: 4
+    useFileScale: 1
+  tangentSpace:
+    normalSmoothAngle: 60
+    normalImportMode: 0
+    tangentImportMode: 3
+    normalCalculationMode: 4
+    legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
+    blendShapeNormalImportMode: 1
+    normalSmoothingSource: 0
+  referencedClips: []
+  importAnimation: 1
+  humanDescription:
+    serializedVersion: 3
+    human: []
+    skeleton: []
+    armTwist: 0.5
+    foreArmTwist: 0.5
+    upperLegTwist: 0.5
+    legTwist: 0.5
+    armStretch: 0.05
+    legStretch: 0.05
+    feetSpacing: 0
+    globalScale: 1
+    rootMotionBoneName: 
+    hasTranslationDoF: 0
+    hasExtraRoot: 1
+    skeletonHasParents: 1
+  lastHumanDescriptionAvatarSource: {instanceID: 0}
+  autoGenerateAvatarMappingIfUnspecified: 1
+  animationType: 3
+  humanoidOversampling: 1
+  avatarSetup: 1
+  additionalBone: 0
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/GameMain/Model/cloth/shangyi.FBX


+ 100 - 0
Assets/GameMain/Model/cloth/shangyi.FBX.meta

@@ -0,0 +1,100 @@
+fileFormatVersion: 2
+guid: f5c156e3ee3d24f429f69dba38dc9739
+ModelImporter:
+  serializedVersion: 19301
+  internalIDToNameTable:
+  - first:
+      74: 1827226128182048838
+    second: Take 001
+  externalObjects: {}
+  materials:
+    materialImportMode: 1
+    materialName: 0
+    materialSearch: 1
+    materialLocation: 1
+  animations:
+    legacyGenerateAnimations: 4
+    bakeSimulation: 0
+    resampleCurves: 1
+    optimizeGameObjects: 0
+    motionNodeName: 
+    rigImportErrors: 
+    rigImportWarnings: 
+    animationImportErrors: 
+    animationImportWarnings: 
+    animationRetargetingWarnings: 
+    animationDoRetargetingWarnings: 0
+    importAnimatedCustomProperties: 0
+    importConstraints: 0
+    animationCompression: 1
+    animationRotationError: 0.5
+    animationPositionError: 0.5
+    animationScaleError: 0.5
+    animationWrapMode: 0
+    extraExposedTransformPaths: []
+    extraUserProperties: []
+    clipAnimations: []
+    isReadable: 0
+  meshes:
+    lODScreenPercentages: []
+    globalScale: 1
+    meshCompression: 0
+    addColliders: 0
+    useSRGBMaterialColor: 1
+    sortHierarchyByName: 1
+    importVisibility: 1
+    importBlendShapes: 1
+    importCameras: 1
+    importLights: 1
+    fileIdsGeneration: 2
+    swapUVChannels: 0
+    generateSecondaryUV: 0
+    useFileUnits: 1
+    keepQuads: 0
+    weldVertices: 1
+    preserveHierarchy: 0
+    skinWeightsMode: 0
+    maxBonesPerVertex: 4
+    minBoneWeight: 0.001
+    meshOptimizationFlags: -1
+    indexFormat: 0
+    secondaryUVAngleDistortion: 8
+    secondaryUVAreaDistortion: 15.000001
+    secondaryUVHardAngle: 88
+    secondaryUVPackMargin: 4
+    useFileScale: 1
+  tangentSpace:
+    normalSmoothAngle: 60
+    normalImportMode: 0
+    tangentImportMode: 3
+    normalCalculationMode: 4
+    legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
+    blendShapeNormalImportMode: 1
+    normalSmoothingSource: 0
+  referencedClips: []
+  importAnimation: 1
+  humanDescription:
+    serializedVersion: 3
+    human: []
+    skeleton: []
+    armTwist: 0.5
+    foreArmTwist: 0.5
+    upperLegTwist: 0.5
+    legTwist: 0.5
+    armStretch: 0.05
+    legStretch: 0.05
+    feetSpacing: 0
+    globalScale: 1
+    rootMotionBoneName: 
+    hasTranslationDoF: 0
+    hasExtraRoot: 0
+    skeletonHasParents: 1
+  lastHumanDescriptionAvatarSource: {instanceID: 0}
+  autoGenerateAvatarMappingIfUnspecified: 1
+  animationType: 2
+  humanoidOversampling: 1
+  avatarSetup: 0
+  additionalBone: 0
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

File diff suppressed because it is too large
+ 1374 - 36
Assets/GameMain/Scenes/CustomRole.unity


+ 8 - 0
Assets/GameMain/Scripts/Editor/Inspector.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: aa772c62e305b624089552b9b814d481
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 19 - 0
Assets/GameMain/Scripts/Editor/Inspector/CombineSkinMeshEditor.cs

@@ -0,0 +1,19 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEditor;
+
+[CustomEditor(typeof(CombineSkinMesh))]
+public class CombineSkinMeshEditor : Editor
+{
+    public override void OnInspectorGUI()
+    {
+        base.OnInspectorGUI();
+
+        if (GUILayout.Button("合并网格"))
+        {
+            CombineSkinMesh combine = target as CombineSkinMesh;
+            combine.StartCombine();
+        }
+    }
+}

+ 11 - 0
Assets/GameMain/Scripts/Editor/Inspector/CombineSkinMeshEditor.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d110cb4a25f0eb24c94f228b0e770b4c
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 147 - 0
Assets/GameMain/Scripts/Utility/CombineSkinMesh.cs

@@ -0,0 +1,147 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.SceneManagement;
+
+public class CombineSkinMesh : MonoBehaviour
+{
+    public SkinnedMeshRenderer Body;
+    public SkinnedMeshRenderer Kuzi;
+    public SkinnedMeshRenderer Shangyi;
+
+    public SkinnedMeshRenderer[] Clothes;
+    
+    // Start is called before the first frame update
+    void Start()
+    {
+        //StartCombine();
+    }
+
+    // Update is called once per frame
+    void Update()
+    {
+        
+    }
+
+    public void StartCombine()
+    {
+        Debug.Log("Combine");
+        //SkinnedMeshRenderer[] meshes = new SkinnedMeshRenderer[] {  Shangyi };
+        CombineObject(Body.rootBone.gameObject, Clothes);
+    }
+
+    /// <summary>
+    /// Only for merge materials.
+    /// </summary>
+    private const int COMBINE_TEXTURE_MAX = 512;
+    private const string COMBINE_DIFFUSE_TEXTURE = "_MainTex";
+
+    /// <summary>
+    /// Combine SkinnedMeshRenderers together and share one skeleton.
+    /// Merge materials will reduce the drawcalls, but it will increase the size of memory. 
+    /// </summary>
+    /// <param name="skeleton">combine meshes to this skeleton(a gameobject)</param>
+    /// <param name="meshes">meshes need to be merged</param>
+    /// <param name="combine">merge materials or not</param>
+	public void CombineObject(GameObject skeleton, SkinnedMeshRenderer[] meshes, bool combine = false)
+    {
+
+        // 收集所有关于skeleton的骨骼
+        List<Transform> transforms = new List<Transform>();
+        transforms.AddRange(skeleton.GetComponentsInChildren<Transform>(true));
+
+        List<Material> materials = new List<Material>();//材质
+        List<CombineInstance> combineInstances = new List<CombineInstance>();//网格
+        List<Transform> bones = new List<Transform>();//骨骼
+
+        // 下面的信息只用来合并材质(bool combine = true)
+        List<Vector2[]> oldUV = null;
+        Material newMaterial = null;
+        Texture2D newDiffuseTex = null;
+
+        // 收集网格部分信息
+        for (int i = 0; i < meshes.Length; i++)
+        {
+            SkinnedMeshRenderer smr = meshes[i];
+            // 收集材质
+            materials.AddRange(smr.sharedMaterials);
+            // 收集网格
+            for (int sub = 0; sub < smr.sharedMesh.subMeshCount; sub++)
+            {
+                CombineInstance ci = new CombineInstance();
+                ci.mesh = smr.sharedMesh;
+                ci.subMeshIndex = sub;
+                combineInstances.Add(ci);
+            }
+            // 收集骨骼
+            for (int j = 0; j < smr.bones.Length; j++)
+            {
+                int tBase = 0;
+                for (tBase = 0; tBase < transforms.Count; tBase++)
+                {
+                    if (smr.bones[j].name.Equals(transforms[tBase].name))
+                    {
+                        bones.Add(transforms[tBase]);
+                        break;
+                    }
+                }
+            }
+        }
+
+        // 合并材质
+        if (combine)
+        {
+            newMaterial = new Material(Shader.Find("Mobile/Diffuse"));
+            oldUV = new List<Vector2[]>();
+            // 合并贴图
+            List<Texture2D> Textures = new List<Texture2D>();
+            for (int i = 0; i < materials.Count; i++)
+            {
+                Textures.Add(materials[i].GetTexture(COMBINE_DIFFUSE_TEXTURE) as Texture2D);
+            }
+
+            newDiffuseTex = new Texture2D(COMBINE_TEXTURE_MAX, COMBINE_TEXTURE_MAX, TextureFormat.RGBA32, true);
+            Rect[] uvs = newDiffuseTex.PackTextures(Textures.ToArray(), 0);
+            newMaterial.mainTexture = newDiffuseTex;
+
+            // 重置uv贴图
+            Vector2[] uva, uvb;
+            for (int j = 0; j < combineInstances.Count; j++)
+            {
+                uva = (Vector2[])(combineInstances[j].mesh.uv);
+                uvb = new Vector2[uva.Length];
+                for (int k = 0; k < uva.Length; k++)
+                {
+                    uvb[k] = new Vector2((uva[k].x * uvs[j].width) + uvs[j].x, (uva[k].y * uvs[j].height) + uvs[j].y);
+                }
+                oldUV.Add(combineInstances[j].mesh.uv);
+                combineInstances[j].mesh.uv = uvb;
+            }
+        }
+
+        // 创建新的SkinnedMeshRenderer
+        SkinnedMeshRenderer oldSKinned = skeleton.GetComponent<SkinnedMeshRenderer>();
+        if (oldSKinned != null)
+        {
+
+            GameObject.DestroyImmediate(oldSKinned);
+        }
+        SkinnedMeshRenderer r = skeleton.AddComponent<SkinnedMeshRenderer>();
+        r.sharedMesh = new Mesh();
+        r.sharedMesh.CombineMeshes(combineInstances.ToArray(), combine, false);// 合并网格
+        r.sharedMesh.name = "newMesh";
+        r.bones = bones.ToArray();// 使用新骨骼
+        if (combine)
+        {
+            r.material = newMaterial;
+            for (int i = 0; i < combineInstances.Count; i++)
+            {
+                combineInstances[i].mesh.uv = oldUV[i];
+            }
+        }
+        else
+        {
+            r.materials = materials.ToArray();
+        }
+    }
+}

+ 11 - 0
Assets/GameMain/Scripts/Utility/CombineSkinMesh.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9a0ac677a0b61c445b363ec11a51b6dd
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 1
Assets/Launcher.unity

@@ -657,7 +657,7 @@ PrefabInstance:
       objectReference: {fileID: 0}
     - target: {fileID: 11499388, guid: adb3eb1c35fcff14f89fba7b05c9d71c, type: 3}
       propertyPath: m_EditorResourceMode
-      value: 1
+      value: 0
       objectReference: {fileID: 0}
     - target: {fileID: 11499388, guid: adb3eb1c35fcff14f89fba7b05c9d71c, type: 3}
       propertyPath: m_JsonHelperTypeName

BIN
Assets/StreamingAssets/GameData.dat


BIN
Assets/StreamingAssets/GameFrameworkVersion.dat


BIN
Assets/StreamingAssets/Resources.dat


BIN
Assets/StreamingAssets/UI.dat


+ 13 - 0
ProjectSettings/BurstAotSettings_Android.json

@@ -0,0 +1,13 @@
+{
+  "MonoBehaviour": {
+    "Version": 3,
+    "EnableBurstCompilation": true,
+    "EnableOptimisations": true,
+    "EnableSafetyChecks": false,
+    "EnableDebugInAllBuilds": false,
+    "CpuMinTargetX32": 0,
+    "CpuMaxTargetX32": 0,
+    "CpuMinTargetX64": 0,
+    "CpuMaxTargetX64": 0
+  }
+}

+ 1 - 1
ProjectSettings/EditorBuildSettings.asset

@@ -11,7 +11,7 @@ EditorBuildSettings:
   - enabled: 0
     path: Assets/GameMain/Scenes/Menu.unity
     guid: b031b4f2980561542a7f7ba41391edc3
-  - enabled: 1
+  - enabled: 0
     path: Assets/GameMain/Scenes/CustomRole.unity
     guid: b474370e72ceec54ea3cb09d8765a548
   - enabled: 1

+ 75 - 0
ProjectSettings/Packages/com.unity.probuilder/Settings.json

@@ -32,6 +32,81 @@
                 "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
                 "key": "lightmapping.autoUnwrapLightmapUV",
                 "value": "{\"m_Value\":true}"
+            },
+            {
+                "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
+                "key": "editor.showEditorNotifications",
+                "value": "{\"m_Value\":false}"
+            },
+            {
+                "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
+                "key": "editor.showSceneInfo",
+                "value": "{\"m_Value\":false}"
+            },
+            {
+                "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
+                "key": "editor.stripProBuilderScriptsOnBuild",
+                "value": "{\"m_Value\":true}"
+            },
+            {
+                "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
+                "key": "editor.autoRecalculateCollisions",
+                "value": "{\"m_Value\":false}"
+            },
+            {
+                "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
+                "key": "mesh.meshColliderIsConvex",
+                "value": "{\"m_Value\":false}"
+            },
+            {
+                "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
+                "key": "mesh.newShapesSnapToGrid",
+                "value": "{\"m_Value\":true}"
+            },
+            {
+                "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
+                "key": "editor.toolbarIconGUI",
+                "value": "{\"m_Value\":false}"
+            },
+            {
+                "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
+                "key": "editor.closeWindowAfterShapeCreation",
+                "value": "{\"m_Value\":false}"
+            },
+            {
+                "type": "UnityEngine.ProBuilder.UnwrapParameters, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
+                "key": "lightmapping.defaultLightmapUnwrapParameters",
+                "value": "{\"m_Value\":{\"m_HardAngle\":88.0,\"m_PackMargin\":20.0,\"m_AngleError\":8.0,\"m_AreaError\":15.0}}"
+            },
+            {
+                "type": "System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
+                "key": "uv.uvEditorGridSnapIncrement",
+                "value": "{\"m_Value\":0.125}"
+            },
+            {
+                "type": "UnityEngine.Material, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
+                "key": "mesh.userMaterial",
+                "value": "{\"m_Value\":{\"instanceID\":0}}"
+            },
+            {
+                "type": "UnityEditor.StaticEditorFlags, UnityEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
+                "key": "mesh.defaultStaticEditorFlags",
+                "value": "{\"m_Value\":0}"
+            },
+            {
+                "type": "UnityEngine.ProBuilder.PivotLocation, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
+                "key": "mesh.newShapePivotLocation",
+                "value": "{\"m_Value\":1}"
+            },
+            {
+                "type": "UnityEngine.Rendering.ShadowCastingMode, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
+                "key": "mesh.shadowCastingMode",
+                "value": "{\"m_Value\":1}"
+            },
+            {
+                "type": "UnityEngine.ProBuilder.ColliderType, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
+                "key": "mesh.newShapeColliderType",
+                "value": "{\"m_Value\":2}"
             }
         ]
     }

+ 2 - 1
ProjectSettings/ProjectSettings.asset

@@ -738,7 +738,8 @@ PlayerSettings:
   gcIncremental: 0
   assemblyVersionValidation: 1
   gcWBarrierValidation: 0
-  apiCompatibilityLevelPerPlatform: {}
+  apiCompatibilityLevelPerPlatform:
+    Android: 3
   m_RenderingPath: 1
   m_MobileRenderingPath: 1
   metroPackageName: Template_3D