Skip to content
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.

Commit

Permalink
Fix unary negation on types with builtin operators
Browse files Browse the repository at this point in the history
- I ran into this on negating a Vector3. Udon is breaking naming convention again with this. Add a special condition for it...
  • Loading branch information
MerlinVR committed Feb 12, 2020
1 parent 5e4516a commit a457359
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Assets/UdonSharp/Editor/UdonSharpASTVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,8 @@ private MethodInfo[] GetOperators(System.Type type, BuiltinOperatorType builtinO
string operatorName = System.Enum.GetName(typeof(BuiltinOperatorType), builtinOperatorType);
if (builtinOperatorType == BuiltinOperatorType.Multiplication)
operatorName = "Multiply"; // Udon breaks standard naming with its multiplication overrides on base types
else if (builtinOperatorType == BuiltinOperatorType.UnaryMinus)
operatorName = "UnaryNegation";

operatorName = $"op_{operatorName}";

Expand Down

0 comments on commit a457359

Please sign in to comment.