public void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.CompareTag("Player") && !_enabled)
     {
         enabled = true;
         PowerUpSignal.Raise();
         Destroy(gameObject);
     }
 }
Esempio n. 2
0
 public void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Player") && !other.isTrigger)
     {
         _playerInventory.NumberOfCoins += 1;
         PowerUpSignal.Raise();
         Destroy(gameObject);
     }
 }
Esempio n. 3
0
 public void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.CompareTag("Player") && !other.isTrigger)
     {
         _heartContainer.RuntimeValue += 1;
         _playerHealth.RuntimeValue    = _heartContainer.RuntimeValue * 2;
         PowerUpSignal.Raise();
         Destroy(gameObject);
     }
 }
Esempio n. 4
0
 public void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Player"))
     {
         FindObjectOfType <AudioManager>().PlaySound("PickUp_Coin");
         PlayerInventory.AddItem(Coin);
         PowerUpSignal.Raise();
         Destroy(this.gameObject);
         PickUpEffects();
     }
 }
Esempio n. 5
0
 public void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Player") && !other.isTrigger)
     {
         _playerHealth.RuntimeValue += _amountToIncrease;
         if (_playerHealth.InitialValue > _heartContainers.RuntimeValue * 2)
         {
             _playerHealth.InitialValue = _heartContainers.RuntimeValue * 2;
         }
         PowerUpSignal.Raise();
         Destroy(gameObject);
     }
 }
Esempio n. 6
0
 public void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Player") && !other.isTrigger)
     {
         playerHealth.RuntimeValue += amountToIncrease;
         if (playerHealth.RuntimeValue > heartContainers.RuntimeValue * 2f)
         {
             playerHealth.RuntimeValue = heartContainers.RuntimeValue * 2f;
         }
         PowerUpSignal.Raise();
         Destroy(this.gameObject);
     }
 }
Esempio n. 7
0
 public void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Player"))
     {
         PlayerHealth.RuntimeValue += HealthIncrease;
         if (PlayerHealth.RuntimeValue > HearthContainers.InitialValue * 2f)
         {
             PlayerHealth.RuntimeValue = HearthContainers.InitialValue * 2f;
         }
         PowerUpSignal.Raise();
         Destroy(this.gameObject);
         PickUpEffects();
     }
 }
Esempio n. 8
0
 private void Start()
 {
     PowerUpSignal.Raise();
 }