Skip to content

Can't inherit from NetworkVariable #2393

@matthieu-blin

Description

@matthieu-blin

Description

Since NetworkBehaviour use IsSubclassOf(NetworkVariableBase) and IsSubclassOf use BaseType we're forced to inherit directly from NetworkVariableBase

Context :

During a Unet to Netcode translation, i wanted to avoid the throw when setting a NetworkVariable from client since Unet was fine with this even in incorrect case. Inheriting from NetworkVariable just to override Value property seems a quick way for this.

Expected :

Either forbid this sealing NetworkVariable (and that's fine) or allow it (changing IsSubClass for a IsAssignableFrom or kind of)

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: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