Muzzle Particle added(funktioniert auch)
This commit is contained in:
@@ -4,7 +4,7 @@ using UnityEngine;
|
||||
|
||||
public class WeaponScript : MonoBehaviour
|
||||
{
|
||||
|
||||
public ParticleSystem muzzle;
|
||||
public GameObject spawnpoint;
|
||||
public GameObject bullet;
|
||||
|
||||
@@ -32,6 +32,8 @@ public class WeaponScript : MonoBehaviour
|
||||
public void shoot(){
|
||||
if(ammo != 0){
|
||||
if(Input.GetKeyDown(KeyCode.Mouse0)){
|
||||
muzzle.gameObject.SetActive(true);
|
||||
//muzzle.Play();
|
||||
Instantiate(bullet,spawnpoint.transform.position,transform.rotation);
|
||||
ammo--;
|
||||
}
|
||||
@@ -43,8 +45,8 @@ public class WeaponScript : MonoBehaviour
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
dataBullet = GetComponentInChildren<DataBullet>();
|
||||
ammo = dataBullet.ammo;
|
||||
muzzle = spawnpoint.GetComponentInChildren<ParticleSystem>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
|
Reference in New Issue
Block a user