Having an enum as an optional argument to a method causes compile errors. The errors show up as
[UdonSharp] Assets/Scripts/Test.cs(12,1): System.ArgumentException: Type provided must be an Enum.
with the code location in the errors being seemingly random and unrelated.
Code to replicate bug:
enum AnEnum {
Option,
AnotherOption
}
public class Test : UdonSharpBehaviour
{
void OptionalEnum(AnEnum anEnum = AnEnum.Option)
{
}
}
Changing
void OptionalEnum(AnEnum anEnum = AnEnum.Option)
to
void OptionalEnum(AnEnum anEnum)
removes the errors.