public void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.CompareTag("Player") && !_enabled)
     {
         enabled = true;
         PowerUpSignal.Raise();
         Destroy(gameObject);
     }
 }
Exemplo n.º 2
0
 public void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Player") && !other.isTrigger)
     {
         _playerInventory.NumberOfCoins += 1;
         PowerUpSignal.Raise();
         Destroy(gameObject);
     }
 }
Exemplo 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);
     }
 }
Exemplo 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();
     }
 }
Exemplo 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);
     }
 }
Exemplo 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);
     }
 }
Exemplo 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();
     }
 }
Exemplo n.º 8
0
 private void Start()
 {
     PowerUpSignal.Raise();
 }