2d0aaa98aa
- 重写 PageController.cs,为所有按钮回调添加完整 Debug.Log - 自动修复 _btnFixationBack:未赋值时自动查找 FixationPanel/BtnBack - 自动修复 _btnExperimentBack:未赋值时自动查找 ExperimentPanel/Navbar/BtnBack - 删除失效的 Canvas 根级冗余 BtnFixationBack - 添加 3D 角色模型资源(man/woman 模型、动画、TextMesh Pro) - 添加 ExperimentPanel UI 资源和 TrainingBackground 素材 测试方法:进入 Play 模式,查看 Console 以验证每个按钮的绑定状态和点击回调是否正常触发。
52 lines
1.3 KiB
C#
Executable File
52 lines
1.3 KiB
C#
Executable File
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
|
|
namespace TMPro.Examples
|
|
{
|
|
|
|
public class ShaderPropAnimator : MonoBehaviour
|
|
{
|
|
|
|
private Renderer m_Renderer;
|
|
private Material m_Material;
|
|
|
|
public AnimationCurve GlowCurve;
|
|
|
|
public float m_frame;
|
|
|
|
void Awake()
|
|
{
|
|
// Cache a reference to object's renderer
|
|
m_Renderer = GetComponent<Renderer>();
|
|
|
|
// Cache a reference to object's material and create an instance by doing so.
|
|
m_Material = m_Renderer.material;
|
|
}
|
|
|
|
void Start()
|
|
{
|
|
StartCoroutine(AnimateProperties());
|
|
}
|
|
|
|
IEnumerator AnimateProperties()
|
|
{
|
|
//float lightAngle;
|
|
float glowPower;
|
|
m_frame = Random.Range(0f, 1f);
|
|
|
|
while (true)
|
|
{
|
|
//lightAngle = (m_Material.GetFloat(ShaderPropertyIDs.ID_LightAngle) + Time.deltaTime) % 6.2831853f;
|
|
//m_Material.SetFloat(ShaderPropertyIDs.ID_LightAngle, lightAngle);
|
|
|
|
glowPower = GlowCurve.Evaluate(m_frame);
|
|
m_Material.SetFloat(ShaderUtilities.ID_GlowPower, glowPower);
|
|
|
|
m_frame += Time.deltaTime * Random.Range(0.2f, 0.3f);
|
|
yield return new WaitForEndOfFrame();
|
|
}
|
|
}
|
|
}
|
|
}
|