28 lines
746 B
C#
28 lines
746 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
namespace BlueWaterProject
|
|
{
|
|
public class TimeManager : Singleton<TimeManager>
|
|
{
|
|
/// <summary>
|
|
/// 히트스톱
|
|
/// </summary>
|
|
/// <param name="duration">시간</param>
|
|
public void TriggerHitStop(float duration)
|
|
{
|
|
StartCoroutine(HitStopCoroutine(duration));
|
|
}
|
|
|
|
private IEnumerator HitStopCoroutine(float duration)
|
|
{
|
|
var originalTimeScale = Time.timeScale;
|
|
Time.timeScale = 0.05f;
|
|
yield return new WaitForSecondsRealtime(duration);
|
|
Time.timeScale = originalTimeScale;
|
|
}
|
|
}
|
|
}
|