Example #1
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        Playar temp = collision.transform?.GetComponent <Playar>();

        if (temp != null)
        {
            temp.StartBigPlayar();
            Destroy(gameObject);
        }
    }
Example #2
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        Playar temp = collision?.GetComponent <Playar>();

        if (temp != null)
        {
            if (temp.EatMashrim == false)
            {
                temp.StartBigPlayar();
            }
            else
            {
                temp.StartFlowerPlayar();
            }

            Destroy(gameObject);
        }
    }