private void showPrivate() { if (!_logger.canPrivate()) { if (_logger.isUserBasic()) { GUILayout.BeginHorizontal(); GUILayout.BeginVertical(); GUILayout.FlexibleSpace(); GUIContent content = new GUIContent(" features", SketchfabUI.getPlanIcon("pro")); GUILayout.Label(content, EditorStyles.boldLabel, GUILayout.Height(12)); GUILayout.FlexibleSpace(); GUILayout.EndVertical(); GUILayout.BeginVertical(); GUILayout.FlexibleSpace(); if (GUILayout.Button("Upgrade your account", GUILayout.Height(18))) { Application.OpenURL(SketchfabPlugin.Urls.plans); } GUILayout.FlexibleSpace(); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } else { if (GUILayout.Button("(You cannot set any other model to private (limit reached))", _ui.getSketchfabClickableLabel(), GUILayout.Height(20))) { Application.OpenURL(SketchfabPlugin.Urls.plans); } } } else { GUILayout.Label("Set the model to Private", EditorStyles.centeredGreyMiniLabel); } GUI.enabled = _logger.canPrivate(); EditorGUILayout.BeginVertical("Box"); GUILayout.BeginHorizontal(); param_private = EditorGUILayout.Toggle("Private model", param_private); if (GUILayout.Button("more info", _ui.getSketchfabClickableLabel(), GUILayout.Height(20))) { Application.OpenURL(SketchfabPlugin.Urls.privateInfo); } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUI.enabled = param_private; GUILayout.Label("Password"); param_password = EditorGUILayout.TextField(param_password); EditorGUILayout.EndVertical(); GUI.enabled = true; }
private void showPrivate() { if (!_logger.canPrivate()) { if (_logger.isUserBasic()) { if (GUILayout.Button("(" + SketchfabUI.ClickableTextColor("Upgrade to a paid account to set your model to private") + ")", _ui.SkfbClickableLabel, GUILayout.Height(20))) { Application.OpenURL(SketchfabPlugin.Urls.plans); } } else { if (GUILayout.Button("(" + SketchfabUI.ClickableTextColor("You cannot set any other model to private (limit reached)") + ")", _ui.SkfbClickableLabel, GUILayout.Height(20))) { Application.OpenURL(SketchfabPlugin.Urls.plans); } } } else { GUILayout.Label("Set the model to Private", EditorStyles.centeredGreyMiniLabel); } GUI.enabled = _logger.canPrivate(); EditorGUILayout.BeginVertical("Box"); GUILayout.BeginHorizontal(); param_private = EditorGUILayout.Toggle("Private model", param_private); if (GUILayout.Button("( " + SketchfabUI.ClickableTextColor("more info") + ")", _ui.SkfbClickableLabel, GUILayout.Height(20))) { Application.OpenURL(SketchfabPlugin.Urls.privateInfo); } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUI.enabled = param_private; GUILayout.Label("Password"); param_password = EditorGUILayout.TextField(param_password); EditorGUILayout.EndVertical(); GUI.enabled = true; }
void displaySearchBox() { GUILayout.BeginHorizontal(); GUILayout.Label("Search:", GUILayout.Width(80)); GUI.SetNextControlName("SearchTextField"); _query = EditorGUILayout.TextField(_query, GUILayout.Width(350)); if (Event.current.keyCode == KeyCode.Return && GUI.GetNameOfFocusedControl() == "SearchTextField") { triggerSearch(); } if (GUILayout.Button("Search", GUILayout.Width(120))) { triggerSearch(); } GUILayout.FlexibleSpace(); bool previous = _myModels; GUIContent content = _logger.isUserBasic() ? new GUIContent("My Models", SketchfabUI.getPlanIcon("pro")) : new GUIContent("My Models"); bool previousState = GUI.enabled; GUI.enabled = SketchfabPlugin.getLogger().isUserLogged(); _myModels = GUILayout.Toggle(_myModels, content, GUILayout.Height(18)); GUI.enabled = previousState; if (_myModels != previous) { if (_myModels) { resetFilersOwnModels(); } else { resetFilters(); } triggerSearch(); } GUILayout.EndHorizontal(); }