private void Initialize() { SketchfabPlugin.Initialize(); _importer = new SketchfabImporter(UpdateProgress, OnFinishImport); _unzippedFiles = new List <string>(); _unzipDirectory = Application.temporaryCachePath + "/unzip"; _defaultImportDirectory = Application.dataPath + "/Import"; _importDirectory = _defaultImportDirectory; _importFilePath = _sourceFileHint; _ui = SketchfabPlugin.getUI(); }
private void checkValidity() { if (_ui == null) { _ui = SketchfabPlugin.getUI(); } if (_api == null) { _api = SketchfabPlugin.getAPI(); } if (_logger == null) { _logger = SketchfabPlugin.getLogger(); } }
public void displayModelPage(SketchfabModel model, SketchfabBrowser browser) { _window = browser; if (_currentModel == null || model.uid != _currentModel.uid) { _currentModel = model; _prefabName = GLTFUtils.cleanName(_currentModel.name).Replace(" ", "_"); _importDirectory = Application.dataPath + "/Import/" + _prefabName.Replace(" ", "_"); } else { _currentModel = model; } _ui = SketchfabPlugin.getUI(); show = true; }
private void checkValidity() { if (_browserManager == null) { _browserManager = new SketchfabBrowserManager(OnRefreshUpdate, true); resetFilters(); _currentUid = ""; _categoryName = ""; _categoriesNames = new string[0]; // Setup sortBy _sortBy = new string[] { "Relevance", "Likes", "Views", "Recent" }; _polyCount = new string[] { "Any", "Up to 10k", "10k to 50k", "50k to 100k", "100k to 250k", "250k +" }; this.Repaint(); GL.sRGBWrite = true; } SketchfabPlugin.checkValidity(); _ui = SketchfabPlugin.getUI(); _logger = SketchfabPlugin.getLogger(); }
private void checkValidity() { if (_browserManager == null) { _browserManager = new SketchfabBrowserManager(OnRefreshUpdate, true); resetFilters(); _currentUid = ""; _categoryName = ""; _categoriesNames = new string[0]; // Setup sortBy _sortBy = new string[] { "Relevance", "Likes", "Views", "Recent" }; _polyCount = new string[] { "Any", "Up to 10k", "10k to 50k", "50k to 100k", "100k to 250k", "250k +" }; _searchIn = new string[] { "free downloadable", "my models", "store purchases" }; _license = new string[] { "any", "CC BY", "CC BY SA", "CC BY-ND", "CC BY-NC", "CC BY-NC-SA", "CC BY-NC-ND", "CC0" }; // No search for store models so only CC licenses here this.Repaint(); GL.sRGBWrite = true; } SketchfabPlugin.checkValidity(); _ui = SketchfabPlugin.getUI(); _logger = SketchfabPlugin.getLogger(); }
void displayUpgradeToPro() { GUIStyle whiteBackground = new GUIStyle(GUI.skin.box); whiteBackground.normal.background = SketchfabUI.MakeTex(2, 2, Color.white); GUILayout.BeginVertical(whiteBackground, GUILayout.Height(75)); GUILayout.FlexibleSpace(); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Label("<b>Gain full API access</b> to your personal library of 3D models", SketchfabPlugin.getUI().getSketchfabBigLabel(), GUILayout.Height(48)); GUILayout.FlexibleSpace(); Color old = GUI.color; GUI.color = Color.white; GUIStyle whitebackground = new GUIStyle(GUI.skin.button); whitebackground.richText = true; whitebackground.normal.background = SketchfabUI.MakeTex(2, 2, SketchfabUI.SKFB_BLUE); string buttonCaption = "<color=" + Color.white + "><b>Upgrade to PRO</b></color>"; if (GUILayout.Button(buttonCaption, whitebackground, GUILayout.Height(48), GUILayout.Width(225))) { Application.OpenURL(SketchfabPlugin.Urls.plans); } GUI.color = old; GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); GUILayout.EndVertical(); }
void displayFooter() { GUILayout.BeginVertical(GUILayout.Height(75)); { GUILayout.FlexibleSpace(); GUILayout.BeginHorizontal(); { GUILayout.FlexibleSpace(); Color old = GUI.color; GUIStyle whitebackground = new GUIStyle(GUI.skin.button); whitebackground.richText = true; GUILayout.Label("<b>Gain full API access</b> to your personal library of 3D models", SketchfabPlugin.getUI().getSketchfabBigLabel(), GUILayout.Height(48)); GUILayout.FlexibleSpace(); if (GUILayout.Button("Upgrade to PRO", GUILayout.Height(48), GUILayout.Width(225))) { Application.OpenURL(SketchfabPlugin.Urls.plans); } GUI.color = old; GUILayout.FlexibleSpace(); } GUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); } GUILayout.EndVertical(); }