public override void Shoot() { BulletGroup bullet = Instantiate(bulletGroup, transform.position, transform.rotation); bullet.GetComponent <BulletGroup>().direction = Vector3.up; bullet.SetShooter(gameObject); }
public override void Shoot() { if (isPlayer) { playerPos = new Vector3(0, 0, 0); } BulletGroup bullet = Instantiate(bulletGroup, transform.position + playerPos, transform.rotation); if (isPlayer) { bullet.GetComponent <BulletGroup>().direction = new Vector3(-Mathf.Sin(transform.rotation.eulerAngles.z * Mathf.Deg2Rad), Mathf.Cos(transform.rotation.eulerAngles.z * Mathf.Deg2Rad), 0); } else { bullet.GetComponent <BulletGroup>().direction = playerPos; } bullet.SetShooter(gameObject); }