Exemple #1
0
    IEnumerator TriggerStudentReactioOne()
    {
        //set mood of table2 to Middle
        foreach (StudentAction sa in gamePlayManager.GetComponent <MainObjectsManager>().studentsAtTable2)
        {
            sa.SetMyMood(MoodIndicator.Middle);
        }

        //Leonie looks into her box (mb41: 2.5 seconds),
        yield return(new WaitForSeconds(2.5f));

        //then at teacher (mb14: 2.5 seconds),
        kidLeonie.LookAtSomeone(GameObject.FindGameObjectWithTag("Player").GetComponent <Transform>().transform);
        yield return(new WaitForSeconds(2.5f));

        // then takes another working-sheet out of box (iwo32: working-sheet/box),
        // IWO32 animation is not there, so just attaching the Worksheet to the kid's hand.
        kidLeonie.SetMyRightHandStudyMaterialsVisibilty(StudyMaterial.WorkSheet, true);
        yield return(new WaitForSeconds(2.0f));

        //returns to her seat (ma7)
        kidLeonie.TurnToPlayerOrObject(false);
        kidLeonie.StopLookAtSomeone();

        kidLeonie.GoToAndSitInChair();
        yield return(new WaitForSeconds(1.0f));

        kidLeonie.StopLookAtSomeone();
        yield return(new WaitUntil(() => kidLeonie.studentAnimation.IsSittingNow));

        kidLeonie.chairPoint.gameObject.GetComponent <ChairDetails>().ShowStudyMaterial(StudyMaterial.WorkSheet, true);
        yield return(new WaitForSeconds(1f));

        //Leonie, as soon as returning to seat = bad --> middle
        kidLeonie.SetMyMood(MoodIndicator.Middle);
        kidLeonie.SetMyRightHandStudyMaterialsVisibilty(StudyMaterial.WorkSheet, false);
        yield return(new WaitForSeconds(2f));

        kidLeonie.StartMyRandomLookingOrWrittingAnimations(2.5f, 4f, 2.5f, 5f);
        yield return(new WaitForSeconds(1f));

        //when starting work = middle --> good (within 3 seconds)
        kidLeonie.SetMyMood(MoodIndicator.Good);
        //as soon as Leonie sits down:
        //observing kids resume working(cycle of mb21 / random duration per kid: 2.5 - 4 seconds + mb33 / random duration per kid: 2.5 - 5 seconds)
        foreach (StudentAction sa in gamePlayManager.GetComponent <MainObjectsManager>().studentsAtTable2)
        {
            sa.StopLookAtSomeone();
            sa.StopLookBetweenTwoPeopoleRoutine();
            sa.StartMyRandomLookingOrWrittingAnimations(2.5f, 4f, 2.5f, 5f);

            //set mood back to Good
            sa.SetMyMood(MoodIndicator.Good);

            yield return(new WaitForSeconds(Random.Range(0.1f, 0.4f)));
        }

        yield return(new WaitForSeconds(6.0f));
    }