예제 #1
0
    // Start is called before the first frame update
    void Start()
    {
        CleanDishRack rack = FindObjectOfType <CleanDishRack>();

        if (rack != null)
        {
            rack.DishAdded.AddListener(OnDishCountUpdated);
        }
    }
예제 #2
0
    // Update is called once per frame

    private void Start()
    {
        if (sRenderer == null)
        {
            sRenderer = GetComponent <SpriteRenderer>();
        }
        if (rack == null)
        {
            rack = FindObjectOfType <CleanDishRack>();
        }
        if (rack != null)
        {
            rack.DishAdded.AddListener(OnDishCleaned);
        }

        for (int x = 0; x < dirtyDishes.Length; x++)
        {
            dirtyDishes[x].DisableDish();
        }
    }