protected override void FireBulletNetwork(Vector3 muzzlePos, Vector3 bulletSpeed) { GameObject bullet = Instantiate(Bullet, muzzlePos, Quaternion.identity); BulletGeneral temp_bullet = bullet.GetComponent <BulletGeneral>(); temp_bullet.bulletInfo = EnemyWeapon; temp_bullet.s_Victim = s_tag; bullet.GetComponent <Rigidbody2D>().velocity = (Target.transform.position - muzzlePos).normalized * Util.F_SMG_BULLET_SPEED; }
protected override void FireBulletNetwork(Vector3 muzzlePos, Vector3 bulletSpeed) { if (cur_Weapon == Weapon1) { GameObject bullet = Instantiate(Main_Bullet, muzzlePos, Muzzle.transform.rotation); BulletGeneral temp_bullet = bullet.GetComponent <BulletGeneral>(); temp_bullet.bulletInfo = Weapon1; temp_bullet.s_Victim = s_tag; bullet.GetComponent <Rigidbody2D>().velocity = (muzzlePos - g_Weapon.transform.position).normalized * Weapon1.f_BulletSpeed; } }
protected override void FireBulletNetwork(Vector3 muzzlePos, Vector3 bulletSpeed) { if (cur_Weapon == Weapon1) { GameObject bullet = Instantiate(Main_Bullet, muzzlePos, Muzzle.transform.rotation); BulletGeneral temp_bullet = bullet.GetComponent <BulletGeneral>(); temp_bullet.bulletInfo = Weapon1; temp_bullet.s_Victim = s_tag; bullet.GetComponent <Rigidbody2D>().velocity = (muzzlePos - g_Weapon.transform.position).normalized * Weapon1.f_BulletSpeed; } if (cur_Weapon == Weapon2) { //b_IsLaserShoot = true; //StartCoroutine("LaserShootTime"); GameObject bullet = Instantiate(Sub_Bullet, muzzlePos, Muzzle.transform.rotation); BulletGeneral temp_bullet = bullet.GetComponentInChildren <BulletGeneral>(); temp_bullet.bulletInfo = Weapon2; temp_bullet.s_Victim = s_tag; //bullet.GetComponent<Rigidbody2D>().velocity = (muzzlePos - g_Weapon.transform.position).normalized; //StartCoroutine(DestroyLaser(bullet)); } }
protected void FireAll() { Vector3[] bulletDir = new Vector3[13]; bulletDir[0] = v_muzzle[0]; for (int i = 1; i <= 12; i++) { bulletDir[i] = (v_muzzle[i] - transform.position).normalized; } //총알 생성 GameObject bullet1 = Instantiate(Bullet, v_muzzle[1], muzzle1.transform.rotation); GameObject bullet2 = Instantiate(Bullet, v_muzzle[2], muzzle2.transform.rotation); GameObject bullet3 = Instantiate(Bullet, v_muzzle[3], muzzle3.transform.rotation); GameObject bullet4 = Instantiate(Bullet, v_muzzle[4], muzzle4.transform.rotation); GameObject bullet5 = Instantiate(Bullet, v_muzzle[5], muzzle5.transform.rotation); GameObject bullet6 = Instantiate(Bullet, v_muzzle[6], muzzle6.transform.rotation); GameObject bullet7 = Instantiate(Bullet, v_muzzle[7], muzzle7.transform.rotation); GameObject bullet8 = Instantiate(Bullet, v_muzzle[8], muzzle8.transform.rotation); GameObject bullet9 = Instantiate(Bullet, v_muzzle[9], muzzle9.transform.rotation); GameObject bullet10 = Instantiate(Bullet, v_muzzle[10], muzzle10.transform.rotation); GameObject bullet11 = Instantiate(Bullet, v_muzzle[11], muzzle11.transform.rotation); GameObject bullet12 = Instantiate(Bullet, v_muzzle[12], muzzle12.transform.rotation); //여기까지 BulletGeneral temp_bullet1 = bullet1.GetComponent <BulletGeneral>(); BulletGeneral temp_bullet2 = bullet2.GetComponent <BulletGeneral>(); BulletGeneral temp_bullet3 = bullet3.GetComponent <BulletGeneral>(); BulletGeneral temp_bullet4 = bullet4.GetComponent <BulletGeneral>(); BulletGeneral temp_bullet5 = bullet5.GetComponent <BulletGeneral>(); BulletGeneral temp_bullet6 = bullet6.GetComponent <BulletGeneral>(); BulletGeneral temp_bullet7 = bullet7.GetComponent <BulletGeneral>(); BulletGeneral temp_bullet8 = bullet8.GetComponent <BulletGeneral>(); BulletGeneral temp_bullet9 = bullet9.GetComponent <BulletGeneral>(); BulletGeneral temp_bullet10 = bullet10.GetComponent <BulletGeneral>(); BulletGeneral temp_bullet11 = bullet11.GetComponent <BulletGeneral>(); BulletGeneral temp_bullet12 = bullet12.GetComponent <BulletGeneral>(); temp_bullet1.bulletInfo = EnemyWeapon; temp_bullet2.bulletInfo = EnemyWeapon; temp_bullet3.bulletInfo = EnemyWeapon; temp_bullet4.bulletInfo = EnemyWeapon; temp_bullet5.bulletInfo = EnemyWeapon; temp_bullet6.bulletInfo = EnemyWeapon; temp_bullet7.bulletInfo = EnemyWeapon; temp_bullet8.bulletInfo = EnemyWeapon; temp_bullet9.bulletInfo = EnemyWeapon; temp_bullet10.bulletInfo = EnemyWeapon; temp_bullet11.bulletInfo = EnemyWeapon; temp_bullet12.bulletInfo = EnemyWeapon; temp_bullet1.s_Victim = s_tag; temp_bullet2.s_Victim = s_tag; temp_bullet3.s_Victim = s_tag; temp_bullet4.s_Victim = s_tag; temp_bullet5.s_Victim = s_tag; temp_bullet6.s_Victim = s_tag; temp_bullet7.s_Victim = s_tag; temp_bullet8.s_Victim = s_tag; temp_bullet9.s_Victim = s_tag; temp_bullet10.s_Victim = s_tag; temp_bullet11.s_Victim = s_tag; temp_bullet12.s_Victim = s_tag; bullet1.GetComponent <Rigidbody2D>().velocity = bulletDir[1].normalized * EnemyWeapon.f_BulletSpeed; bullet2.GetComponent <Rigidbody2D>().velocity = bulletDir[2].normalized * EnemyWeapon.f_BulletSpeed; bullet3.GetComponent <Rigidbody2D>().velocity = bulletDir[3].normalized * EnemyWeapon.f_BulletSpeed; bullet4.GetComponent <Rigidbody2D>().velocity = bulletDir[4].normalized * EnemyWeapon.f_BulletSpeed; bullet5.GetComponent <Rigidbody2D>().velocity = bulletDir[5].normalized * EnemyWeapon.f_BulletSpeed; bullet6.GetComponent <Rigidbody2D>().velocity = bulletDir[6].normalized * EnemyWeapon.f_BulletSpeed; bullet7.GetComponent <Rigidbody2D>().velocity = bulletDir[7].normalized * EnemyWeapon.f_BulletSpeed; bullet8.GetComponent <Rigidbody2D>().velocity = bulletDir[8].normalized * EnemyWeapon.f_BulletSpeed; bullet9.GetComponent <Rigidbody2D>().velocity = bulletDir[9].normalized * EnemyWeapon.f_BulletSpeed; bullet10.GetComponent <Rigidbody2D>().velocity = bulletDir[10].normalized * EnemyWeapon.f_BulletSpeed; bullet11.GetComponent <Rigidbody2D>().velocity = bulletDir[11].normalized * EnemyWeapon.f_BulletSpeed; bullet12.GetComponent <Rigidbody2D>().velocity = bulletDir[12].normalized * EnemyWeapon.f_BulletSpeed; }