This is a helper class for testing only. It implements the same IBasicNetwork interface as WebRTCNetwork but works on all Unity platforms. You can use this class to test your network in Unity without having to build a browser version. This class will be replaced by a C++ WebRTC library in the future, until then you won't be able to connect to browsers from the editor! This class isn't very well designed and uses the old deprecated unity network.
Inheritance: UnityEngine.MonoBehaviour, IBasicNetwork
Example #1
0
        public static UnityNetwork Get()
        {
            if (sInstance == null)
            {
                GameObject  go   = new GameObject("UnityNetwork");
                NetworkView view = go.AddComponent <NetworkView>();
                view.stateSynchronization = NetworkStateSynchronization.Off;

                sInstance = go.AddComponent <UnityNetwork>();
            }

            return(sInstance);
        }
Example #2
0
        public static UnityNetwork Get()
        {
            if (sInstance == null)
            {
                GameObject go = new GameObject("UnityNetwork");
                NetworkView view = go.AddComponent<NetworkView>();
                view.stateSynchronization = NetworkStateSynchronization.Off;

                sInstance = go.AddComponent<UnityNetwork>();
            }

            return sInstance;
        }