Skip to content

Open NetworkVariableBase initialization path to derivations #2010

@danielchipman

Description

@danielchipman

Small but helpful QoL request

Is your feature request related to a problem? Please describe.
NetworkVariableBase is available for developers to create their own implementations, however if additional logic is needed for initializing the custom network variable, a new entry point must be added and manually called whenever used.

Describe the solution you'd like
Add virtual keyword to NetworkVariableBase.Initialize()

Describe alternatives you've considered
Could instead provide a virtual OnInitialize() that gets called from Initialize() if concerned about base.Initialize() not being called. NetworkBehaviour param should be either passed through or a protected getter for m_NetworkBehaviour should be provided in this case.

Additional context
Use case being applied to: Custom NetworkVariableBase that wraps a NetworkVariable to provide automatic full reference resolution on clients when the target reference is spawned. Additional initialization logic is required in addition to calling Initialize() on the internal NetworkVariable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:lowThis issue has low priority and will take some time to be resolvedtype:featureNew feature, request or improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions