Example #1
0
        void Awake()
        {
            if (Instance != null)
            {
                DestroyImmediate(this);
                return;
            }

            Server = new WebSocketServer(Port);
            Server.AddWebSocketService <SimulatorClient>("/");
            Server.Start();

            DontDestroyOnLoad(this);
            Instance = this;
        }
Example #2
0
        void Awake()
        {
            groundLayer = LayerMask.NameToLayer("Ground And Road");

            if (Instance != null)
            {
                DestroyImmediate(this);
                return;
            }

            Server = new WebSocketServer(Port);
            Server.AddWebSocketService <SimulatorClient>("/");
            Server.Start();

            DontDestroyOnLoad(gameObject);
            Instance = this;
        }