Immutable local 'variables' in C#
You can declare your local variable as an iteration variable. Iteration variables are readonly. Yes, it is ugly.
foreach (float maxGrowth in new[] { GrowthRate * Time.deltaTime })
{
maxGrowth = 0; // won't compile: "error CS1656: Cannot assign to 'maxGrowth' because it is a 'foreach iteration variable'"
}
readonly
When a field declaration includes a readonly modifier, assignments to the fields introduced by the declaration can only occur as part of the declaration or in a constructor in the same class.
There's no equivalent for local variables. You'll have to make it a field.