public void OnTriggerEnter2D(Collider2D coll)
 {
     if (coll.CompareTag("shovel"))
     {
         collManager.sendCollisionData(coll.gameObject, this.gameObject, CollisionScript.CollisionType.SHOVEL_UNDEAD);
     }
 }
Beispiel #2
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        //make sure your objects are tagged, dipshit
        if (collision.CompareTag("shovel") && collision.GetComponent <ShovelScript>().shovelNum != playerNum)
        {
            collManager.sendCollisionData(collision.gameObject, this.gameObject, CollisionScript.CollisionType.SHOVEL_PLAYER);
        }

        if (collision.CompareTag("undead") && playerShovel.spinning == false)
        {
            collManager.sendCollisionData(collision.gameObject.transform.parent.gameObject, this.gameObject, CollisionScript.CollisionType.UNDEAD_PLAYER);
        }

        if (collision.CompareTag("grave"))
        {
            collManager.sendCollisionData(this.gameObject, collision.gameObject, CollisionScript.CollisionType.PLAYER_GRAVE);
        }

        if (collision.CompareTag("pit"))
        {
            collManager.sendCollisionData(this.gameObject, collision.gameObject, CollisionScript.CollisionType.PLAYER_PIT);
        }

        if (collision.CompareTag("flowers"))
        {
            collManager.sendCollisionData(collision.gameObject, this.gameObject, CollisionScript.CollisionType.FLOWER_PLAYER);
        }
    }
Beispiel #3
0
    void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.CompareTag("pit"))
        {
            collManager.sendCollisionData(this.gameObject, collision.gameObject, CollisionScript.CollisionType.FLOWER_PIT);
        }

        if (collision.CompareTag("grave"))
        {
            collManager.sendCollisionData(this.gameObject, collision.gameObject, CollisionScript.CollisionType.FLOWER_GRAVE);
        }
    }