Skip to content

refactor: extract GlobalObjectIdHash generation from NetworkObject.OnValidate() #798

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 2 commits into from
May 5, 2021

Conversation

TwoTenPvP
Copy link
Contributor

@TwoTenPvP TwoTenPvP commented May 4, 2021

Occasionally, we might want to generate GlobalObjectIdHash manually in an internal flow when we know exactly what we're doing.
Recently, there was a use-case where we wanted to treat NetworkObject instances instantiated at runtime as NetworkPrefabs to avoid creating more and more NetworkPrefab assets to get GlobalObjectIdHash being generated.
By allowing internal code to manually execute GlobalObjectIdHash generation, we're simulating build-time/creation-time GlobalObjectIdHash generation at runtime — and again, in that context, we know exactly what we're doing there so that is fine.

@TwoTenPvP TwoTenPvP requested a review from 0xFA11 May 4, 2021 18:46
@0xFA11 0xFA11 changed the title refactor: Separates generation of GlobalObjectIdHash from OnValidate refactor: extract GlobalObjectIdHash generation from NetworkObject.OnValidate() May 5, 2021
@0xFA11 0xFA11 merged commit 2a77e53 into develop May 5, 2021
@0xFA11 0xFA11 deleted the global-object-id-hash-generation-separation branch May 5, 2021 12:58
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.

2 participants