+ UiManager의 CombatUi, OceanUi 모두 분리 각각의 씬에서 CombatUiManager, OceanUiManager로 변경 + Ocean, OceanUi input action map 추가 및 변경 input action map, uiManager 변경에 따른 Player input 로직 변경 + CombatPlayer가 죽으면 GameOverUi 추가 + 재시작 기능 추가 + 인벤토리 Ui 수정 + 슬라임 보스 로직 및 애니메이션 수정
50 lines
1.5 KiB
C#
50 lines
1.5 KiB
C#
using UnityEngine;
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
namespace BlueWaterProject
|
|
{
|
|
public class CombatStatus : MonoBehaviour
|
|
{
|
|
[field: SerializeField] public bool IsStunned { get; private set; }
|
|
[field: SerializeField] public bool IsSlowedMoveSpeed { get; private set; }
|
|
[field: SerializeField] public float MoveSpeedCoefficient { get; private set; }
|
|
|
|
private Coroutine stunCoolDownCoroutine;
|
|
private Coroutine slowMoveSpeedCoolDownCoroutine;
|
|
|
|
public void Stun(float duration)
|
|
{
|
|
IsStunned = true;
|
|
|
|
if (stunCoolDownCoroutine != null)
|
|
{
|
|
StopCoroutine(stunCoolDownCoroutine);
|
|
}
|
|
stunCoolDownCoroutine = StartCoroutine(Utils.CoolDown(duration, EndStun));
|
|
}
|
|
|
|
private void EndStun()
|
|
{
|
|
IsStunned = false;
|
|
stunCoolDownCoroutine = null;
|
|
}
|
|
|
|
public void SlowMoveSpeed(float duration, float moveSpeedCoefficient)
|
|
{
|
|
IsSlowedMoveSpeed = true;
|
|
MoveSpeedCoefficient = moveSpeedCoefficient;
|
|
|
|
if (slowMoveSpeedCoolDownCoroutine != null)
|
|
{
|
|
StopCoroutine(slowMoveSpeedCoolDownCoroutine);
|
|
}
|
|
slowMoveSpeedCoolDownCoroutine = StartCoroutine(Utils.CoolDown(duration, EndSlowMoveSpeed));
|
|
}
|
|
|
|
private void EndSlowMoveSpeed()
|
|
{
|
|
IsSlowedMoveSpeed = false;
|
|
slowMoveSpeedCoolDownCoroutine = null;
|
|
}
|
|
}
|
|
} |