public float GetFishPerSec()
{
float tick2 = 0;
float tick1 = 0;
float tick = 0;
foreach(float item in tickValue)
{
tick += idleCount[0] * tickValue[0];
tick1 += idleCount[1] * tickValue[1];
tick2 += idleCount[2] * tickValue[2];
}
return tick + tick1 + tick2;
}
been trying to work this out for the last couple hours, and i am not understanding why this is taking the idlecount value and the tickvalue and adding them together instead of mulitplying it.
tickValue [0] = 0.2f;
tickValue [1] = 0.7f;
tickValue [2] = 1.5f;
tickValue [3] = 3;
tickValue [4] = 5.5f;
tickValue [5] = 7;
idleCost [0] = 500;
idleCost [1] = 1200;
idleCost [2] = 5000;
idleCost [3] = 150000;
idleCost [4] = 500000;
idleCost [5] = 1000000;
idleCount [0] = 0;
idleCount [1] = 0;
idleCount [2] = 0;
idleCount [3] = 0;
idleCount [4] = 0;
idleCount [5] = 0;
as an example when i get 1 count of the [0] part of the array it goes 1 + 0.2 instead of 1 times 0.2, can anyone tell me why this is not multiplying? Thank you.