19 lines
712 B
C#
19 lines
712 B
C#
// Assets/Scripts/World/Puzzle/PuzzleDoor.cs
|
||
// 门型接收器——PuzzleReceiver 子类(Architecture 21_LiquidPuzzleModule §10)
|
||
using Animancer;
|
||
using UnityEngine;
|
||
|
||
namespace BaseGames.Puzzle
|
||
{
|
||
/// <summary>谜题门:激活时播放开门动画,停用时播放关门动画。</summary>
|
||
public class PuzzleDoor : PuzzleReceiver
|
||
{
|
||
[SerializeField] private AnimancerComponent _animancer;
|
||
[SerializeField] private AnimationClip _openClip;
|
||
[SerializeField] private AnimationClip _closeClip;
|
||
|
||
protected override void OnActivate() => _animancer?.Play(_openClip);
|
||
protected override void OnDeactivate() => _animancer?.Play(_closeClip);
|
||
}
|
||
}
|