You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
651 B
C#
27 lines
651 B
C#
|
|
using UnityEngine;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
public static class Base
|
|
{
|
|
public const float Threshold = 0.01f;
|
|
|
|
public static float ClampAngle(float lfAngle, float lfMin, float lfMax)
|
|
{
|
|
if (lfAngle < -360f) lfAngle += 360f;
|
|
if (lfAngle > 360f) lfAngle -= 360f;
|
|
return Mathf.Clamp(lfAngle, lfMin, lfMax);
|
|
}
|
|
}
|
|
|
|
public static class Tasks
|
|
{
|
|
public static async Task<bool> Delay(float delay, CancellationToken cancellationToken = default)
|
|
{
|
|
await Task.Delay((int)(delay * 1000f), cancellationToken);
|
|
return Application.isPlaying;
|
|
}//Delay() end
|
|
|
|
}//class end
|