// GUI functions public static void displayHeader() { GUIStyle whiteGround = new GUIStyle(GUI.skin.box); whiteGround.normal.background = SketchfabUI.MakeTex(2, 2, new Color(1f, 1f, 1f, 1f)); GUILayout.BeginHorizontal(whiteGround, GUILayout.Height(75)); _logger.showLoginUi(); GUILayout.FlexibleSpace(); // If banner available, display it if (bannerTexture != null) { GUILayout.BeginVertical(); GUILayout.FlexibleSpace(); if (GUILayout.Button(bannerTexture, _ui.getSketchfabLabel())) { Application.OpenURL(Urls.storeUrl); } GUILayout.FlexibleSpace(); GUILayout.EndVertical(); } GUILayout.FlexibleSpace(); GUILayout.BeginVertical(); GUILayout.FlexibleSpace(); GUILayout.Label(Resources.Load("SketchfabGrey") as Texture2D, GUILayout.Height(40), GUILayout.Width(190)); GUILayout.FlexibleSpace(); GUILayout.EndVertical(); GUILayout.EndHorizontal(); }
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(); }
// GUI functions public static void displayHeader() { GUIStyle whiteGround = new GUIStyle(GUI.skin.box); whiteGround.normal.background = SketchfabUI.MakeTex(2, 2, new Color(1f, 1f, 1f, 1f)); GUILayout.BeginHorizontal(whiteGround, GUILayout.Height(75)); _logger.showLoginUi(); GUILayout.FlexibleSpace(); GUILayout.BeginVertical(); GUILayout.FlexibleSpace(); GUILayout.Label(Resources.Load("SketchfabGrey") as Texture2D, GUILayout.Height(40), GUILayout.Width(190)); GUILayout.FlexibleSpace(); GUILayout.EndVertical(); GUILayout.EndHorizontal(); }
private void OnGUI() { if (_currentModel != null && show) { _scrollView = GUILayout.BeginScrollView(_scrollView); SketchfabModel model = _currentModel; GUILayout.BeginHorizontal(); GUILayout.BeginVertical(); _ui.displayModelName(model.name); _ui.displayContent("by " + model.author); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); if (GUILayout.Button("View on Sketchfab")) { Application.OpenURL(SketchfabPlugin.Urls.modelUrl + "/" + _currentModel.uid); } GUILayout.EndHorizontal(); GUIStyle blackGround = new GUIStyle(GUI.skin.box); blackGround.normal.background = SketchfabUI.MakeTex(2, 2, new Color(0f, 0f, 0f, 1f)); GUILayout.BeginHorizontal(blackGround); GUILayout.FlexibleSpace(); if (PlayerSettings.colorSpace == ColorSpace.Linear) { bool backup = GL.sRGBWrite; GL.sRGBWrite = true; GUILayout.Label(model._preview); GL.sRGBWrite = backup; } else { GUILayout.Label(model._preview); } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); displayImportSettings(); GUILayout.Label(""); GUILayout.BeginHorizontal(); GUILayout.BeginVertical(GUILayout.Width(250)); _ui.displayTitle("MODEL INFORMATION"); _ui.displayModelStats("Vertex count", " " + Utils.humanifySize(model.vertexCount)); _ui.displayModelStats("Face count", " " + Utils.humanifySize(model.faceCount)); if (model.hasAnimation != "") { _ui.displayModelStats("Animation", model.hasAnimation); } GUILayout.EndVertical(); GUILayout.BeginVertical(GUILayout.Width(300)); _ui.displayTitle("LICENSE"); if (model.licenseJson != null) { _ui.displayContent(model.licenseJson["fullName"]); _ui.displaySubContent(model.licenseJson["requirements"]); } else { _ui.displaySubContent("Fetching license data"); } GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.EndScrollView(); } }
private void OnGUI() { if (_currentModel != null && show) { _scrollView = GUILayout.BeginScrollView(_scrollView); SketchfabModel model = _currentModel; GUILayout.BeginHorizontal(); GUILayout.BeginVertical(); _ui.displayModelName(model.name); _ui.displayContent("by " + model.author); GUILayout.BeginHorizontal(); GUIContent viewSkfb = new GUIContent("View on Sketchfab", _ui.SKETCHFAB_ICON); if (GUILayout.Button(viewSkfb, GUILayout.Height(24), GUILayout.Width(140))) { Application.OpenURL(SketchfabPlugin.Urls.modelUrl + "/" + _currentModel.uid); } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUIStyle blackGround = new GUIStyle(GUI.skin.box); blackGround.normal.background = SketchfabUI.MakeTex(2, 2, new Color(0f, 0f, 0f, 1f)); GUILayout.BeginHorizontal(blackGround); GUILayout.FlexibleSpace(); GUILayout.Label(model._preview); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); displayImportSettings(); GUILayout.Label(""); GUILayout.BeginHorizontal(); GUILayout.BeginVertical(GUILayout.Width(250)); _ui.displayTitle("MODEL INFORMATION"); _ui.displayModelStats("Vertex count", " " + Utils.humanifySize(model.vertexCount)); _ui.displayModelStats("Face count", " " + Utils.humanifySize(model.faceCount)); if (model.hasAnimation != "") { _ui.displayModelStats("Animation", model.hasAnimation); } GUILayout.EndVertical(); GUILayout.BeginVertical(GUILayout.Width(300)); _ui.displayTitle("LICENSE"); if (model.licenseJson != null && model.licenseJson["fullName"] != null) { _ui.displayContent(model.licenseJson["fullName"]); _ui.displaySubContent(model.licenseJson["requirements"]); } else if (model.vertexCount != 0) { _ui.displayContent("Personal"); _ui.displaySubContent("You own this model"); } else { _ui.displaySubContent("Fetching license data"); } GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.EndScrollView(); } }