private void OnTriggerEnter(Collider other)
 {
     if (other.GetComponent <AltCarMove>()) //boole -> enum , switch
     {
         AltCarMove player = other.GetComponent <AltCarMove>();
         if (_mini == true)
         {
             player._hasMinigun = true;
             player.GainWeapon(_miniVal);
         }
         if (_rocket == true)
         {
             player._hasRocketLauncher = true;
             player.GainWeapon(_rocketVal);
         }
         if (_sniper == true)
         {
             player._hasSniperRifle = true;
             player.GainWeapon(_sniperVal);
         }
         if (_slapper == true)
         {
             player._hasSlapper = true;
             player.GainWeapon(_slapperVal);
         }
         if (_trail == true)
         {
             player._hasTrail = true;
             player.GainWeapon(_trailVal);
         }
         Destroy(_thisObject, _timeToDestroy);
     }
 }
Beispiel #2
0
 private void Start()
 {
     _hp       = _life;
     _carEn    = _thisAI.GetComponent <AIEnemy>();
     _car      = _thisAI.GetComponent <AltCarMove>();
     _civilian = _thisAI.GetComponent <LilHum>();
 }
Beispiel #3
0
 //only visual for now, to see if it will work Updt/ it does
 private void OnTriggerEnter(Collider other)
 {
     if (other.GetComponent <AltCarMove>())
     {
         AltCarMove player = other.GetComponent <AltCarMove>();
         player.Nitro();
         Destroy(_thisObject, _zeroVal);
     }
 }