private void DrawQuestionProperties(int currentQuestion) { EditorGUILayout.BeginVertical(); GUILayout.Space(30); GUIStyle style = GeneralMethods.CreateBasicGUIStyle(EditorStyles.label, LightWhite, Color.white); EditorGUILayout.BeginVertical(style, GUILayout.Width(250)); questionPropertiesScrollPosition = GUILayout.BeginScrollView(questionPropertiesScrollPosition, false, false, GUILayout.Width(350), GUILayout.Height(290)); SerializedProperty keywords = questions.GetArrayElementAtIndex(currentQuestion).FindPropertyRelative("keywords"); string id = GetKeyword(keywords, 0) + ", " + GetKeyword(keywords, 1); currentQuestion = Mathf.Clamp(currentQuestion, 0, questions.arraySize); try { SerializedProperty Question = questions.GetArrayElementAtIndex(currentQuestion); if (Question != null) { EditorGUILayout.PropertyField(Question, new GUIContent(id)); } } catch (System.Exception) { } GUILayout.Space(140); DrawDeleteBox(); GUILayout.Space(30); GUILayout.EndScrollView(); EditorGUILayout.EndVertical(); GUILayout.Space(10); EditorGUILayout.EndVertical(); }
private void DrawQuestionList(SerializedProperty selectedQuestion) { GUIStyle style = GeneralMethods.CreateBasicGUIStyle(EditorStyles.label, DarkWhite, Color.white); EditorGUILayout.BeginVertical(style, GUILayout.Width(550)); EditorGUILayout.BeginHorizontal(); EditorGUILayout.BeginVertical(); EditorGUILayout.LabelField("Questions", blackBoldFont, GUILayout.Width(100), GUILayout.Height(25)); int boxHeight = 260; GUILayout.Space(10); if (GUILayout.Button("Add Question", AddQuestionButton)) { TestCreator.Instance.AddQuestion(); } GUILayout.Space(10); questionsScrollPosition = GUILayout.BeginScrollView(questionsScrollPosition, false, false, GUILayout.Width(185), GUILayout.Height(boxHeight)); DrawQuestionIDList(selectedQuestion); GUILayout.EndScrollView(); EditorGUILayout.EndVertical(); GUILayout.Space(10); DrawQuestionProperties(selectedQuestion.intValue); GUILayout.Space(10); EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); }
private void SetGUIStyles() { boldWhiteFont = new GUIStyle(EditorStyles.label); boldWhiteFont.normal.textColor = Color.white; boldWhiteFont.fontStyle = FontStyle.BoldAndItalic; boldWhiteFont.fontSize = 14; NormalButtonStyle = GeneralMethods.CreateBasicGUIStyle(EditorStyles.label, LightGrey, Color.white); SelectedButtonStyle = GeneralMethods.CreateBasicGUIStyle(EditorStyles.label, LightBlack, Color.white); AddTestButton = GeneralMethods.CreateBasicGUIStyle(GUI.skin.button, new Color(0.35f, 0.81f, 0.38f), Color.white); }
public void DrawTest(SerializedProperty test) { SetTestVariables(test); GUIStyle style = GeneralMethods.CreateBasicGUIStyle(EditorStyles.label, DarkWhite, Color.white); EditorGUILayout.BeginVertical(style, GUILayout.Width(200)); DrawTestVariables(); GUILayout.Space(70); CreateWarningBox(); GUILayout.Space(25); EditorGUILayout.EndVertical(); }
private void SetGUIStyles() { blackBoldFont = new GUIStyle(EditorStyles.label); blackBoldFont.normal.textColor = Color.black; blackBoldFont.fontStyle = FontStyle.BoldAndItalic; blackBoldFont.fontSize = 14; warningButtonStyle = new GUIStyle(GUI.skin.button); warningButtonStyle.normal.background = GeneralMethods.GetTexture(new Color(1f, 0.5f, 0.05f)); warningButtonStyle.normal.textColor = new Color(1, 1, 0); warningButtonStyle.fontStyle = FontStyle.Italic; warningButtonStyle.fontSize = 13; NormalButtonStyle = GeneralMethods.CreateBasicGUIStyle(EditorStyles.label, LightGrey, Color.white); SelectedButtonStyle = GeneralMethods.CreateBasicGUIStyle(EditorStyles.label, LightBlack, Color.white); AddQuestionButton = GeneralMethods.CreateBasicGUIStyle(GUI.skin.button, new Color(0.35f, 0.81f, 0.38f), Color.white); }
private void DrawDeleteBox() { EditorGUILayout.BeginHorizontal(); GUILayout.Space(20); GUIStyle style = GeneralMethods.CreateBasicGUIStyle(EditorStyles.label, new Color(1, 0.6f, 0.2f), Color.white); EditorGUILayout.BeginVertical(style); GUILayout.Space(30); EditorGUILayout.BeginHorizontal(); GUILayout.Space(50); DrawDeleteButton(); GUILayout.Space(50); EditorGUILayout.EndHorizontal(); GUILayout.Space(30); EditorGUILayout.EndVertical(); GUILayout.Space(20); EditorGUILayout.EndHorizontal(); }
private void DrawTestsList() { GUIStyle style = GeneralMethods.CreateBasicGUIStyle(EditorStyles.label, DarkWhite, Color.white); EditorGUILayout.BeginVertical(style, GUILayout.Width(140)); EditorGUILayout.LabelField("Tests", boldWhiteFont, GUILayout.Width(100), GUILayout.Height(25)); int boxHeight = 200; GUILayout.Space(10); if (GUILayout.Button("Add Test", AddTestButton)) { TestCreator.Instance.AddTest(); } GUILayout.Space(10); TestsScrollPosition = GUILayout.BeginScrollView(TestsScrollPosition, false, false, GUILayout.MaxWidth(140), GUILayout.Height(boxHeight)); DrawTestIDsList(); GUILayout.EndScrollView(); EditorGUILayout.EndVertical(); }
private void CreateWarningBox() { EditorGUILayout.BeginHorizontal(); GUILayout.Space(20); GUIStyle warningBox = GeneralMethods.CreateBasicGUIStyle(EditorStyles.label, new Color(0.9f, 0.5f, 0.4f), Color.white); EditorGUILayout.BeginVertical(warningBox, GUILayout.Width(200)); GUILayout.Space(20); EditorGUILayout.BeginHorizontal(); GUILayout.Space(30); DrawDeleteButton(); GUILayout.Space(30); EditorGUILayout.EndHorizontal(); GUILayout.Space(20); EditorGUILayout.EndVertical(); GUILayout.Space(20); EditorGUILayout.EndHorizontal(); }