From f1515ea976e20f74c419e923d70667ae1d4b2ccf Mon Sep 17 00:00:00 2001 From: bottlefish <781230111@qq.com> Date: Wed, 11 Sep 2024 00:29:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E8=BF=9B=E5=87=BA=E7=BB=B4=E4=BF=AE=E5=AE=A4=E7=9A=84?= =?UTF-8?q?=E8=A1=A8=E7=8E=B0=E6=8C=87=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scripts/Dialog System/DialogController.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Assets/Scripts/Dialog System/DialogController.cs b/Assets/Scripts/Dialog System/DialogController.cs index fb8d2e19c..3e4911816 100644 --- a/Assets/Scripts/Dialog System/DialogController.cs +++ b/Assets/Scripts/Dialog System/DialogController.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; using Yarn.Unity; +using DG.Tweening; namespace AibisDream { @@ -251,6 +252,33 @@ namespace AibisDream { return MainUIController.Instance.HideObj(); } + [YarnCommand("move_to_fix")] + public static IEnumerator Move_to_fix() + { + bool isCompleted = false; + Sequence s = DOTween.Sequence(); + s.Append(Camera.main.transform.DOMove(new UnityEngine.Vector3(6.8f, 0, -10), 1.5f).SetEase(Ease.OutCubic)) + .OnComplete(() => + { + // 动画完成后的反馈操作 + Debug.Log("Move_to_fix sequence completed."); + isCompleted = true; + }); + + // 等待动画完成 + yield return new WaitUntil(() => isCompleted); + + // 动画完成后的其他操作 + Debug.Log("Continuing after Move_to_fix sequence."); + } + [YarnCommand("move_out_fix")] + public static void Move_out_fix() + { + Camera.main.transform.position=new UnityEngine.Vector3(6.8f, 0, -10); + Sequence s = DOTween.Sequence(); + //s.AppendInterval(0.5f); + s.Append(Camera.main.transform.DOMove(new UnityEngine.Vector3(0, 0, -10), 1.5f).SetEase(Ease.OutCubic)); + } #endregion } From 01bf709b8e7c257a8866fd4c56125a8253cb9c89 Mon Sep 17 00:00:00 2001 From: bottlefish <781230111@qq.com> Date: Wed, 11 Sep 2024 00:34:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=89=AA=E5=88=80?= =?UTF-8?q?=E7=9A=84=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Prototype/佩佩/佩佩视觉模块.unity | 8 ++++++++ Assets/Scripts/FixSystem/Line/CustomCursor.cs | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Assets/Prototype/佩佩/佩佩视觉模块.unity b/Assets/Prototype/佩佩/佩佩视觉模块.unity index 48ab13e1c..d736acb4a 100644 --- a/Assets/Prototype/佩佩/佩佩视觉模块.unity +++ b/Assets/Prototype/佩佩/佩佩视觉模块.unity @@ -24343,6 +24343,14 @@ PrefabInstance: propertyPath: rotationCorrection.z value: -180 objectReference: {fileID: 0} + - target: {fileID: 4414950781642350908, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} + propertyPath: transformCorrection.x + value: 0.2 + objectReference: {fileID: 0} + - target: {fileID: 4414950781642350908, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} + propertyPath: transformCorrection.y + value: -0.15 + objectReference: {fileID: 0} - target: {fileID: 4991240399770923164, guid: 1afc7e4d2be0126438b5fe65aaccc901, type: 3} propertyPath: m_LocalScale.x value: 0.093240894 diff --git a/Assets/Scripts/FixSystem/Line/CustomCursor.cs b/Assets/Scripts/FixSystem/Line/CustomCursor.cs index d326a040e..1c4467593 100644 --- a/Assets/Scripts/FixSystem/Line/CustomCursor.cs +++ b/Assets/Scripts/FixSystem/Line/CustomCursor.cs @@ -7,6 +7,8 @@ public class CustomCursor : MonoBehaviour public Texture2D cursorTexture; public Vector3 rotationCorrection; // 旋转修正,你可以在 Inspector 中设置 + public Vector2 transformCorrection; + private void Start() { // 设置旋转修正 @@ -17,7 +19,7 @@ public class CustomCursor : MonoBehaviour { // 设置自定义光标的位置为鼠标的位置 Vector2 cursorPos = Camera.main.ScreenToWorldPoint(Input.mousePosition); - transform.position = cursorPos; + transform.position = cursorPos+transformCorrection; } private void OnEnable()