void CmdShoot(uint netId, Quaternion rotation, int level) { if (level >= 1) { var go = (GameObject)Instantiate( stickPrefab, transform.position, Quaternion.identity); go.GetComponent <SpriteRenderer>().color = color; this.stick = go; Stick stick = go.GetComponent <Stick>(); NetworkServer.Spawn(go); RpcSetStick(go); stick.CmdRotate(rotation); stick.CmdSetPlayer(playerId); stick.CmdSetColor(color); } if (level >= 2) { FireBullet(Quaternion.Euler(rotation.eulerAngles + new Vector3(0, 0, 45f))); FireBullet(Quaternion.Euler(rotation.eulerAngles + new Vector3(0, 0, 135f))); } if (level >= 3) { FireBullet(Quaternion.Euler(rotation.eulerAngles + new Vector3(0, 0, 22.5f))); FireBullet(Quaternion.Euler(rotation.eulerAngles + new Vector3(0, 0, 112.5f))); } if (level >= 4) { FireBullet(Quaternion.Euler(rotation.eulerAngles + new Vector3(0, 0, 67.5f))); FireBullet(Quaternion.Euler(rotation.eulerAngles + new Vector3(0, 0, 157.5f))); } if (level >= 5) { FireBullet(Quaternion.Euler(rotation.eulerAngles + new Vector3(0, 0, 90f))); FireBullet(Quaternion.Euler(rotation.eulerAngles + new Vector3(0, 0, 180f))); } }