public static abstract sealed class Editor.EditorUtility.Network
Related Guides
Broader workflow and conceptual references connected to this API.
s&box has a [CodeGenerator] attribute that you can use to decorate another attribute specifically for use with methods and properties. It lets you wrap methods and properties to perform some other action when the method is called or the property is set or to return a different value when the property is read.
Allows a GameObject's Components to listen to changes in ownership state.
Your games will likely want to react to people joining and leaving the game. To help with this you can implement Component.INetworkListener or Component.INetworkSpawn on a component and place it in the scene.
Any game object can become a networked object by simply calling NetworkSpawn() on it. It will then be sent to all clients and can have Sync Properties and RPC Messages.
Networked GameObjects can be owned by a connection.
There are various interfaces that can be given to components for specific purposes.
Methods
Showing 3 methods
public static void Connect(string address)
Connenct to a network address
public static void Disconnect()
Disconnect from the current network session
public static void StartHosting()
Start hosting a lobby. If we're not already in play mode, we'll enter play mode first.
No results match this filter.
Properties
Showing 6 properties
public static bool Editor.EditorUtility.Network.Active { get; set; }
True if the network system is active
public static Sandbox.Connection[] Editor.EditorUtility.Network.Channels { get; set; }
Return all of the channels on this connection. If you're the host, it should return all client connections. If you're the client, it should return empty - unless you're in a p2p session (lobby). Returns empty if you're not connected
public static bool Editor.EditorUtility.Network.Client { get; set; }
True if the network system is active and we're the host
public static bool Editor.EditorUtility.Network.Hosting { get; set; }
True if the network system is active and we're the host
public static Sandbox.Network.LobbyPrivacy Editor.EditorUtility.Network.HostPrivacy { get; set; }
Determines who can join a lobby hosted from the editor. Should only be set before creating a lobby. Persists between lobbies.
public static Sandbox.Network.NetworkSocket[] Editor.EditorUtility.Network.Sockets { get; set; }
Return all of the sockets on this connection. If you're the host, it should return all active sockets. If you're the client, it should return empty - unless you're in a p2p session (lobby). Returns empty if you're not connected
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | global |
| Type | class |
| Assembly | Sandbox.Tools |
| Doc ID | T:Editor.EditorUtility.Network |