示例#1
0
    void OnCollsionEnter(Collision col)
    {
        GameObject    temp    = GameObject.Find("WeightBar");
        WeightCounter counter = temp.GetComponent <WeightCounter>();

        if (col.gameObject.tag == "pollution")
        {
            Destroy(col.gameObject);
        }
    }
示例#2
0
    void Start()
    {
        GameObject temp = GameObject.Find("WeightBar");

        counter = temp.GetComponent <WeightCounter>();
    }