Advertisement
Guest User

Untitled

a guest
Sep 25th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. // first file
  2. using UnityEngine;
  3. using System.Collections.Generic;
  4. using SocketIO;
  5.  
  6. public class Network : MonoBehaviour {
  7.  
  8. static SocketIOComponent socket;
  9.  
  10. void Start()
  11. {
  12. socket = GetComponent<SocketIOComponent>();
  13. socket.On("open", OnConnected);
  14. }
  15.  
  16. void OnConnected(SocketIOEvent e)
  17. {
  18. Debug.Log("connected");
  19. socket.Emit("move");
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement