Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #282 changed/changedwithhistory events not created when registere… #313

Conversation

ThimoDEV
Copy link
Collaborator

The problem was indeed that the changed and changedWithHistory events where not created when called in code. There are 3 possible solutions I can come up with to fix this bug. One is to slightly modify the GetOrCreate() method so it can be called in the property.

Option two is to call the runtime creation code in the property itself again. This makes the GetOrCreate() method unnessesary I think?

Option 3 is to somehow add an usage for calling a variables events in code

Maybe another solution will work better than what I suggested here in this PR. Im all open for the best suggestion to tackle this problem and to update this PR.

@miikalo miikalo self-requested a review November 27, 2021 10:52
Copy link
Collaborator

@miikalo miikalo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on 2019.4.21f1, works as described.

@miikalo miikalo merged commit a7b3d7b into unity-atoms:canary Nov 27, 2021
@miikalo miikalo added this to the v4.4.4 milestone Nov 27, 2021
@boynukaline
Copy link

Hey this overrides the current change event when a change event is added to a variable. Steps to reproduce:

  1. Leave variable changed event blank and in runtime change variable value to something. Stop runtime.
  2. Add your change event to the variable, and go into runtime again and change variable value. Check variable event, it changes to default.

@soraphis
Copy link
Collaborator

@boynukaline i think it would be better to create a new issue (or reopen the other issue) since this PR is already released 🙈
thanks for being observant!

@boynukaline
Copy link

@soraphis Thanks, created new issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Default Changed and ChangedWithHistory Events Not Created at Runtime
4 participants