private static Vector2 DefaultMulFactors = new Vector2(0.5f, 0.5f);
private static Point DefaultShifts = new Point(0,0);
public static Vector2 Function(Vector2? mulFactors = MyClass.DefaultMulFactors , Point? shifts = MyClass.DefaultShifts )
{
...
return result;
}
Why does my code not accept my static values? How can I assign default parameters to my function parameters? Indeed Vector2? mulFactors = new Vector(0.2,0.3) or Vector2? mulFactors = Vector2.Zero does not work.
You can’t, basically. The value must be supported by the compiler to allow that type of usage (it is essentially a constant). I would just use
nullhere:then: