private void OnTriggerStay2D(Collider2D food)
    {
        script.DecrementCounter(food, thisBox, this.tag);

        isEqual = string.Compare(this.tag, food.tag, false);

        if (isEqual == 0)
        {
            //Do something that indicates the right action was taken.
            faceScript.SetFaceState(1);
        }
        else
        {
            //Do something that indicates the wrong action was taken.
            faceScript.SetFaceState(0);
        }

        food.gameObject.SetActive(false);
    }
Пример #2
0
 private void OnTriggerStay2D(Collider2D food)
 {
     food.gameObject.SetActive(false);
     script.DecrementCounter(food, "catchBox", this.tag);
 }