using System.Collections; using System.Collections.Generic; using UnityEngine; namespace ShotSimulator.Tool { public static class ExtensionMethod { public static Vector3Int ToVector3Int(this Vector3 value) { return new Vector3Int((int)value.x, (int)value.y, (int)value.z); } public static List GetGameObjectWorldPosition(this List objs) where T : MonoBehaviour { List positions = new List(); for (int i = 0; i < objs.Count; i++) { positions.Add(objs[i].transform.position); } return positions; } public static void FisherYatesShuffle(this IList list) { int listCount = list.Count; while (listCount > 1) { listCount--; int randomIndex = Random.Range(0, listCount); T value = list[randomIndex]; list[randomIndex] = list[listCount]; list[listCount] = value; } } } }