//爆弾 public void spawnBomb() { WPbullet b = Instantiate(bomb, hand.position, hand.rotation); Vector3 dir; dir = transform.forward * 50; b.gameObject.GetComponent <Rigidbody>().AddForce(dir * 50); }
public void INITIALIZING(B_Player play) { p = play; p.BULLETSPAWNER = this; direction = transform.forward; bulletSpawning = shoot; currentBullet = weaponBullet; }
void specialShot() { WPbullet newBullet = Instantiate(currentBullet, spawnPoint.position, spawnPoint.transform.rotation); newBullet.passDirection(direction); Ammo--; if (Ammo <= 0) { changeBullet(ammonation); } }
//バレットの種類によって打つ関数は違う public void changeBullet(Ammonation a) { Ammo = a.Ammo; if (Ammo > 0) { onShot = specialShot; } else { onShot = NormalShot; } currentBullet = a.bullet; }
public void INITIALIZING(TD_StateManager state) { ammonation = new Ammonation(); ammonation.bullet = weaponBullet; currentBullet = weaponBullet; statemanager = state; statemanager.BULLETSPAWNER = this; statemanager.status.getCurrentweapon.bullet = weaponBullet; direction = transform.forward; cameraMain = statemanager.FollowCamera; isPlayer = true; onShot = NormalShot; playerId = state.playerId; }
public void spawnBomb() { WPbullet b = Instantiate(bomb, hand.position, hand.rotation); Vector3 dir; if (Input.GetButton(StaticStrings.L2_key)) { dir = player.getCameraDir(); } else { dir = transform.forward * 50; } b.gameObject.GetComponent <Rigidbody>().AddForce(dir * 50); }
public void specialShoot() { WPbullet newBullet = Instantiate(currentBullet, spawnPoint.position, spawnPoint.transform.rotation); newBullet.passDirection(p, direction); specialBullet--; if (specialBullet <= 0) { specialBullet = 0; bulletSpawning = shoot; currentBullet = weaponBullet; if (p.getCanvas() == null) { return; } p.getCanvas().resetIngredientImage(); } }
public void changeWeapon() { if (specialWeaponBullet == null) { return; } if (!SpecialWpModel.activeInHierarchy) { SpecialWpModel.SetActive(true); wpModel.SetActive(false); currentBullet = specialWeaponBullet; } else { wpModel.SetActive(true); SpecialWpModel.SetActive(false); currentBullet = weaponBullet; } }
public void spawnBomb() { if (hand == null) { return; } if (allBombs[bombIndex].Ammo > 0) { allBombs[bombIndex].useAmmo(); WPbullet b = Instantiate(allBombs[bombIndex].bombPrefab, getHand().position, getHand().rotation); Vector3 dir; if (Input.GetButton(playerId + StaticStrings.L2_key)) { dir = getCameraDir(); } else { dir = transform.forward * 50; } b.gameObject.GetComponent <Rigidbody>().AddForce(dir * 50); } }
//バレットを作る public void AIshoot() { WPbullet newBullet = Instantiate(currentBullet, spawnPoint.position, spawnPoint.transform.rotation); newBullet.GetComponent <Rigidbody>().AddForce(transform.forward * 100 * bulletSpeed); }
public void changeBullet(WPbullet b) { bullet = b; }
//ディフォルトの無限バレット public void NormalShot() { WPbullet newBullet = Instantiate(weaponBullet, spawnPoint.position, spawnPoint.transform.rotation); newBullet.passDirection(direction); }
public void changeToSpecialShoot(int value, WPbullet bullet) { currentBullet = bullet; specialBullet = value; bulletSpawning = specialShoot; }
void shoot() { WPbullet newBullet = Instantiate(currentBullet, spawnPoint.position, spawnPoint.transform.rotation); newBullet.passDirection(p, direction); }