diff --git a/Assets/Scripts/Interaction/TouchPositionHandler.cs b/Assets/Scripts/Interaction/TouchPositionHandler.cs index 17b2ec1..2181811 100644 --- a/Assets/Scripts/Interaction/TouchPositionHandler.cs +++ b/Assets/Scripts/Interaction/TouchPositionHandler.cs @@ -8,9 +8,45 @@ public class TouchPositionHandler : MonoBehaviour { public Transform targetPosition; public GameObject womanObject; + public GameObject nextTouchObject; + + private void Start() + { + CreateBlueOutline(); + } + + private void CreateBlueOutline() + { + // 用 LineRenderer 画一个水平圆环描边 + var ringGo = new GameObject("BlueRing"); + ringGo.transform.SetParent(transform, false); + ringGo.transform.localPosition = Vector3.zero; + ringGo.transform.localRotation = Quaternion.Euler(90f, 0, 0); // XZ 平面 + + var lr = ringGo.AddComponent(); + lr.useWorldSpace = false; + lr.loop = true; + lr.startWidth = 0.02f; + lr.endWidth = 0.02f; + lr.material = new Material(Shader.Find("Sprites/Default")); + lr.startColor = Color.blue; + lr.endColor = Color.blue; + + float r = 0.12f; + int segs = 32; + lr.positionCount = segs; + for (int i = 0; i < segs; i++) + { + float a = i * 2f * Mathf.PI / segs; + lr.SetPosition(i, new Vector3(Mathf.Cos(a) * r, Mathf.Sin(a) * r, 0)); + } + Debug.Log($"[TouchPosition] {name}: 蓝描边已创建"); + } private void OnMouseDown() { + Debug.Log($"[TouchPosition] {name}: 被点击"); + if (womanObject != null && targetPosition != null) { womanObject.transform.position = targetPosition.position; @@ -21,5 +57,17 @@ public class TouchPositionHandler : MonoBehaviour { Debug.LogWarning($"[TouchPosition] {name}: womanObject 或 targetPosition 为空"); } + + // 顺序显示:隐藏自己,显示下一个 + gameObject.SetActive(false); + if (nextTouchObject != null) + { + nextTouchObject.SetActive(true); + Debug.Log($"[TouchPosition] {name} 已隐藏 -> {nextTouchObject.name} 已显示"); + } + else + { + Debug.Log($"[TouchPosition] {name} 已隐藏,无下一个"); + } } }