Exemplo n.º 1
0
    void Start()
    {
        ResourceValue[] resources = FindObjectsOfType <ResourceValue>();

        gas = Array.Find(resources, resource => resource.Type == ResourceType.Gas);

        minerals = Array.Find(resources, resource => resource.Type == ResourceType.Minerals);

        supplies = Array.Find(resources, resource => resource.Type == ResourceType.Supplies);

        definition = GetComponent <ObjectDefinition>();

        supplies.AddCapacity(definition.SupplyCapacity);
    }