public static void CreateInstance() { if (instance == null) { GameObject connectorObject = GameObject.Find("MultiplayerConnector"); if (connectorObject == null) { connectorObject = new GameObject("MultiplayerConnector"); connectorObject.AddComponent <MultiplayerConnector>(); } instance = connectorObject.GetComponent <MultiplayerConnector>(); } }
public static void CreateInstance() { if (_instance == null) { GameObject connectorObject = GameObject.Find("MultiplayerConnector"); if (connectorObject == null) { connectorObject = new GameObject("MultiplayerConnector"); connectorObject.AddComponent<MultiplayerConnector>(); } _instance = connectorObject.GetComponent<MultiplayerConnector>(); } }