Example #1
0
        public void requestCanPrivate()
        {
            SketchfabRequest canPrivateRequest = new SketchfabRequest(SketchfabPlugin.Urls.userAccount, getHeader());

            canPrivateRequest.setCallback(onCanPrivate);
            SketchfabPlugin.getAPI().registerRequest(canPrivateRequest);
        }
Example #2
0
        // Manager integrity and reset
        private void checkValidity()
        {
            SketchfabPlugin.checkValidity();
            if (_api == null)
            {
                _api = SketchfabPlugin.getAPI();
            }

            if (_resultUids == null)
            {
                _resultUids = new List <string>();
            }

            if (_sketchfabModels == null)
            {
                _sketchfabModels = new Dictionary <string, SketchfabModel>();
            }

            if (_categories == null)
            {
                fetchCategories();
            }

            if (_importer == null)
            {
                _importer = new SketchfabImporter(ImportProgress, ImportFinish);
            }
        }
Example #3
0
        void requestArchive()
        {
            SketchfabRequest request = new SketchfabRequest(_archiveUrl);

            request.setCallback(handleArchive);
            request.setProgressCallback(handleDownloadCallback);
            SketchfabPlugin.getAPI().registerRequest(request);
        }
        void requestArchive(string modelUrl)
        {
            SketchfabRequest request = new SketchfabRequest(_currentModel.tempDownloadUrl);

            request.setCallback(handleArchive);
            request.setProgressCallback(handleDownloadCallback);
            SketchfabPlugin.getAPI().registerRequest(request);
        }
Example #5
0
        public void requestUserData()
        {
            Dictionary <string, string> headers = new Dictionary <string, string>();

            headers.Add("Authorization", "Bearer " + EditorPrefs.GetString(accessTokenKey));
            SketchfabRequest request = new SketchfabRequest(SketchfabPlugin.Urls.userMe, headers);

            request.setCallback(handleUserData);
            request.setFailedCallback(logout);
            SketchfabPlugin.getAPI().registerRequest(request);
        }
Example #6
0
        public void requestAccessToken(string user_name, string user_password)
        {
            List <IMultipartFormSection> formData = new List <IMultipartFormSection>();

            formData.Add(new MultipartFormDataSection("username", user_name));
            formData.Add(new MultipartFormDataSection("password", user_password));

            SketchfabRequest tokenRequest = new SketchfabRequest(SketchfabPlugin.Urls.oauth, formData);

            tokenRequest.setCallback(handleGetToken);
            tokenRequest.setFailedCallback(onLoginFailed);
            SketchfabPlugin.getAPI().registerRequest(tokenRequest);
        }
Example #7
0
 private void checkValidity()
 {
     if (_ui == null)
     {
         _ui = SketchfabPlugin.getUI();
     }
     if (_api == null)
     {
         _api = SketchfabPlugin.getAPI();
     }
     if (_logger == null)
     {
         _logger = SketchfabPlugin.getLogger();
     }
 }
Example #8
0
        public void requestAvatar(string url)
        {
            string access_token = EditorPrefs.GetString(accessTokenKey);

            if (access_token == null || access_token.Length < 30)
            {
                Debug.Log("Access token is invalid or inexistant");
                return;
            }

            Dictionary <string, string> headers = new Dictionary <string, string>();

            headers.Add("Authorization", "Bearer " + access_token);
            SketchfabRequest request = new SketchfabRequest(url, headers);

            request.setCallback(handleAvatar);
            SketchfabPlugin.getAPI().registerRequest(request);
        }
        // Manager integrity and reset
        private void checkValidity()
        {
            SketchfabPlugin.checkValidity();
            if (_api == null)
            {
                _api = SketchfabPlugin.getAPI();
            }

            if (_sketchfabModels == null)
            {
                _sketchfabModels = new OrderedDictionary();
            }

            if (_categories == null)
            {
                fetchCategories();
            }

            if (_importer == null)
            {
                _importer = new SketchfabImporter(ImportProgress, ImportFinish);
            }
        }