Replace ObserverCondition.Clone with Instantiate #390
Closed
celojevic
announced in
Approved Changes or Features
Replies: 2 comments
-
Want to get this in soon. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Added in 4.0.3 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Instantiating a scriptable object (SO) will copy the instance of it with all its set values, which is what Clone() was intended to do, but without all the manual implementation.
The code change is as simple as replacing the Clone() call in NetworkObserver.cs, line 224 (as of 3.7.4) with
ObserverCondition ocCopy = Instantiate( _observerConditions[i]);
People who want to add additional logic can do so in the Awake() or OnEnable() methods on the SO instead of the previous Clone().
For what its worth I've changed this about a month ago and had no issues related to it.
Related messages (not a thread but it starts here): https://discord.com/channels/424284635074134018/923983677980045382/1109922804624797778
Beta Was this translation helpful? Give feedback.
All reactions