Skip to content

fix: NetworkVar implementations now uses Time of their owner NetworkM… #788

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

Merged
merged 3 commits into from
Apr 30, 2021

Conversation

TwoTenPvP
Copy link
Contributor

…anager

Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity left a comment

Choose a reason for hiding this comment

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

Looks awesome!

@TwoTenPvP TwoTenPvP enabled auto-merge (squash) April 30, 2021 15:39
@TwoTenPvP TwoTenPvP merged commit eb991d6 into develop Apr 30, 2021
@TwoTenPvP TwoTenPvP deleted the singleton-removal-networkvar-timescales branch April 30, 2021 15:55
@@ -403,7 +404,9 @@ public bool IsDirty()
get => m_Dictionary[key];
set
{
if (NetworkManager.Singleton.IsServer)
EnsureInitialized();
Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose we only need these EnsureInitialized inside the IsServer block, yes?

Copy link
Contributor

Choose a reason for hiding this comment

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

But in general I'm a little confused. This is an instance method, and we have m_NetworkBehaviour being initialized in the xtor (as private and readonly). Are we thinking somehow it could be nullified after the xtor? if it could be null at xtor time, then I would think we should throw an exception then. Concern is code clarity and the cost of doing these checks on every access.

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.

3 participants