10 lines
265 B
C#
10 lines
265 B
C#
using UnityEngine;
|
|
|
|
public static class IntExtensions
|
|
{
|
|
public static int MapRange(this int value, int min1, int max1, int min2, int max2)
|
|
{
|
|
return (int)Mathf.Round((float)(value - min1) / ((float)max1 - (float)min1) * (float)(max2 - min2) + (float)min2);
|
|
}
|
|
}
|