コード例 #1
0
    void OnTriggerEnter2D(Collider2D col)
    {
        // Reward a princess and remove
        monitor.Princesses_Taken();

        Destroy(this.gameObject);
    }
コード例 #2
0
    void OnTriggerEnter2D(Collider2D coll)
    {
        if (coll.gameObject.tag == Globals.TAGS.Player)
        {
            // Good, count and delete
            mon.Princesses_Taken();

            Destroy(this.gameObject);
        }
    }