Class NetworkProximityChecker
Component that controls visibility of networked objects for players.
Any object with this component on it will not be visible to players more than a (configurable) distance away.
Inheritance
NetworkProximityChecker
Inherited Members
UnityEngine.Component.guiText
UnityEngine.Component.guiElement
UnityEngine.Component.guiTexture
Namespace: UnityEngine.Networking
Syntax
[AddComponentMenu("Network/NetworkProximityChecker")]
[RequireComponent(typeof(NetworkIdentity))]
[Obsolete("The high level API classes are deprecated and will be removed in the future.")]
public class NetworkProximityChecker : NetworkBehaviour
Fields
checkMethod
Which method to use for checking proximity of players.
Declaration
[Tooltip("Which method to use for checking proximity of players.\n\nPhysics3D uses 3D physics to determine proximity.\n\nPhysics2D uses 2D physics to determine proximity.")]
public NetworkProximityChecker.CheckMethod checkMethod
Field Value
Type | Description |
---|---|
NetworkProximityChecker.CheckMethod |
forceHidden
Flag to force this object to be hidden for players.
If this object is a player object, it will not be hidden for that player.
Declaration
[Tooltip("Enable to force this object to be hidden from players.")]
public bool forceHidden
Field Value
Type | Description |
---|---|
Boolean |
visRange
The maximim range that objects will be visible at.
Declaration
[Tooltip("The maximum range that objects will be visible at.")]
public int visRange
Field Value
Type | Description |
---|---|
Int32 |
visUpdateInterval
How often (in seconds) that this object should update the set of players that can see it.
Declaration
[Tooltip("How often (in seconds) that this object should update the set of players that can see it.")]
public float visUpdateInterval
Field Value
Type | Description |
---|---|
Single |
Methods
OnCheckObserver(NetworkConnection)
Declaration
public override bool OnCheckObserver(NetworkConnection newObserver)
Parameters
Type | Name | Description |
---|---|---|
NetworkConnection | newObserver |
Returns
Type | Description |
---|---|
Boolean |
Overrides
OnRebuildObservers(HashSet<NetworkConnection>, Boolean)
Declaration
public override bool OnRebuildObservers(HashSet<NetworkConnection> observers, bool initial)
Parameters
Type | Name | Description |
---|---|---|
HashSet<NetworkConnection> | observers | |
Boolean | initial |
Returns
Type | Description |
---|---|
Boolean |
Overrides
OnSetLocalVisibility(Boolean)
Declaration
public override void OnSetLocalVisibility(bool vis)
Parameters
Type | Name | Description |
---|---|---|
Boolean | vis |