Пример #1
0
    /****** Collecting items and updating UI******/
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.CompareTag("Cup"))
        {
            other.gameObject.SetActive(false);
            cups++;
            iuic.SetCupsAmmount(cups);
            ss.score += 10;
            ss.SetScoreText();
        }
        if (other.gameObject.CompareTag("Paper"))
        {
            other.gameObject.SetActive(false);
            papers++;
            iuic.SetPapersAmmount(papers);
        }

        /*if(other.gameObject.CompareTag("Key")){
         *      other.gameObject.SetActive(false);
         *      iuic.HideKey();
         *      iuic.ShowKey();
         * }*/
    }