+ SpineDamageableProps Idle이 반복하지 않는 현상 수정 + 플레이어 체력이 부족할 때, Vignette 효과 줄이고, 쉽게 수정할 수 있게 변경 + 보스 처치 후 일정시간 무적 효과 적용 + MiniSandMole 죽지 않는 버그 수정 + Bgm 3종 추가 및 BgmSo 수정
74 lines
2.0 KiB
C#
74 lines
2.0 KiB
C#
using BlueWater.Interfaces;
|
|
using BlueWater.Players;
|
|
using BlueWater.Utility;
|
|
using Sirenix.OdinInspector;
|
|
using UnityEngine;
|
|
|
|
namespace BlueWater.Enemies.Bosses.SandMole
|
|
{
|
|
public class SandMoleStatus : MonoBehaviour, IStunnable
|
|
{
|
|
// Variables
|
|
#region Variables
|
|
|
|
[SerializeField]
|
|
private SpineController _spineController;
|
|
|
|
// Stun
|
|
[Title("기절 효과")]
|
|
[SerializeField]
|
|
private ParticleSystem _stunParticle;
|
|
|
|
public bool IsStunEnabled { get; private set; } = true;
|
|
public bool IsStunned { get; private set; }
|
|
|
|
private Coroutine _stunCoolDownCoroutine;
|
|
|
|
#endregion
|
|
|
|
private void Awake()
|
|
{
|
|
InitializeComponents();
|
|
}
|
|
|
|
[Button("컴포넌트 초기화")]
|
|
private void InitializeComponents()
|
|
{
|
|
_spineController = GetComponent<SpineController>();
|
|
}
|
|
|
|
// Stun
|
|
public bool CanStun() => IsStunEnabled;
|
|
|
|
public void Stun(float duration)
|
|
{
|
|
if (!CanStun()) return;
|
|
|
|
_spineController.SetSkin(SandMoleSkin.Normal.ToString());
|
|
_spineController.PlayAnimation(SandMoleAnimation.Stun.ToString(), false);
|
|
IsStunned = true;
|
|
if (_stunParticle)
|
|
{
|
|
_stunParticle.Play();
|
|
}
|
|
|
|
Utils.StartUniqueCoroutine(this, ref _stunCoolDownCoroutine, Utils.CoolDownCoroutine(duration, EndStun));
|
|
}
|
|
|
|
public void EndStun()
|
|
{
|
|
_spineController.SetSkin(SandMoleSkin.Normal.ToString());
|
|
_spineController.PlayAnimation(SandMoleAnimation.Idle.ToString(), false);
|
|
|
|
Utils.EndUniqueCoroutine(this, ref _stunCoolDownCoroutine);
|
|
_stunParticle.Stop();
|
|
_stunParticle.Clear();
|
|
IsStunned = false;
|
|
}
|
|
|
|
public void StopAllCoroutine()
|
|
{
|
|
StopAllCoroutines();
|
|
}
|
|
}
|
|
} |