Update PistolComponent.cs

This commit is contained in:
sebastianhampel1 2023-06-15 12:49:37 -04:00
parent 28a3f7ddd8
commit 0779b443ff

View File

@ -48,14 +48,14 @@ namespace Item
private GameObject targetObject; private GameObject targetObject;
private float timeSinceLightDuration; private float timeSinceLightDuration;
public bool IsLightOn => targetingLight.gameObject.activeSelf; public bool IsLightOn => targetingLight.gameObject.activeSelf;
//private Dictionary<int,float> projectiles = new Dictionary<int, float>(); //private Dictionary<int,float> projectiles = new Dictionary<int, float>();
// Start is called before the first frame update // Start is called before the first frame update
private void Start() private void Start()
{ {
} }
// Update is called once per frame // Update is called once per frame
@ -132,21 +132,20 @@ namespace Item
[ServerRpc] [ServerRpc]
private void SpawnBullet(GameObject projectile) private void SpawnBullet(GameObject projectile)
{ {
InstanceFinder.ServerManager.Spawn(projectile); InstanceFinder.ServerManager.Spawn(projectile);
} }
public void Fire(bool offsetWithTargetBall) public void Fire(bool offsetWithTargetBall)
{ {
shootLightDuration = 0; shootLightDuration = 0;
shootLight.gameObject.SetActive(true); shootLight.gameObject.SetActive(true);
var projectile = Instantiate(projectilePrefab, bulletSpawnPoint); var projectile = Instantiate(projectilePrefab, bulletSpawnPoint);
SpawnBullet(projectile); SpawnBullet(projectile);
//var projectile = Instantiate(projectilePrefab, bulletSpawnPoint); //var projectile = Instantiate(projectilePrefab, bulletSpawnPoint);
//InstanceFinder.ServerManager.Spawn(projectile); //InstanceFinder.ServerManager.Spawn(projectile);