45 lines
1.1 KiB
C#
45 lines
1.1 KiB
C#
using UnityEngine;
|
|
|
|
namespace Watermelon.LevelSystem
|
|
{
|
|
public sealed class GateExitPointBehaviour : ExitPointBehaviour
|
|
{
|
|
private readonly int IDLE_HASH = Animator.StringToHash("Idle");
|
|
private readonly int OPEN_HASH = Animator.StringToHash("Open");
|
|
|
|
[SerializeField] Animator gatesAnimator;
|
|
|
|
public override void Init()
|
|
{
|
|
gatesAnimator.Play(IDLE_HASH);
|
|
}
|
|
|
|
public override void OnExitActivated()
|
|
{
|
|
isExitActivated = true;
|
|
|
|
gatesAnimator.Play(OPEN_HASH);
|
|
|
|
RingEffectController.SpawnEffect(transform.position.SetY(0.1f), 4.5f, 2, Ease.Type.Linear);
|
|
|
|
AudioController.PlaySound(AudioController.GetClip("complete"));
|
|
|
|
Tween.DelayedCall(0.15f, () =>
|
|
{
|
|
AudioController.PlaySound(AudioController.GetClip("door"));
|
|
});
|
|
}
|
|
|
|
public override void OnPlayerEnteredExit()
|
|
{
|
|
isExitActivated = false;
|
|
|
|
LevelController.OnPlayerExitLevel();
|
|
}
|
|
|
|
public override void Unload()
|
|
{
|
|
|
|
}
|
|
}
|
|
} |