Ejemplo n.º 1
0
    public void give()
    {
        int full = 0;

        foreach (graveResource resource in requiredResources)
        {
            resourceManager.Resource giveResource = resourceManager.resources.Find(r => r.name == resource.name);
            resource.current += giveResource.RemoveForce(resource.needed - resource.current);

            if (resource.current >= resource.needed)
            {
                full += 1;
            }
        }

        //Debug.Log(full + " Full " + requiredResources.Count + " Capacity");
        if (full >= requiredResources.Count)
        {
            nextStage();
        }

        sc.OnValueChange.Invoke();
    }