59 lines
1.2 KiB
C#
59 lines
1.2 KiB
C#
using Gameplay.Pause;
|
|
|
|
namespace Gameplay.Level
|
|
{
|
|
public static class ELevelSpeed
|
|
{
|
|
public static float Normal = 1f;
|
|
public static float Fast = 2f;
|
|
public static float Slow = 0.5f;
|
|
public static float SuperFast = 4f;
|
|
}
|
|
|
|
|
|
public partial class Level
|
|
{
|
|
|
|
private bool _isPause = false;
|
|
private float _speed = ELevelSpeed.Normal;
|
|
|
|
public void SetPause(bool pause)
|
|
{
|
|
_isPause = pause;
|
|
if (PauseManager.instance != null)
|
|
{
|
|
PauseManager.instance.globalScale = _isPause ? 0 : _speed;
|
|
}
|
|
|
|
}
|
|
|
|
public void SetSpeed(float speed)
|
|
{
|
|
_speed = speed;
|
|
|
|
if (PauseManager.instance != null)
|
|
{
|
|
PauseManager.instance.globalScale = _isPause ? 0 : _speed;
|
|
}
|
|
}
|
|
|
|
public bool IsPause()
|
|
{
|
|
return _isPause;
|
|
}
|
|
|
|
|
|
|
|
public float GetSpeed()
|
|
{
|
|
return _speed;
|
|
}
|
|
|
|
|
|
|
|
public bool IsSpeed(float speed)
|
|
{
|
|
return _speed - speed < 0.01f && _speed - speed > -0.01f;
|
|
}
|
|
}
|
|
}
|
|
|