From 962a366da5437b17cb05ff733019f2fd081faa05 Mon Sep 17 00:00:00 2001 From: CroakFang <1605296300@qq.com> Date: Mon, 7 Nov 2022 22:17:34 +0800 Subject: [PATCH] change character height --- Assets/Scenes/Version2.unity | 30 +++++++++++++++--------------- Assets/Scripts/UmaContainer.cs | 5 +++++ Assets/Scripts/UmaViewerBuilder.cs | 1 + 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/Assets/Scenes/Version2.unity b/Assets/Scenes/Version2.unity index 5253f39..9441f72 100644 --- a/Assets/Scenes/Version2.unity +++ b/Assets/Scenes/Version2.unity @@ -913,7 +913,7 @@ RectTransform: m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 20, y: 20} m_Pivot: {x: 0.5, y: 0.5} @@ -2022,10 +2022,10 @@ RectTransform: m_Father: {fileID: 774603562} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 40, y: -15} + m_SizeDelta: {x: 247.5, y: 30} m_Pivot: {x: 0, y: 0.5} --- !u!1 &137571846 GameObject: @@ -3353,9 +3353,9 @@ RectTransform: m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: -17, y: 0} m_Pivot: {x: 0, y: 1} --- !u!114 &232156942 MonoBehaviour: @@ -14203,7 +14203,7 @@ RectTransform: m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 20, y: 20} m_Pivot: {x: 0.5, y: 0.5} @@ -21322,9 +21322,9 @@ RectTransform: m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: -17, y: 0} m_Pivot: {x: 0, y: 1} --- !u!114 &1148283646 MonoBehaviour: @@ -31649,10 +31649,10 @@ RectTransform: m_Father: {fileID: 774603562} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 327.5, y: -15} + m_SizeDelta: {x: 247.5, y: 30} m_Pivot: {x: 0, y: 0.5} --- !u!114 &1771722158 MonoBehaviour: @@ -34480,7 +34480,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &1974252711 RectTransform: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/UmaContainer.cs b/Assets/Scripts/UmaContainer.cs index 38c5c16..61606b1 100644 --- a/Assets/Scripts/UmaContainer.cs +++ b/Assets/Scripts/UmaContainer.cs @@ -99,6 +99,11 @@ public class UmaContainer : MonoBehaviour } + public void SetHeight(int scale) + { + transform.Find("Position").localScale *= (scale / 160f);//WIP + } + public Transform[] MergeBone(SkinnedMeshRenderer from, List targetBones) { var rootbone = targetBones.FindLast(a => a.name.Equals(from.rootBone.name)); diff --git a/Assets/Scripts/UmaViewerBuilder.cs b/Assets/Scripts/UmaViewerBuilder.cs index cc94711..8380335 100644 --- a/Assets/Scripts/UmaViewerBuilder.cs +++ b/Assets/Scripts/UmaViewerBuilder.cs @@ -294,6 +294,7 @@ public class UmaViewerBuilder : MonoBehaviour CurrentUMAContainer.MergeModel(); + CurrentUMAContainer.SetHeight(Convert.ToInt32(CurrentUMAContainer.CharaData["scale"])); LoadAsset(UmaViewerMain.Instance.AbMotions.FirstOrDefault(a => a.Name.EndsWith($"anm_eve_chr{id}_00_idle01_loop"))); }