Example #1
0
 void OnTriggerEnter2D(Collider2D target)
 {
     if (target.gameObject.tag == targetTag)
     {
         health.Damaged(40);
     }
 }
Example #2
0
    void OnTriggerEnter2D(Collider2D target)
    {
        if (target.gameObject.tag == targetTag)
        {
            health.Damaged(collidingDamage);
        }

        if (target.gameObject.tag == "Attack")
        {
            bigGhostRenderer.color = new Color(255f, 0f, 0f, 255f);
        }
    }
Example #3
0
    void OnTriggerEnter2D(Collider2D target)
    {
        if (target.isTrigger != true)
        {
            if (target.gameObject.tag == "Player")
            {
                health.Damaged(power);
            }

            Destroy(gameObject);
        }
    }
Example #4
0
    void OnTriggerEnter2D(Collider2D target)
    {
        if (target.gameObject.tag == targetTag)
        {
            health.Damaged(collidingDamage);
        }

        if (target.gameObject.tag == "Attack")
        {
            devilRenderer.color = new Color(255f, 0f, 0f, 255f);
        }


        if (target.gameObject.tag == "Wall")
        {
            devilRenderer.flipX = !devilRenderer.flipX;
            direction          *= -1;
        }
    }