0

I have function as below:

public void PlayIfNotPlaying()

but when i modified it into

public void PlayIfNotPlaying(float speed)

the UnityEvent will break.

enter image description here

Is there anyway to avoid this issue ? I heard about [FormerlySerializedAs("myValue")], but it use for renaming serialized field.

2
  • 2
    This requires an Editor plugin and the code is a really long one. Three things to do: 1.Detect when the there is missing link in the UnityEvent. 2.Search to see if the function exists but with different param sig. 3.Map the new function to the Unity event. Commented Jun 5, 2018 at 3:29
  • 2
    This post is very similar and should get you started for #1 and #2. For #3, see this post. By reading these two, you should be able to create a solution for this. Commented Jun 5, 2018 at 3:30

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.