private void Collect()
{
if (audioElement != null && Time.timeScale > 0)
{
audioElement.Play(harvestSound);
}
float collect = collectionAmount * Time.deltaTime;
// Make sure that the harvester cannot collect more than it can carry
if (currentLoad + collect > capacity)
{
collect = capacity - currentLoad;
}
if (resourceDeposit.isEmpty())
{
Arms[] arms = GetComponentsInChildren <Arms>();
foreach (Arms arm in arms)
{
arm.renderer.enabled = false;
}
DecideWhatToDo();
}
else
{
resourceDeposit.Remove(collect);
}
currentLoad += collect;
}