Ejemplo n.º 1
0
    public bool CanInteractWith(PlayerInteractor interactor)
    {
        DeliverSpot deliverSpot = DeliverSpot.FirstEnabled;

        if (deliverSpot != null)
        {
            DeliverSpot.WishedResource wishedResource = deliverSpot.wishedResources.Find(w => w.type == type);
            if (wishedResource != null)
            {
                return(wishedResource.quantity > interactor.CountResourcesOfType(type));
            }
        }
        return(false);
    }
Ejemplo n.º 2
0
    private void Update()
    {
        PlayerInteractor collector   = PlayerInteractor.FirstEnabled;
        DeliverSpot      deliverSpot = DeliverSpot.FirstEnabled;

        if (collector != null && deliverSpot != null)
        {
            for (int i = 0; i < resourceCount; i++)
            {
                textRenderers[i].text = collector.CountResourcesOfType(i) + deliverSpot.CollectedQuantityOfType(i) + "/" + deliverSpot.WishedQuantityOfType(i);
            }
            panelRoot.SetActive(true);
        }
        else
        {
            panelRoot.SetActive(false);
        }
    }