LoginSignup
17

More than 5 years have passed since last update.

Unity4からNode.jsのWebSocket接続してみた。

Posted at

Unity4からWebSocket接続してみた。

いろいろ苦戦したが、出来た。

githubからwebsocket-sharpをDL

VS2013でビルドする場合、ビルドターゲットを.netフレームワークバージョン3.5にする
↑これはまった。Unity4は.NETが3.5みたいね。

Unity側のWebSocketクライアント

以下のブログを参考にした
Geisha Tokyo Engineers' Blog
[超簡単]UnityでWebSocketを使ってチャット ~Playと一緒~
http://blob.geishatokyo.com/archives/180003
このブログはScala PlayでWebSocketサーバ作ってた。
ひとまず今回はインストールとかめんどいのでNode.jsで作る。

node.jsのWebSocketサーバ立てる

以下のブログを参考にした
感謝のプログラミング 10000時間 一緒に、プログラミングを学ぼう。
2013-06-10
Node.jsでWebSocketサーバを作ってみる。
http://programming-10000.hatenadiary.jp/entry/20130610/1370844721

で、出来た。

初め、socket.ioでやろうとしたらUnityからつながらなかった。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17