Beispiel #1
0
        static public SensorsManager Instance()
        {
            if (m_instance == null)
            {
                m_instance = new SensorsManager();
            }

            return(m_instance);
        }
Beispiel #2
0
        public BasicSensorsProtocol(SensorsManager sensors)
        {
            Sensors = sensors;
            State   = ProtocolState.DisconnectedState;

            _webSocket = new WebSocket(_webSocketUrl);

            _webSocket.OnClose += ConnectionClosedThreaded;
            _webSocket.OnError += ConnectionClosedThreaded;
            _webSocket.OnOpen  += ConnectionOpenedThreaded;

            ConnectToWebSocket();
        }
Beispiel #3
0
 public void Start()
 {
     SensorsManager.Instance().RegisterSensor(this);
 }
Beispiel #4
0
 SensorsManager()
 {
     m_instance = this;
     _protocol  = Main.Factory.CreateSensorsProtocol(this);
 }
Beispiel #5
0
 void Init()
 {
     gameObject.AddComponent(typeof(UnityMainThreadDispatcher));
     _sensorsManager = SensorsManager.Instance();
 }