예제 #1
0
파일: Chat.cs 프로젝트: SuwalskiKarol/oor
	void Start () 
	{
		GameObject go = GameObject.Find("SocketIO");
		socket = go.GetComponent<SocketIOComponent>();
		myscript = go.GetComponent<ectScript>();
		socket.On ("talk", ChatMessage);
	}
예제 #2
0
	void Start () 
	{
		GameObject go = GameObject.Find("SocketIO");
		socket = go.GetComponent<SocketIOComponent>();
		myscript = go.GetComponent<ectScript>();
		socket.Emit("LoadMap");
		socket.On("swapAllPlayer",swapAllPlayer);

	}
예제 #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);
	}
예제 #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);
 }