Open ikuko opened 4 years ago
Yeah this is known thing that I can't do much about without adding a chunk of overhead to numeric casts since Udon doesn't provide a way to cast for "real" right now and Convert functions are checked. I'll add a note about this to the README, but this behavior will change to be unchecked when VRC implements proper numeric casting.
Some relevant cannys for this: https://vrchat.canny.io/vrchat-udon-closed-alpha-feedback/p/provide-an-instruction-that-does-not-automatically-reassign-the-strongbox-type-w https://vrchat.canny.io/vrchat-udon-closed-alpha-feedback/p/cast-nodes
Thanks, I voted for canny.
Describe the bug in detail: The behavior of C# and U# is different when you do an explicit cast. (ja: ) 明示的キャストを行った際にC#とU#で動作が異なります
Provide steps/code to reproduce the bug: C# or U# code
(ja:) C#もしくはU#のコード
An excerpt of the problematic part of UAssembly
(ja:) 問題のある部分のUAssemblyを抜粋
Expected behavior: If you follow C#, this U# code will be displayed in the console like this (ja:) C#に従うならばこのU#コードはコンソールに以下のように表示します
Explicit casts to the form of using methods such as Convert.ToUInt32 It is due to compiling. However, due to the way U# and Udon work, this may be an inevitable glitch. I wish there is a good solution, but I think it's difficult to fix. It would be better to present it as a specification in README. (ja:) 明示的キャストをConvert.ToUInt32のようなメソッドを使用する形にコンパイルすることが原因です。 しかしながらU#とUdonの仕組み上これは仕方ない不具合かもしれません。 何かしら良い解決策があれば良いのですが、修正は難しいと思います。 READMEなどで仕様として提示すると良いでしょう。