using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ScrapCollector : MonoBehaviour
{
    [SerializeField] int healthPoints;

    [SerializeField] float initialProductionTimer;
    private float productionTimer;
    [SerializeField] int productionAmount;

    [SerializeField] GameObject resourceManager;


    void Update()
    {
        ProduceScrap();
    }
    void ProduceScrap()
    {
        productionTimer -= Time.deltaTime;
        if (productionTimer <= 0)
        {
            productionTimer += initialProductionTimer;
            resourceManager.GetComponent<ResourceManager>().ChangeResourceValue("scrap", productionAmount);
        }
    }
}
