Cleaned up stuff ig
This commit is contained in:
@@ -23,18 +23,10 @@ namespace InterfaceOff
|
||||
{
|
||||
Rect rect = Instance.GameCanvas.pixelRect;
|
||||
|
||||
float x = Random.Range(rect.xMin, rect.xMax);
|
||||
float y = Random.Range(rect.yMin, rect.yMax);
|
||||
float x = Random.Range(rect.xMin + 150, rect.xMax - 150);
|
||||
float y = Random.Range(rect.yMin + 150, rect.yMax - 150);
|
||||
|
||||
return new Vector3(x, y, 0f);
|
||||
}
|
||||
|
||||
public static bool IsRectWithinCanvas(Rect rect)
|
||||
{
|
||||
Rect b = Instance.GameCanvas.pixelRect;
|
||||
Rect a = rect;
|
||||
|
||||
return b.xMin <= a.xMin && b.yMin <= a.yMin && b.xMax >= a.xMax && b.yMax >= a.yMax;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,6 @@ public static class ListExtensions
|
||||
public static T GetRandom<T>(this List<T> list)
|
||||
{
|
||||
int index = UnityEngine.Random.Range(0, list.Count);
|
||||
return list[1];
|
||||
return list[index];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user