private void SpawnBullet(float shootPower, Transform t) { PlayerBulletController bulletController = ((GameObject)Instantiate(playerBullet, t.position, t.rotation)).GetComponent <PlayerBulletController> (); bulletController.speed = bulletSpeed + shootPower * 8f; //float sFactor = (shootPower < 0.5f) ? 0.5f : shootPower; //bulletController.gameObject.transform.localScale = new Vector3 (1.8f * sFactor, 2.3f * sFactor, 1f); }
/// <summary> /// Instantiates projectiles at the specified location. /// </summary> public void Shoot() { for (int i = 0; i < bulltSpawnLocations.Length; i++) { PlayerBulletController bulletController = ((GameObject)Instantiate(bulletPrefab, bulltSpawnLocations[i].position, bulltSpawnLocations[i].rotation)).GetComponent <PlayerBulletController>(); bulletController.speed = bulletSpeed * 6f; bulletController.helpfulShape = this; bulletController.transform.localScale = _scale; } }