您的问题似乎不完整,您是想询问关于C语言编程的某个具体问题吗?比如C语言的语法、编程技巧、项目开发等。请提供更具体的信息,这样我才能给出更准确的回答。

摘要:public static int GetRandomRangeNoRe2(int x, int y, int[] array = null) { if (array == null) { return UnityEngine.Random
public static int GetRandomRangeNoRe2(int x, int y, int[] array = null) { if (array == null) { return UnityEngine.Random.Range(x, y); } else { List<int> list = new List<int>(); for (int i = x; i < y; i++) { list.Add(i); } List<int> aList = new List<int>(array); list.RemoveAll(m => m == aList.Find(n => n == m)); int z = UnityEngine.Random.Range(0, list.Count); return list[z]; } } 没啥技术含量,实际就是把要过滤的数也传进去。 然后在区间内,过滤掉对应的数,再随机一次。 这个只处理int型。