MENU 示例一示例二sortsplicepushrandomfloorMathwhile演示 示例一
let reorganize function (arr){let rest [];while (arr.length > 0) {let random Math.floor(Math.random() * arr.length);// 把获取到的值放到新定义的数组中rest.push(arr[random]);// 这句代码的作…
在设置子物体的父物体时,我们使用SetParent再常见不过了。
但是通常我们只是使用其中一个语法:
public void SetParent(Transform parent);使用改方法子对象会保持原来位置,跟使用以下方法效果一样:
public Transform tran;
ga…