18 lines
886 B
C#
18 lines
886 B
C#
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// 战神激光 loop 状态通知(Animator 状态机行为)。
|
|
/// 用法:打开战神的 Animator Controller → 选中激光循环(loop)状态 → Inspector 底部
|
|
/// Add Behaviour → ZhanShenLaserLoopSMB。状态进入(=准备动画播完、loop 开始)时
|
|
/// 自动通知座位显示激光及全部特效(提前结束 laserFXDelay 等待)。
|
|
/// 无需改动画剪辑、不要求 Animator 挂在特定物体上(向上找 TurretData)。
|
|
/// </summary>
|
|
public class ZhanShenLaserLoopSMB : StateMachineBehaviour
|
|
{
|
|
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
|
|
{
|
|
// 战神实例上的 TurretData(向上查找,Animator 挂根/子物体都能找到)→ 通知座位
|
|
animator.GetComponentInParent<TurretData>()?.NotifyZhanShenLaserLoopAnim();
|
|
}
|
|
}
|