Skip to content

fix private non-virtual methods not getting called when not properly overriden - #4123

Open
SinanErmis wants to merge 1 commit into
MirrorNetworking:masterfrom
SinanErmis:network-transform-rb-lifecycle-method-hide-fix
Open

fix private non-virtual methods not getting called when not properly overriden#4123
SinanErmis wants to merge 1 commit into
MirrorNetworking:masterfrom
SinanErmis:network-transform-rb-lifecycle-method-hide-fix

Conversation

@SinanErmis

Copy link
Copy Markdown

Hello.

I had a problem when using Network Rigidbody Reliable which cost me a few hours to find out why. I am not really sure how anyone haven't noticed yet (this bug is probably older than a year...) but when using Network Rigidbody Reliable, Network Rigidbody Unreliable, Network Rigidbody Unreliable Compressed or their 2D counterparts in UpdateMethod.FixedUpdate method, child classes' FixedUpdate implementation suppresses base classes' one.

I changed every Unity lifecycle call in classes inheriting from NetworkTransformBase to be protected virtual and overrode them in child classes. This way lifecycle methods get called even if they are implemented in child classes, also being explicit about them being able to be overridden is also a win I guess.

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.

1 participant