Skip to content

MPPM: allow scripts to determine if we're running as a virtual player #2865

Open
@CodeSmile-0000011110110111

Description

Is your feature request related to a problem? Please describe.
Some code shouldn't be run in a virtual player, if only for convenience. 

Most urgently: editor tools that pop up a window where you'd only want that window open in the main editor. You may not even know which editor the window belongs to and make the edits in the wrong place. A virtual player may also overwrite the same configuration file of an editor tool. 

Virtual players may also run InitOnLoad code intended to run only when the project is "opened for the first time". This may just slow down opening the editor but could also lead to issues. Again, would be helpful to be able to safeguard against this.

Describe the solution you'd like
A simple bool property like:
CurrentPlayer.IsVirtualPlayer
and correspondingly:
CurrentPlayer.IsMainEditor

Describe alternatives you've considered
Alternative? Reflection. So many things seem readily available in Multiplayer Playmode classes but nothing is public besides the tags.

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