Exemple #1
0
 public void DroppedThrowable()
 {
     OnItemThrow();
     weaponBeingHeld = null;
     hatImage.sprite = null;
     if (shootingPS != null)
     {
         Destroy(shootingPS.gameObject);
     }
     currentBulletManager  = null;
     isHoldingThrowable    = false;
     nextShotAvailable     = false;
     spriteRenderer.sprite = null;
 }
Exemple #2
0
 private void PickUpThrowable(GameObject throwableToPickUp)
 {
     weaponBeingHeld        = throwableToPickUp.GetComponent <WeaponPickUpTest>().GetWeapon();
     weaponBeforeChallenge  = weaponBeingHeld;
     shotSound              = weaponBeingHeld.GetShotSound();
     bulletTypeImage.sprite = weaponBeingHeld.GetBulletTypeImage();
     hatImage.sprite        = weaponBeingHeld.GetHatImage();
     hatAnimator.SetTrigger(RESET_HAT_TRIGGER);
     currentBulletManager = throwableToPickUp.GetComponent <BulletManagerTest>();
     tipOfTheGun.transform.localPosition = weaponBeingHeld.GetGunTip().transform.localPosition;
     shootingPS = Instantiate(weaponBeingHeld.GetFiringParticleSystem(), tipOfTheGun.position, Quaternion.identity, transform);
     OnItemPickup(currentBulletManager.AvailableBulletsCount());
     isHoldingThrowable    = true;
     nextShotAvailable     = true;
     spriteRenderer.sprite = weaponBeingHeld.GetSprite();
 }