2d0aaa98aa
- 重写 PageController.cs,为所有按钮回调添加完整 Debug.Log - 自动修复 _btnFixationBack:未赋值时自动查找 FixationPanel/BtnBack - 自动修复 _btnExperimentBack:未赋值时自动查找 ExperimentPanel/Navbar/BtnBack - 删除失效的 Canvas 根级冗余 BtnFixationBack - 添加 3D 角色模型资源(man/woman 模型、动画、TextMesh Pro) - 添加 ExperimentPanel UI 资源和 TrainingBackground 素材 测试方法:进入 Play 模式,查看 Console 以验证每个按钮的绑定状态和点击回调是否正常触发。
20 lines
507 B
C#
Executable File
20 lines
507 B
C#
Executable File
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class DropdownSample: MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private TextMeshProUGUI text = null;
|
|
|
|
[SerializeField]
|
|
private TMP_Dropdown dropdownWithoutPlaceholder = null;
|
|
|
|
[SerializeField]
|
|
private TMP_Dropdown dropdownWithPlaceholder = null;
|
|
|
|
public void OnButtonClick()
|
|
{
|
|
text.text = dropdownWithPlaceholder.value > -1 ? "Selected values:\n" + dropdownWithoutPlaceholder.value + " - " + dropdownWithPlaceholder.value : "Error: Please make a selection";
|
|
}
|
|
}
|