示例#1
0
    void OnTriggerEnter(Collider collider)
    {
        if (collider.gameObject.tag == "Gold")
        {
            //collider.gameObject.SendMessage("AddScore");
            Gold gold = collider.gameObject.GetComponent <Gold>();
            gold.AddScore();

            Destroy(collider.gameObject);
        }
    }