Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
    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");
        });
    }
Exemplo n.º 3
0
    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");
        });
    }
Exemplo n.º 4
0
    // 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());
    }
Exemplo n.º 5
0
    // 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());
    }