2d0aaa98aa
- 重写 PageController.cs,为所有按钮回调添加完整 Debug.Log - 自动修复 _btnFixationBack:未赋值时自动查找 FixationPanel/BtnBack - 自动修复 _btnExperimentBack:未赋值时自动查找 ExperimentPanel/Navbar/BtnBack - 删除失效的 Canvas 根级冗余 BtnFixationBack - 添加 3D 角色模型资源(man/woman 模型、动画、TextMesh Pro) - 添加 ExperimentPanel UI 资源和 TrainingBackground 素材 测试方法:进入 Play 模式,查看 Console 以验证每个按钮的绑定状态和点击回调是否正常触发。
28 lines
726 B
C#
Executable File
28 lines
726 B
C#
Executable File
using UnityEngine;
|
|
using System;
|
|
|
|
|
|
namespace TMPro
|
|
{
|
|
/// <summary>
|
|
/// EXample of a Custom Character Input Validator to only allow digits from 0 to 9.
|
|
/// </summary>
|
|
[Serializable]
|
|
//[CreateAssetMenu(fileName = "InputValidator - Digits.asset", menuName = "TextMeshPro/Input Validators/Digits", order = 100)]
|
|
public class TMP_DigitValidator : TMP_InputValidator
|
|
{
|
|
// Custom text input validation function
|
|
public override char Validate(ref string text, ref int pos, char ch)
|
|
{
|
|
if (ch >= '0' && ch <= '9')
|
|
{
|
|
text += ch;
|
|
pos += 1;
|
|
return ch;
|
|
}
|
|
|
|
return (char)0;
|
|
}
|
|
}
|
|
}
|