private void Start()
 {
     _rb = GetComponent<Rigidbody2D>();
     _mainParticle = Particle[0];
     _shootingScript = _mainParticle.GetComponent<ShootingScript>();
     _shootingScript.Init();
 }
Beispiel #2
0
 private void Start()
 {
     rb = GetComponent<Rigidbody2D>();
     shootingScripts = new ShootingScript[Particle.Length];
     for (var i = 0; i < Particle.Length; i++) {
         shootingScripts[i] = Particle[i].GetComponent<ShootingScript>();
         shootingScripts[i].Init();
     }
     shootingScript = shootingScripts[weaponNumber];
 }
Beispiel #3
0
 private void Start()
 {
     rb = GetComponent <Rigidbody2D>();
     shootingScripts = new ShootingScript[Particle.Length];
     for (var i = 0; i < Particle.Length; i++)
     {
         shootingScripts[i] = Particle[i].GetComponent <ShootingScript>();
         shootingScripts[i].Init();
     }
     shootingScript = shootingScripts[weaponNumber];
 }
 private void ChangeWeapon(int weaponNumber)
 {
     _shootingScript.Stop();
     _mainParticle = Particle[weaponNumber];
     _shootingScript = _mainParticle.GetComponent<ShootingScript>();
     _shootingScript.Init();
     if (Input.GetButton("Fire1"))
     {
         _shootingScript.Play();
     }
 }
Beispiel #5
0
 private void ChangeWeapon(int weaponNr)
 {
     if (weaponNr == weaponNumber)
     {
         return;
     }
     shootingScript.Stop();
     weaponNumber   = weaponNr;
     shootingScript = shootingScripts[weaponNr];
     if (Input.GetButton("Fire1"))
     {
         shootingScript.Play();
     }
 }
Beispiel #6
0
 private void ChangeWeapon(int weaponNr)
 {
     if (weaponNr == weaponNumber)
     {
         return;
     }
     shootingScript.Stop();
     weaponNumber = weaponNr;
     shootingScript = shootingScripts[weaponNr];
     if (Input.GetButton("Fire1"))
     {
         shootingScript.Play();
     }
 }