示例#1
0
    /*void OnMouseDown()
     * {
     *  Destroy(gameObject);
     *  Instantiate(dirtExplosion, this.transform.position, this.transform.rotation);
     * }*/

    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == "DiggingPickaxe")
        {
            Destroy(gameObject);
            Instantiate(dirtExplosion, this.transform.position, this.transform.rotation);
            //theCharacterMovement.score += scoreYield;
            theManager.AddCoins(scoreYield);
        }
    }