public void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.CompareTag("Player") && !_enabled) { enabled = true; PowerUpSignal.Raise(); Destroy(gameObject); } }
public void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Player") && !other.isTrigger) { _playerInventory.NumberOfCoins += 1; PowerUpSignal.Raise(); Destroy(gameObject); } }
public void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.CompareTag("Player") && !other.isTrigger) { _heartContainer.RuntimeValue += 1; _playerHealth.RuntimeValue = _heartContainer.RuntimeValue * 2; PowerUpSignal.Raise(); Destroy(gameObject); } }
public void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Player")) { FindObjectOfType <AudioManager>().PlaySound("PickUp_Coin"); PlayerInventory.AddItem(Coin); PowerUpSignal.Raise(); Destroy(this.gameObject); PickUpEffects(); } }
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); } }
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); } }
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(); } }
private void Start() { PowerUpSignal.Raise(); }