vrchat-community / UdonSharp

A compiler for compiling C# to Udon assembly
https://udonsharp.docs.vrchat.com
MIT License
473 stars 51 forks source link

Enum flag operator or is not working #155

Open smitdylan2001 opened 10 months ago

smitdylan2001 commented 10 months ago

Describe the bug in detail: When using flags on enums like the camera depth I cannot use the '|' operator to set the flags. I get an error An exception occurred during Udon execution, this UdonBehaviour will be halted. VRC.Udon.VM.UdonVMException: The VM encountered an error! Exception Message: An exception occurred during EXTERN to 'UnityEngineCamera.__set_depthTextureModeUnityEngineDepthTextureModeSystemVoid'. Parameter Addresses: 0x00000007, 0x0000000B

Provide steps/code to reproduce the bug: Make project Add the following lines of code to a script on the reference camera on Start or OnEnabled Camera cam = GetComponent(); cam.depthTextureMode = cam.depthTextureMode | DepthTextureMode.Depth; Press play Get error

Expected behavior: It should not error and set the enum accordingly