/// <summary> /// サーバーへ接続する /// </summary> private void Connect() { System.Threading.Thread.Sleep(1000); ws = new WebSocket("ws://163.221.68.248:8080"); //ws = new WebSocket("ws://localhost:3000"); //イベントハンドラの登録 ws.OnOpen += (sender, e) => { connectionState = 2; Debug.Log("WebSocket Open"); }; ws.OnMessage += (sender, e) => { obj = JsonConvert.DeserializeObject <List <Person> >(e.Data); GetPoi1.Translate(obj); GetPoi2.Translate(obj); GetPoi3.Translate(obj); }; ws.OnError += (sender, e) => { Debug.Log("WebSocket Error Message: " + e.Message); connectionState = 0; }; ws.OnClose += (sender, e) => { connectionState = 0; Debug.Log("WebSocket Close"); }; connectionState = 1; /// サーバー接続開始 ws.Connect(); }