public void Init(int playerNum, Transform gun, float speed, Color color) { this.parentNum = playerNum; this.gunForward = -gun.forward; this.bulletSpeed = speed; //Rigidbody rigidbody = Instantiate(this.gameObject.GetComponent<Rigidbody>(), gun.transform.position, gun.transform.rotation) as Rigidbody; SetColor bulletColor = this.GetComponent <SetColor>(); bulletColor.ColorSet(color); }