Esempio n. 1
0
    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);
    }
Esempio n. 3
0
    protected override void Awake()
    {
        base.Awake();

        _current = this;
    }