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

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

            DontDestroyOnLoad(this);
            Instance = this;
        }
示例#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;
        }