예제 #1
0
    // Redraw TextBox
    void refresh()
    {
        mytext.text = "";

        for (int i = 0; i < language.GetNames(typeof(bodyPart)).Length; i++)
        {
            List <symptom> tempList = new List <symptom> ();
            if (symptomsList.TryGetValue((bodyPart)i, out tempList))
            {
                mytext.text += (tManag.getName((bodyPart)i) + "\n");
                for (int j = 0; j < tempList.Count; j++)
                {
                    mytext.text += ("    " + tManag.getName(tempList[j]) + "\n");
                }
            }
        }
    }
예제 #2
0
    public void createList()
    {
        //Populate symptom canvas with the symptoms
        SymptomCanvas = GameObject.FindGameObjectWithTag("SympCanvas").GetComponent <Transform>();
        List <symptom> tempList = new List <symptom> ();

        if (symptomsDictionary.TryGetValue(currentPart, out tempList))
        {
            for (int i = 0; i < tempList.Count; i++)
            {
                GameObject newToggle = GameObject.Instantiate(Resources.Load("SymptomToggle")) as GameObject;
                newToggle.transform.position = new Vector3(0f, (i * -0.2f) + 0.5f, 0f);
                newToggle.transform.SetParent(SymptomCanvas.transform, false);
                newToggle.transform.Find("Label").GetComponent <Text> ().text = tManag.getName(tempList[i]);
                newToggle.GetComponent <symptomCheck>().mySymptom             = tempList[i];
                if (selectedSymptoms.Count != 0)
                {
                    newToggle.transform.GetComponent <Toggle>().isOn = selectedSymptoms.Contains(tempList[i]);
                }
                newToggle.SetActive(true);
            }
        }
    }