Beispiel #1
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");
        });
    }
    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");
        });
    }