Files
zeling_v2/Assets/Scripts/World/Puzzle/PuzzleDoor.cs
2026-05-12 15:34:08 +08:00

19 lines
712 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 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);
}
}