Class Network
- Namespace
- Netick
- Assembly
- Netick.dll
[HideInInspector]
[DisallowMultipleComponent]
public sealed class Network : MonoBehaviour
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourNetwork
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.useGUILayoutMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.GetComponent<T>()Component.TryGetComponent<T>(out T)Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentInParent<T>()Component.GetComponentsInParent<T>()Component.GetComponents<T>()Component.transformComponent.gameObjectComponent.tagObject.GetInstanceID()Object.GetHashCode()Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectOfType<T>()Object.ToString()Object.nameObject.hideFlags
- Extension Methods
Properties
Instance
public static Network Instance { get; }
Property Value
IsHeadless
public static bool IsHeadless { get; }
Property Value
IsRunning
public static bool IsRunning { get; }
Property Value
StartMode
public StartMode StartMode { get; }
Property Value
Version
public static string Version { get; }
Property Value
Methods
Focus(NetworkSandbox)
Focus on a specific sandbox.
public static void Focus(NetworkSandbox sandbox)
Parameters
sandboxNetworkSandboxThe sandbox to focus on.
Init(NetworkTransport, NetickConfig, int)
Initializes Netick. This is automatically called when you start Netick.
If you don't provide a NetickConfig, Netick will use the default config, which can be modified/found in (Netick -> Settings).
If you don't provide a NetworkTransport, Netick will use the transport assigned in (Netick -> Settings -> Transport).
public static void Init(NetworkTransport transport = null, NetickConfig config = null, int sceneBuildIndex = -1)
Parameters
transportNetworkTransportconfigNetickConfigsceneBuildIndexint
Shutdown(bool)
Shuts down Netick and destroys all sandboxes. The shutdown will occur in the next frame. For immediate shutdown, use: ShutdownImmediately(bool)
public static void Shutdown(bool destroyAllNetworkObjects = false)
Parameters
destroyAllNetworkObjectsbool
ShutdownImmediately(bool)
Shuts down Netick and destroys all sandboxes immediately.
public static void ShutdownImmediately(bool destroyAllNetworkObjects = false)
Parameters
destroyAllNetworkObjectsbool
ShutdownSandbox(NetworkSandbox, bool)
Shuts down a specific sandbox.
public static void ShutdownSandbox(NetworkSandbox sandbox, bool destroyAllNetworkObjects = false)
Parameters
sandboxNetworkSandboxThe sandbox to shut down.
destroyAllNetworkObjectsbool
StartAsClient(int, GameObject)
Starts Netick as a client.
public static NetworkSandbox StartAsClient(int port, GameObject prefab = null)
Parameters
portintprefabGameObject
Returns
- NetworkSandbox
The sandbox representing the client
StartAsServer(int, GameObject)
Starts Netick as a server.
public static NetworkSandbox StartAsServer(int port, GameObject prefab = null)
Parameters
portintNetwork port.
prefabGameObject
Returns
- NetworkSandbox
The sandbox representing the server
StartAsServerAndClient(int, GameObject, int)
Starts both a client (or clients) and a server.
public static Network.Sandboxs StartAsServerAndClient(int serverPort, GameObject prefab = null, int numOfClients = 1)
Parameters
serverPortintNetwork port.
prefabGameObjectnumOfClientsintNumber of client sandboxs to create.