Exemplo n.º 1
0
    // Update is called once per frame
    //	void Update () {
    //
    //	}

    void OnCollisionEnter2D(Collision2D collision)
    {
        Collider2D other = collision.collider;

        Debug.Log("Entered trigger on trap deployer");
        if (other.tag == "Player")
        {
            if (droppingTrap)
            {
                TrapManager manager = droppingTrap.GetComponent <TrapManager> ();
                manager.DropTrap();
            }
            if (raisingTrap)
            {
                TrapManager manager = raisingTrap.GetComponent <TrapManager> ();
                manager.RaiseTrap();
            }
        }
    }