Class SpawningBase_SpawnableObjectScript
Inheritance
Inherited Members
Namespace: Global Namespace
Assembly: com.unity.multiplayer-hlapi.Tests.dll
Syntax
public class SpawningBase_SpawnableObjectScript : NetworkBehaviour
Methods
OnNetworkDestroy()
This is invoked on clients when the server has caused this object to be destroyed.
This can be used as a hook to invoke effects or do client specific cleanup.
using UnityEngine;
using UnityEngine.Networking;
class Bomb :
{
public override void OnNetworkDestroy()
{
// play explosion sound
}
}</code></pre>
Declaration
public override void OnNetworkDestroy()
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
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()