feat: woman移动交互 + medicalBox显示 + ReturnToHome场景重置
- TouchPositionHandler: 点击touchArray球体→woman移动到womanPointArray对应位置 - medicalBox: 初始隐藏,实验开始后显示 - ReturnToHome: 重置场景(恢复man/man2, 隐藏woman/manInjury/medicalBox, 切回主摄像机, 重置Animator) - ActivateExperimentObjects(): 实验启动时激活实验物件
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 挂在 touchArray 的每个子球体上,点击时把 woman 移动到 womanPointArray 对应位置。
|
||||
/// 字段用 public 方便代码直接赋值。
|
||||
/// </summary>
|
||||
public class TouchPositionHandler : MonoBehaviour
|
||||
{
|
||||
public Transform targetPosition;
|
||||
public GameObject womanObject;
|
||||
|
||||
private void OnMouseDown()
|
||||
{
|
||||
if (womanObject != null && targetPosition != null)
|
||||
{
|
||||
womanObject.transform.position = targetPosition.position;
|
||||
womanObject.transform.rotation = targetPosition.rotation;
|
||||
Debug.Log($"[TouchPosition] woman 移动到 {targetPosition.name} ({targetPosition.position})");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[TouchPosition] {name}: womanObject 或 targetPosition 为空");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aa18d349de8cc4564984a4f44c712138
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user