Class PlayerCallbacksOrderOnTheHostScript
Inheritance
Inherited Members
Namespace: Global Namespace
Assembly: com.unity.multiplayer-hlapi.Tests.dll
Syntax
public class PlayerCallbacksOrderOnTheHostScript : NetworkBehaviour
Fields
actualListOfCallbacks
Declaration
public List<string> actualListOfCallbacks
Field Value
Type | Description |
---|---|
List<string> |
isDone
Declaration
public bool isDone
Field Value
Type | Description |
---|---|
bool |
Methods
OnRebuildObservers(HashSet<NetworkConnection>, bool)
Callback used by the visibility system to (re)construct the set of observers that can see this object.
Implementations of this callback should add network connections of players that can see this object to the observers set.
Declaration
public override bool OnRebuildObservers(HashSet<NetworkConnection> observers, bool initialize)
Parameters
Type | Name | Description |
---|---|---|
HashSet<NetworkConnection> | observers | The new set of observers for this object. |
bool | initialize | True if the set of observers is being built for the first time. |
Returns
Type | Description |
---|---|
bool | Return true if this function did work. |
Overrides
OnSetLocalVisibility(bool)
Callback used by the visibility system for objects on a host.
Objects on a host (with a local client) cannot be disabled or destroyed when they are not visibile to the local client. So this function is called to allow custom code to hide these objects. A typical implementation will disable renderer components on the object. This is only called on local clients on a host.
Declaration
public override void OnSetLocalVisibility(bool vis)
Parameters
Type | Name | Description |
---|---|---|
bool | vis | New visibility state. |
Overrides
OnStartAuthority()
Declaration
public override void OnStartAuthority()
Overrides
OnStartClient()
Called on every NetworkBehaviour when it is activated on a client.
Objects on the host have this function called, as there is a local client on the host. The values of SyncVars on object are guaranteed to be initialized correctly with the latest state from the server when this function is called on the client.
Declaration
public override void OnStartClient()
Overrides
OnStartLocalPlayer()
Called when the local player object has been set up.
This happens after OnStartClient(), as it is triggered by an ownership message from the server. This is an appropriate place to activate components or functionality that should only be active for the local player, such as cameras and input.
Declaration
public override void OnStartLocalPlayer()
Overrides
OnStartServer()
This is invoked for NetworkBehaviour objects when they become active on the server.
This could be triggered by NetworkServer.Listen() for objects in the scene, or by NetworkServer.Spawn() for objects that are dynamically created.
This will be called for objects on a "host" as well as for object on a dedicated server.
Declaration
public override void OnStartServer()
Overrides
Start()
Declaration
public void Start()