void ObjPlacement() { // 投げるオブジェクトの数を動的に確保して登録 _opos = _jsonAsset.GetObjPos(); throwObjects = new GameObject[throwObject.transform.childCount]; for (int i = 0; i < throwObjects.Length; i++) { throwObjects[i] = throwObject.transform.GetChild(i).gameObject; throwObjects[i].transform.localPosition = _opos.pos[i]; } // 同じくアイテムでも同じことをする itemBoxs = new GameObject[items.transform.childCount]; for (int i = 0; i < itemBoxs.Length; i++) { itemBoxs[i] = items.transform.GetChild(i).gameObject; itemBoxs[i].SetActive(false); } }