private void OnTriggerEnter2D(Collider2D collision) { if (_isDestroyed) { return; } _isDestroyed = true; collision.gameObject.GetComponent <Health>()?.ChangeHP(-1); PopPool.ShowPop(SpriteRenderer.color, transform.position); Destroy(gameObject); }
protected override void OnPickup(Collider2D collision) { collision.GetComponent <Health>().ChangeHP(1); PopPool.ShowPop(PopColor, transform.position, playSound: false); }
protected override void Awake() { base.Awake(); _current = this; }