[BUG] Unexpected Behavior with params in U# Extension Methods
tp․jp
VRChat Version:
VRChat SDK - Worlds 3.7.5
VRChat SDK - Base 3.7.5
Description of the bug:
When using the params keyword in U# extension methods, the first argument is missing.
Steps to reproduce (how did you encounter the bug?):
It can be reproduced by executing the following code.
public class SampleUdon : UdonSharpBehaviour
{
void Start()
{
this.SampleMethod("test0", "test1");
}
}
public static class SampleUdonExtensions
{
public static void SampleMethod(this SampleUdon self, params object[] args)
{
Debug.Log($"ArgsLength: {args.Length}");
for (var i = 0; i < args.Length; i++)
{
Debug.Log($"Args[{i}]: {args[i]}");
}
}
}
Output
ArgsLength: 1
Args[0]: test1
Expected Output
ArgsLength: 2
Args[0]: test1
Args[1]: test2
Log In
tp․jp
Sorry, there was an error in the expected output.
The correct output is as follows:
ArgsLength: 2
Args[0]: test0
Args[1]: test1