I'm trying to extract a lot of code in my program and I encountered a problem.
This is my function to extract a smelting process:
public IEnumerator Smelting(Button button, Image bar, BigDouble material, BigDouble output)
{
button.interactable = false;
float t = 0f;
while (t <= 1f)
{
bar.fillAmount = t;
t += Time.deltaTime / 4;
yield return null;
}
bar.fillAmount = 0;
//saveLoadHandler.data.copperBar += smeltingHandler.smeltCopperOreOutput;
material += output;
button.interactable = true;
}
My Problem is now that I want to add the output to the material with: material += output
.
The Command above shows what these parameter look like.
So it looks like in this case the material
doesn't get assigned correctly.
I don't want to go the way if(type = copper){copper += output } else if(type = iron)...
Is there a workaround for that?
Thanks in advance!