+ SingleRoll 로직 수정 (간헐적으로 무한루프에 빠져서 멈추는 경우가 있었는데, 지금도 있는지 계속 해봐야 암) + StunParticle Stop() + Clear()로 스턴이 끝나면 즉시 파티클 종료
44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
using BlueWater.Interfaces;
|
|
using BlueWater.Utility;
|
|
using Sirenix.OdinInspector;
|
|
using UnityEngine;
|
|
|
|
namespace BlueWater.Enemies.Bosses.SandMole
|
|
{
|
|
public class SandMoleStatus : MonoBehaviour, IStunnable
|
|
{
|
|
// Variables
|
|
#region Variables
|
|
|
|
// Stun
|
|
[Title("기절 효과")]
|
|
[SerializeField]
|
|
private ParticleSystem _stunParticle;
|
|
|
|
public bool IsStunned { get; private set; }
|
|
|
|
private Coroutine _stunCoolDownCoroutine;
|
|
|
|
#endregion
|
|
|
|
// Stun
|
|
public void Stun(float duration)
|
|
{
|
|
IsStunned = true;
|
|
if (_stunParticle)
|
|
{
|
|
_stunParticle.Play();
|
|
}
|
|
|
|
Utils.StartUniqueCoroutine(this, ref _stunCoolDownCoroutine, Utils.CoolDownCoroutine(duration, EndStun));
|
|
}
|
|
|
|
public void EndStun()
|
|
{
|
|
Utils.EndUniqueCoroutine(this, ref _stunCoolDownCoroutine);
|
|
_stunParticle.Stop();
|
|
_stunParticle.Clear();
|
|
IsStunned = false;
|
|
}
|
|
}
|
|
} |