Add point2 as the first step, trigger IsCheck, and enable Shose afterward
This commit is contained in:
@@ -420,14 +420,21 @@ public class PageController : MonoBehaviour
|
||||
}
|
||||
// ------------------------------
|
||||
|
||||
// 实验刚开始,立刻激活鞋子,不等语音播完
|
||||
// 实验刚开始,立刻激活point2,不等语音播完
|
||||
var shose = GameObject.Find("Shose");
|
||||
if (shose == null)
|
||||
{
|
||||
// 如果被禁用了,找它的最顶层引用
|
||||
var allTransforms = Resources.FindObjectsOfTypeAll<Transform>();
|
||||
foreach(var t in allTransforms) { if (t.parent == null && t.name == "Shose") { shose = t.gameObject; break; } }
|
||||
}
|
||||
|
||||
var point2 = GameObject.Find("point2");
|
||||
if (point2 == null)
|
||||
{
|
||||
var allTransforms = Resources.FindObjectsOfTypeAll<Transform>();
|
||||
foreach(var t in allTransforms) { if (t.name == "point2") { point2 = t.gameObject; break; } }
|
||||
}
|
||||
|
||||
if (shose != null)
|
||||
{
|
||||
var h = shose.GetComponent<ShoseClickHandler>();
|
||||
@@ -443,8 +450,20 @@ public class PageController : MonoBehaviour
|
||||
}
|
||||
h.nextObject = chanraotuibu;
|
||||
}
|
||||
shose.SetActive(true);
|
||||
Debug.Log("PageController: 开场动画结束,Shose 已立刻激活");
|
||||
shose.SetActive(false); // 确保一开始隐藏
|
||||
}
|
||||
|
||||
if (point2 != null)
|
||||
{
|
||||
var oldHandler = point2.GetComponent<TouchPositionHandler>();
|
||||
if (oldHandler != null) Destroy(oldHandler);
|
||||
|
||||
var h2 = point2.GetComponent<Point2ClickHandler>();
|
||||
if (h2 == null) h2 = point2.AddComponent<Point2ClickHandler>();
|
||||
if (h2.nextObject == null) h2.nextObject = shose;
|
||||
|
||||
point2.SetActive(true);
|
||||
Debug.Log("PageController: 开场动画结束,point2 已立刻激活");
|
||||
}
|
||||
|
||||
// 1. 强制播放第一句语音:“周围环境安全,我是救护志愿者,我可以帮助您吗”
|
||||
|
||||
Reference in New Issue
Block a user