Example #1
0
 private void FillSubQuest(SubQuest quest)
 {
     _subQuestName        = quest.Name;
     _subQuestDescription = quest.Description;
     _subQuestMission     = quest.Mission;
     _subQuestGiver       = quest.Giver;
 }
Example #2
0
        private void DrawSubQuest(SubQuest quest)
        {
            if (quest != null)
            {
                FillSubQuest(quest);
            }
            DrawUiLine(Color.grey, 1);
            EditorGUILayout.Space();

            EditorGUILayout.BeginHorizontal();
            {
                EditorGUILayout.Space();
                EditorGUILayout.Space();
                EditorGUILayout.Space();

                EditorGUILayout.BeginVertical();
                {
                    EditorGUILayout.BeginHorizontal();
                    {
                        GUILayout.Label("Name:");
                        _subQuestName = EditorGUILayout.TextField(_subQuestName);
                    }
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.Space();

                    EditorGUILayout.BeginHorizontal();
                    {
                        GUILayout.Label("Description:");
                        _subQuestDescription = EditorGUILayout.TextField(_subQuestDescription);
                    }
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.Space();

                    EditorGUILayout.BeginHorizontal();
                    {
                        GUILayout.Label("Mission:");
                        _subQuestMission = EditorGUILayout.TextField(_subQuestMission);
                    }
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.Space();

                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.LabelField("Giver:");
                        _subQuestGiver = EditorGUILayout.TextField(_subQuestGiver);
                    }
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.Space();

                    EditorGUILayout.EndVertical();
                }
            }
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();

            if (GUILayout.Button("Save SubQuest"))
            {
                var subQuest = CreateInstance <SubQuest>();
                subQuest.Name        = _subQuestName;
                subQuest.Mission     = _subQuestMission;
                subQuest.Description = _subQuestDescription;
                subQuest.Giver       = _subQuestGiver;

                _subQuests.Add(subQuest);
                ClearSubQuest();
                _selectedSubQuestIndex = _subQuests.Count - 1;
                _isAddingSubQuest      = false;
                _isEditingSubQuest     = false;
                Repaint();
            }
            EditorGUILayout.Space();
            DrawUiLine(Color.grey, 1);
            EditorGUILayout.Space();
        }