Example #1
0
 public void Init()
 {
     socket.On("JOIN", OnUserJoin);
     socket.On("CHECK", OnCheck);
     socket.OnEvent("SCENE", OnScene);
     socket.OnEvent("URL", OnOpenUrl);
     socket.OnEvent("APK", OnOpenApk);
     gameController.cameraTracker.OnForwardUpdateHandler = (v3) =>
     {
         JSONObject obj = new JSONObject();
         obj["id"]    = JSONObject.CreateStringObject(SystemInfo.deviceUniqueIdentifier);
         obj["value"] = JSONObject.CreateStringObject(v3.x + "," + v3.y + "," + v3.z);
         socket.EmitEvent("LOOKAT", obj);
     };
 }
Example #2
0
 void Start()
 {
     game   = GameControllerServer.instant;
     socket = SocketController.instant;
     socket.On("JOIN", OnUserJoin);
     socket.On("LEAVE", OnUserLeave);
     socket.On("USERS", OnUsers);
     socket.OnEvent("LOOKAT", OnUserLook);
     socket.OnConnectHandler = ConnectToServer;
 }