void SpawnMissile() { var settings = Settings.Instance; var speed = settings.projectileSpeedLevels[projectileSpeedLevel - 1]; var accuracy = settings.accuracyLevels[accuracyLevel - 1]; var explosionSize = settings.explosionSizeLevels[explosionSizeLevel - 1]; GameObject missileObject = Instantiate(missile, muzzle.position, this.transform.rotation); MissileBehavior mb = missileObject.GetComponent <MissileBehavior>(); mb.Initialize(speed, accuracy, explosionSize); lastShotTime = Time.time; }