Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8d1d7c8

Browse files
Merge pull request #70 from philipcass/patch-2
Fix CPP event accessors
2 parents 01b9243 + c53adea commit 8d1d7c8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎Unity/Assets/NativeScript/Editor/GenerateBindings.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3427,7 +3427,15 @@ static void AppendEventAddRemoveMethod(
34273427
builders.CsharpFunctions);
34283428
builders.CsharpFunctions.Append('.');
34293429
builders.CsharpFunctions.Append(eventName);
3430-
builders.CsharpFunctions.Append(" += del;");
3430+
// TODO: More safely differenciate between add/removing event delegates
3431+
if (funcName.Contains("RemoveEvent"))
3432+
{
3433+
builders.CsharpFunctions.Append(" -= del;");
3434+
}
3435+
else
3436+
{
3437+
builders.CsharpFunctions.Append(" += del;");
3438+
}
34313439
AppendCsharpFunctionEnd(
34323440
typeof(void),
34333441
null,

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /