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>();
        }
    }
예제 #2
0
    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>();
        }
    }