Ejemplo n.º 1
0
    void Start()
    {
        Countries          = new string[] { "England", "Italy", "Germany", "France", "Austria", "Ireland", "China", "Russia", "Japan", "South Korea", "Australia", "Mexico", "Canada", "Brazil", "Israel", "Iraq", "Iran", "Egypt", "South Africa", "Greece", "Spain", "Argentina", "Thailand", "Vietnam", "Ukraine", "Turkey", "New Zealand", "Sweden", "Switzerland", "Chile", "Cuba", "Vatican City", "Finland", "Norway", "India", "Denmark", "Scotland", "Greenland", "Iceland", "Madagascar", "United Arab Emirates", "Afghanistan", "Poland", "Czech Republic", "Slovakia", "Singapore", "Philippines", "Jamaica", "Saudi Arabia", "Taiwan", "Nigeria", "Morocco", "Syria", "Kenya" };
        approval.value     = -25;
        StressLevels.value = 50;

        folderTopics();
        List <string> topics = new List <string>();

        if (db = null)
        {
            db  = GameObject.Find("Google2uDatabase");
            db1 = db.GetComponent <Google2u.Questions>();
        }
        HashSet <string> temptopics = new HashSet <string>();

        questions = new Dictionary <string, List <Question> >();
        gameView  = GetComponent <GameView>();
        if (tutorial.tutorial_active)
        {
            List <Question> y         = new List <Question>();
            Question        temporary = new Question("This is a freebie, go ahead and click any of the answers.", "Tutorial", 10, 10, 10);
            y.Add(temporary);
            temptopics.Add(temporary.topic);
            questions.Add(temporary.topic, y);
        }
        //Places questions into their respective topics.
        for (int i = 0; i < 33; i++)
        {
            List <Question>       y;
            Google2u.QuestionsRow a = db1.Rows [i];

            questions.TryGetValue(a._Type, out y);

            if (y == null)
            {
                y = new List <Question>();
            }

            Question temporary = new Question(a._Name, a._Type, a._Yes, a._No, a._Maybe);
            y.Add(temporary);

            temptopics.Add(temporary.topic);             //adding to List for future iteration.
            topics = temptopics.ToList();


            if (questions.ContainsKey(temporary.topic))
            {
                questions.Remove(temporary.topic);
            }
            questions.Add(temporary.topic, y);
        }
    }
Ejemplo n.º 2
0
        public QuestionsRow GetRow(string in_RowString)
        {
            QuestionsRow ret = null;

            try
            {
                ret = Rows[(int)System.Enum.Parse(typeof(rowIds), in_RowString)];
            }
            catch (System.ArgumentException) {
                Debug.LogError(in_RowString + " is not a member of the rowIds enumeration.");
            }
            return(ret);
        }
Ejemplo n.º 3
0
        public QuestionsRow GetRow(rowIds in_RowID)
        {
            QuestionsRow ret = null;

            try
            {
                ret = Rows[(int)in_RowID];
            }
            catch (System.Collections.Generic.KeyNotFoundException ex)
            {
                Debug.LogError(in_RowID + " not found: " + ex.Message);
            }
            return(ret);
        }
Ejemplo n.º 4
0
        public override void OnInspectorGUI()
        {
            Questions    s = target as Questions;
            QuestionsRow r = s.Rows[Index];

            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("<<"))
            {
                Index = 0;
            }
            if (GUILayout.Button("<"))
            {
                Index -= 1;
                if (Index < 0)
                {
                    Index = s.Rows.Count - 1;
                }
            }
            if (GUILayout.Button(">"))
            {
                Index += 1;
                if (Index >= s.Rows.Count)
                {
                    Index = 0;
                }
            }
            if (GUILayout.Button(">>"))
            {
                Index = s.Rows.Count - 1;
            }

            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("ID", GUILayout.Width(150.0f));
            {
                EditorGUILayout.LabelField(s.rowNames[Index]);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("_Name", GUILayout.Width(150.0f));
            {
                EditorGUILayout.TextField(r._Name);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("_Yes", GUILayout.Width(150.0f));
            {
                EditorGUILayout.IntField(r._Yes);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("_No", GUILayout.Width(150.0f));
            {
                EditorGUILayout.IntField(r._No);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("_Maybe", GUILayout.Width(150.0f));
            {
                EditorGUILayout.IntField(r._Maybe);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("_Type", GUILayout.Width(150.0f));
            {
                EditorGUILayout.TextField(r._Type);
            }
            EditorGUILayout.EndHorizontal();
        }