diff --git a/Assets/Scripts/UmaViewerBuilder.cs b/Assets/Scripts/UmaViewerBuilder.cs index c06ac82..e7ea0c1 100644 --- a/Assets/Scripts/UmaViewerBuilder.cs +++ b/Assets/Scripts/UmaViewerBuilder.cs @@ -318,8 +318,8 @@ public class UmaViewerBuilder : MonoBehaviour var p1 = CurrentUMAContainer.TearPrefab_1; var t = headBone.transform; CurrentUMAContainer.TearControllers.Add(new TearController(t, Instantiate(p0, t), Instantiate(p1, t), 0, 1)); - CurrentUMAContainer.TearControllers.Add(new TearController(t, Instantiate(p0, t), Instantiate(p1, t), 0, 0)); CurrentUMAContainer.TearControllers.Add(new TearController(t, Instantiate(p0, t), Instantiate(p1, t), 1, 1)); + CurrentUMAContainer.TearControllers.Add(new TearController(t, Instantiate(p0, t), Instantiate(p1, t), 0, 0)); CurrentUMAContainer.TearControllers.Add(new TearController(t, Instantiate(p0, t), Instantiate(p1, t), 1, 0)); } @@ -338,9 +338,10 @@ public class UmaViewerBuilder : MonoBehaviour emotionDriven.FaceDrivenKeyTarget = faceDriven; emotionDriven.FaceEmotionKey = UmaDatabaseController.Instance.FaceTypeData.ToList(); emotionDriven.Initialize(); - CurrentUMAContainer.HeadBone = (GameObject)CurrentUMAContainer.Body.GetComponent()._assetTable["head"]; } + CurrentUMAContainer.TearControllers.ForEach(a => a.SetDir(a.CurrentDir)); + CurrentUMAContainer.HeadBone = (GameObject)CurrentUMAContainer.Body.GetComponent()._assetTable["head"]; CurrentUMAContainer.EyeHeight = CurrentUMAContainer.Head.GetComponent()._assetTableValue["head_center_offset_y"]; CurrentUMAContainer.MergeModel(); CurrentUMAContainer.Initialize(); diff --git a/Assets/Scripts/umamusume/Gallop/TearController.cs b/Assets/Scripts/umamusume/Gallop/TearController.cs index 15d08fe..e15a928 100644 --- a/Assets/Scripts/umamusume/Gallop/TearController.cs +++ b/Assets/Scripts/umamusume/Gallop/TearController.cs @@ -39,6 +39,7 @@ public class TearController TearObject_0 = tearPrefab_0; AssetHolder0 = TearObject_0.GetComponent(); TearMaterial_0 = TearObject_0.GetComponentInChildren().material; + TearMaterial_0.SetFloat("_OffsetFactor", -100); Animator_0 = TearObject_0.GetComponent(); var clip = AssetHolder0._assetTable["default_animation"] as AnimationClip; var controller = new AnimatorOverrideController(Animator_0.runtimeAnimatorController); @@ -48,6 +49,7 @@ public class TearController TearObject_1 = tearPrefab_1; AssetHolder1 = TearObject_1.GetComponent(); TearMaterial_1 = TearObject_1.GetComponentInChildren().material; + TearMaterial_1.SetFloat("_OffsetFactor", -100); Animator_1 = TearObject_1.GetComponent(); clip = AssetHolder1._assetTable["default_animation"] as AnimationClip; controller = new AnimatorOverrideController(Animator_1.runtimeAnimatorController); @@ -68,15 +70,15 @@ public class TearController CurrentDir = dir; if (dir > 0)//RightEye { - TearObject_0.transform.position = AttachBone_3_R.position + AttachBone_3_R.forward * 0.004f; - TearObject_1.transform.position = AttachBone_2_R.position + AttachBone_2_R.forward * 0.004f; + TearObject_0.transform.position = AttachBone_3_R.position; + TearObject_1.transform.position = AttachBone_2_R.position; TearObject_0.transform.localScale = new Vector3(-1, 1, 1); TearObject_1.transform.localScale = new Vector3(-1, 1, 1); } else//LeftEye { - TearObject_0.transform.position = AttachBone_3_L.position + AttachBone_3_L.forward * 0.004f; - TearObject_1.transform.position = AttachBone_2_L.position + AttachBone_2_L.forward * 0.004f; + TearObject_0.transform.position = AttachBone_3_L.position; + TearObject_1.transform.position = AttachBone_2_L.position; TearObject_0.transform.localScale = new Vector3(1, 1, 1); TearObject_1.transform.localScale = new Vector3(1, 1, 1); }