Importing common methods
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace GameDevLibrary.Extensions
|
||||
{
|
||||
public static class FloatExtensions
|
||||
{
|
||||
public static float Round(this float value, int digits = 2)
|
||||
{
|
||||
return MathF.Round(value, digits);
|
||||
}
|
||||
|
||||
public static int RoundToInt(this float value)
|
||||
{
|
||||
return (int)value.Round(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user