Cleaned up stuff ig

This commit is contained in:
Pasha Bibko
2026-01-13 13:41:49 +00:00
parent f6703c0908
commit 459d70bbbe
5 changed files with 174 additions and 174 deletions

View File

@@ -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;
}
}
}

View File

@@ -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];
}
}