// Start is called before the first frame update void Start() { DotManager.instance.playerObj.Clear(); //人数分の回数まわす for (int i = 0; i < MultiPlayerManager.instance.totalPlayer; i++) { //プレイヤーの生成 var playerObj = Instantiate(playerPrefab, spownPos[i], Quaternion.identity); players.Add(playerObj); moveControllers.Add(playerObj.GetComponent <MoveController>()); playerObj.GetComponent <PlayerMove>().enabled = false; playerObj.transform.LookAt(new Vector3(0, 0, 0)); playerObj.name = "Player" + (i + 1); //ぷれいやーのenumをそれぞれに対応させる playerObj.GetComponent <Player>().own = PlayerEnum(i); //カメラのオブジェクトを探して参照させる //cameras[i].transform.parent = playerObj.transform; cameras[i].GetComponent <CameraMove>().Setting(playerObj); playerObj.GetComponent <PlayerMove>().cmr = cameras[i].GetComponentInChildren <Camera>(); DotManager.instance.playerObj.Add(playerObj); //GameObject.Find("P" + i + 1 + "DOTPON").GetComponent<ChangeDOTPON>().SetTexture(MultiPlayerManager.instance.P1Weapon); if (i >= 1) { kyokaisen[i / 2].gameObject.SetActive(true); } } //text.text = screenController.cameras[0].name + " + " + screenController.cameras[1].name + " + " + screenController.cameras[2].name + " + " + screenController.cameras[3].name; StartCoroutine(GameStartCoroutine()); screenController.CameraNumCheck(); SetStar(); }