IEnumerator TriggerMainActionTwo() { yield return(new WaitForSeconds(2.0f)); //previously 10 seconds kidMaxim.StopLookingAtTabletAndWrittingAnimations(); //kidMaxim.studentAnimation.SitAgitated(true); kidMaxim.StopLookAtSomeone(); kidMaxim.StopMyRandomLookingAnimations(); kidMaxim.studentAnimation.ResetAllAnim(); kidMaxim.studentAnimation.EE2_GetUpsetSeated(true); //.IWO29_FidgetingOnChair(true); UnityEngine.Debug.Log("main action 2 starts"); yield return(new WaitForSeconds(1.0f)); //gamePlayManager.studentsActions[1].SetMyMood(MoodIndicator.Middle); // students from table 1 || task EQ-103 //gamePlayManager.studentsActions[2].SetMyMood(MoodIndicator.Middle); //gamePlayManager.studentsActions[3].SetMyMood(MoodIndicator.Middle); //gamePlayManager.studentsActions[4].SetMyMood(MoodIndicator.Middle); //gamePlayManager.studentsActions[16].SetMyMood(MoodIndicator.Middle); //kidMaxim.StopLookingAtTabletAndWrittingAnimations(); int count = 0; foreach (StudentAction s in gamePlayManager.studentsActions) { count += 1; int LookOutsideChance = Random.Range(1, 2); //pause Maxim's fidgeting, otherwise animation loops too long if (count == 7) { kidMaxim.studentAnimation.EE2_GetUpsetSeated(false); yield return(new WaitForSeconds(1.0f)); } if (count == 19) { kidMaxim.studentAnimation.EE2_GetUpsetSeated(true); yield return(new WaitForSeconds(1.0f)); } switch (LookOutsideChance) { case 1: s.LookAtWindowRoutine(); yield return(new WaitForSeconds(Random.Range(0.1f, 1f))); s.LookAtWindowRoutineStop(); s.LookAtSomeone(s.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Tablet.transform); break; case 2: break; } if (s != kidMaxim) { yield return(new WaitForSeconds(Random.Range(0.1f, 1f))); s.studentAnimation.MB33_WorkOnSheets(true); } } yield return(new WaitForSeconds(0.1f)); count = 0; foreach (StudentAction s in gamePlayManager.studentsActions) { s.LookAtWindowRoutine(); yield return(new WaitForSeconds(Random.Range(0.1f, 0.5f))); s.LookAtWindowRoutineStop(); } kidMaxim.studentAnimation.EE2_GetUpsetSeated(false); yield return(new WaitForSeconds(1.0f)); yield return(new WaitForSeconds(0.1f)); gamePlayManager.StartPhaseFour(); }