public void OnRegisterClick() { if (RegisterPanel.IsValid()) { var json = new JSONObject(); json.AddField("username", RegisterPanel.Username.text); json.AddField("password", RegisterPanel.Password.text); json.AddField("email", RegisterPanel.Email.text); Connection.SendMessage(MessageCode.Register, json); } }
void Start() { Connection = FindObjectOfType <ConnectionController>(); if (Connection == null || !Connection.IsConnected) { Application.LoadLevel("login"); return; } Connection.SendMessage(MessageCode.GameLoad, new JSONObject(), m => { var posData = m.GetField("position"); var position = HelperMethods.PositionFromJSONArray(posData); var loadingData = new ZoneLoadData(position, "Super WOrld", "world"); PersistentData.ZoneLoadData = loadingData; Application.LoadLevel("gameplay"); }); }
void Start() { Connection = FindObjectOfType<ConnectionController>(); if (Connection == null || !Connection.IsConnected) { Application.LoadLevel("login"); return; } Connection.SendMessage(MessageCode.GameLoad, new JSONObject(), m => { var posData = m.GetField("position"); var position = HelperMethods.PositionFromJSONArray(posData); var loadingData = new ZoneLoadData(position, "Super WOrld", "world"); PersistentData.ZoneLoadData = loadingData; Application.LoadLevel("gameplay"); }); }
// Use this for initialization void Start() { Connection = FindObjectOfType<ConnectionController>(); if (Connection == null || !Connection.IsConnected) { Application.LoadLevel("login"); return; } var gatewayConnectionListener = new GenericConnectionListener(UpdateConnectionStatus); gatewayConnectionListener.SetMessageListener(this); Connection.SetConnectionListener(gatewayConnectionListener); DontDestroyOnLoad(this); DontDestroyOnLoad(Player); // Setup player Player.transform.position = PersistentData.ZoneLoadData.PlayerPosition; Application.LoadLevel("world"); Connection.SendMessage(MessageCode.PlayerInGame, new JSONObject()); }
// Use this for initialization void Start() { Connection = FindObjectOfType <ConnectionController>(); if (Connection == null || !Connection.IsConnected) { Application.LoadLevel("login"); return; } var gatewayConnectionListener = new GenericConnectionListener(UpdateConnectionStatus); gatewayConnectionListener.SetMessageListener(this); Connection.SetConnectionListener(gatewayConnectionListener); DontDestroyOnLoad(this); DontDestroyOnLoad(Player); // Setup player Player.transform.position = PersistentData.ZoneLoadData.PlayerPosition; Application.LoadLevel("world"); Connection.SendMessage(MessageCode.PlayerInGame, new JSONObject()); }