Photon Fusion 1.1.9

Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
RunnerVisibilityNode Class Reference

Identifies visible/audible components (such as renderers, canvases, lights) that should be enabled/disabled by NetworkRunner.IsVisible. Automatically added to scene objects and spawned objects during play if running in NetworkProjectConfig.PeerModes.Multiple. Additionally this component can be added manually at development time to identify specific Behaviours or Renderers you would like to restrict to one enabled copy at a time. More...

Inherits MonoBehaviour.

Public Types

enum  PreferredRunners
 The peer runner that will be used if more than one runner is visible, and this node was manually added by developer (indicating only one instance should be visible at a time). More...
 

Public Member Functions

void SetEnabled (bool enabled)
 Sets the visibility state of this node.
 

Static Public Member Functions

static void AddVisibilityNodes (GameObject go, NetworkRunner runner)
 Find all component types that contribute to a scene rendering, and associate them with a RunnerVisibilityNode component, and add them to the runner's list of visibility nodes.
 
static void RefreshAllRunnerVisibilities ()
 Force a complete visibility refresh on all runners. Typically used if a runner is destroyed/shutdown.
 

Public Attributes

UnityEngine.Component Component
 The associated component with this node. This Behaviour or Renderer will be enabled/disabled when its parent NetworkRunner.IsVisible is changed.
 
PreferredRunners PreferredRunner
 If more than one runner instance is visible, this indicates which peer's clone of this entity should be visible.
 

Properties

bool DefaultState [get, set]
 Set to false to indicate that this object should remain disabled even when NetworkRunner.IsVisible is set to true.
 

Detailed Description

Identifies visible/audible components (such as renderers, canvases, lights) that should be enabled/disabled by NetworkRunner.IsVisible. Automatically added to scene objects and spawned objects during play if running in NetworkProjectConfig.PeerModes.Multiple. Additionally this component can be added manually at development time to identify specific Behaviours or Renderers you would like to restrict to one enabled copy at a time.

Member Enumeration Documentation

◆ PreferredRunners

The peer runner that will be used if more than one runner is visible, and this node was manually added by developer (indicating only one instance should be visible at a time).

Enumerator
InputAuthority 

The peer/runner with input authority will be used if visible.

Server 

The server peer/runner will be used if visible.

Client 

The first client peer/runner will be used if visible.

Member Function Documentation

◆ AddVisibilityNodes()

static void AddVisibilityNodes ( GameObject  go,
NetworkRunner  runner 
)
static

Find all component types that contribute to a scene rendering, and associate them with a RunnerVisibilityNode component, and add them to the runner's list of visibility nodes.

Parameters
go
runner

◆ SetEnabled()

void SetEnabled ( bool  enabled)

Sets the visibility state of this node.

Parameters
enabled