private void HandleInput()
    {
        if (Input.GetButtonDown("B"))
        {
            this.mainPanel.gameObject.SetActive(true);
            this.studentPanel.gameObject.SetActive(false);
        }
        int  num        = 0;
        int  num2       = this.students.Length - 1;
        bool tappedUp   = this.inputManager.TappedUp;
        bool tappedDown = this.inputManager.TappedDown;

        if (tappedUp)
        {
            this.studentIndex = ((this.studentIndex > num) ? (this.studentIndex - 1) : num2);
        }
        else if (tappedDown)
        {
            this.studentIndex = ((this.studentIndex < num2) ? (this.studentIndex + 1) : num);
        }
        if (tappedUp || tappedDown)
        {
            this.bodyLabel.text = StudentEditorScript.GetStudentText(this.students[this.studentIndex]);
        }
    }
Пример #2
0
 // Token: 0x06000270 RID: 624 RVA: 0x00032518 File Offset: 0x00030918
 public static StudentEditorScript.StudentData Deserialize(Dictionary <string, object> dict)
 {
     return(new StudentEditorScript.StudentData {
         id = TFUtils.LoadInt(dict, "ID"),
         name = TFUtils.LoadString(dict, "Name"),
         isMale = (TFUtils.LoadInt(dict, "Gender") == 1),
         attendanceInfo = StudentEditorScript.StudentAttendanceInfo.Deserialize(dict),
         personality = StudentEditorScript.StudentPersonality.Deserialize(dict),
         stats = StudentEditorScript.StudentStats.Deserialize(dict),
         cosmetics = StudentEditorScript.StudentCosmetics.Deserialize(dict),
         scheduleBlocks = StudentEditorScript.DeserializeScheduleBlocks(dict),
         info = TFUtils.LoadString(dict, "Info")
     });
 }
 private void Awake()
 {
     Dictionary <string, object>[] array = EditorManagerScript.DeserializeJson("Students.json");
     this.students = new StudentEditorScript.StudentData[array.Length];
     for (int i = 0; i < this.students.Length; i++)
     {
         this.students[i] = StudentEditorScript.StudentData.Deserialize(array[i]);
     }
     Array.Sort <StudentEditorScript.StudentData>(this.students, (StudentEditorScript.StudentData a, StudentEditorScript.StudentData b) => a.id - b.id);
     for (int j = 0; j < this.students.Length; j++)
     {
         StudentEditorScript.StudentData studentData = this.students[j];
         UILabel uilabel = UnityEngine.Object.Instantiate <UILabel>(this.studentLabelTemplate, this.listLabelsOrigin);
         uilabel.text = "(" + studentData.id.ToString() + ") " + studentData.name;
         Transform transform = uilabel.transform;
         transform.localPosition = new Vector3(transform.localPosition.x + (float)(uilabel.width / 2), transform.localPosition.y - (float)(j * uilabel.height), transform.localPosition.z);
         uilabel.gameObject.SetActive(true);
     }
     this.studentIndex   = 0;
     this.bodyLabel.text = StudentEditorScript.GetStudentText(this.students[this.studentIndex]);
     this.inputManager   = UnityEngine.Object.FindObjectOfType <InputManagerScript>();
 }