Beispiel #1
0
        public static string getStringFromEnum(MonsterTools.QUESTION_NUMBER idx)
        {
            if (idx == MonsterTools.QUESTION_NUMBER.Q1)
            {
                return("Q1");
            }
            if (idx == MonsterTools.QUESTION_NUMBER.Q2)
            {
                return("Q2");
            }
            if (idx == MonsterTools.QUESTION_NUMBER.Q3)
            {
                return("Q3");
            }
            if (idx == MonsterTools.QUESTION_NUMBER.Q4)
            {
                return("Q4");
            }
            if (idx == MonsterTools.QUESTION_NUMBER.Q5)
            {
                return("Q5");
            }

            return("");
        }
Beispiel #2
0
        public static List <string> getListFromEnum(MonsterTools.QUESTION_NUMBER idx, MonsterData monsterData)
        {
            if (idx == MonsterTools.QUESTION_NUMBER.Q1)
            {
                return(monsterData.m_answerQ1);
            }
            if (idx == MonsterTools.QUESTION_NUMBER.Q2)
            {
                return(monsterData.m_answerQ2);
            }
            if (idx == MonsterTools.QUESTION_NUMBER.Q3)
            {
                return(monsterData.m_answerQ3);
            }
            if (idx == MonsterTools.QUESTION_NUMBER.Q4)
            {
                return(monsterData.m_answerQ4);
            }
            if (idx == MonsterTools.QUESTION_NUMBER.Q5)
            {
                return(monsterData.m_answerQ5);
            }

            return(monsterData.m_answerQ1);
        }
Beispiel #3
0
        void DisplayAnswer()
        {
            GUILayout.BeginVertical();
            m_currentQuestion = (MonsterTools.QUESTION_NUMBER)EditorGUILayout.EnumPopup(m_currentQuestion);
            GUILayout.Label("Question: " + Tools.getStringFromEnum(m_currentQuestion));
            List <string> _answer = Tools.getListFromEnum(m_currentQuestion, m_monsterDataList.dataList[m_elementIndex]);

            if (m_answerIdx >= _answer.Count)
            {
                m_answerIdx = -1;
            }
            GUILayout.BeginVertical();

            GUILayout.Label("Answer index: " + m_answerIdx);

            GUILayout.BeginHorizontal();

            if (GUILayout.Button("Prev"))
            {
                if (m_answerIdx >= 0)
                {
                    m_answerIdx--;
                }
                if (m_answerIdx == 0)
                {
                    m_answerIdx = 0;
                }
            }

            if (GUILayout.Button("Next"))
            {
                m_answerIdx++;
                if (m_answerIdx >= _answer.Count)
                {
                    m_answerIdx = _answer.Count - 1;
                }
            }

            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();

            if (m_answerIdx > -1)
            {
                if (GUILayout.Button("Remove Answer"))
                {
                    _answer.RemoveAt(m_answerIdx);
                    m_answerIdx--;
                }
            }

            if (GUILayout.Button("Add Answer"))
            {
                m_answerIdx++;
                _answer.Add("");
            }

            GUILayout.EndHorizontal();

            if (m_answerIdx > -1)
            {
                _answer[m_answerIdx] =
                    EditorGUILayout.TextField(_answer[m_answerIdx]) as string;
                EditorGUILayout.TextArea(_answer[m_answerIdx]);
            }


            GUILayout.EndVertical();

            GUILayout.EndVertical();
        }