using System; using System.Collections.Generic; using UnityEngine; public static class BoundsExtension { public static List GetCorners(this Bounds obj, bool includePosition = true) { List list = new List(); for (int i = -1; i <= 1; i += 2) { for (int j = -1; j <= 1; j += 2) { list.Add(((!includePosition) ? Vector3.zero : obj.center) + (obj.size / 2f).Times(new Vector3((float)i, (float)j))); } } return list; } }