Ejemplo n.º 1
0
	void Start () 
	{
		GameObject go = GameObject.Find("SocketIO");
		socket = go.GetComponent<SocketIOComponent>();
		myscript = go.GetComponent<ectScript>();
		socket.On ("talk", ChatMessage);
	}
Ejemplo n.º 2
0
	void Start () 
	{
		GameObject go = GameObject.Find("SocketIO");
		socket = go.GetComponent<SocketIOComponent>();
		myscript = go.GetComponent<ectScript>();
		socket.Emit("LoadMap");
		socket.On("swapAllPlayer",swapAllPlayer);

	}
Ejemplo n.º 3
0
	void Start()
	{
		DontDestroyOnLoad (gameObject);
		GameObject go = GameObject.Find("SocketIO");
		socket = go.GetComponent<SocketIOComponent>();
		myscript = go.GetComponent<ectScript>();
		socket.On("open", ServerOpen);
		socket.On("error", ServerError);
		socket.On("close", ServerClose);
		socket.On("loginSuccess",loginSuccess);
		socket.On("loginUnsuccess",loginUnsuccess);
		socket.On("swapPlayer",swapPlayer);
		socket.On ("PlayerMove", PlayerMove);
		socket.On ("Playerdisconnected", Playerdisconnected);
		socket.On ("registersuccess", registersuccess);
		socket.On ("registerunsuccess", registerunsuccess);
	}
Ejemplo n.º 4
0
 //private ectScript myscript;
 //public string PlayerName;
 //public bool xx;
 //public StatusPlayer Player;
 //public GameObject otherPlayer;
 //private bool Login = true;
 //private string MessLogin = "******";
 //private string MessRegister = " ";
 //public int selectColor = 0;
 //private string[] OptionColor = new string[]{"red","green","blue"};
 //string reName = "";
 // Use this for initialization
 void Start()
 {
     DontDestroyOnLoad (gameObject);
     GameObject go = GameObject.Find("SocketIO");
     socket = go.GetComponent<SocketIOComponent>();
     myscript = go.GetComponent<ectScript>();
     socket.On("loginUnsuccess", loginUnsuccess);
     socket.On("loginSuccess", loginSuccess);
     socket.On ("nuevaposicion", PlayerMove);
     socket.On ("swapPlayer", swapPlayer);
     socket.On ("swapAllPlayer", swapAllPlayer);
 }