Exemplo n.º 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));
    }
Exemplo n.º 2
0
    IEnumerator StudentReactionTwoEnum()
    {
        yield return(new WaitForSeconds(4f));

        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().LookToPlayer(true, gamePlayManager.GetComponent <MainObjectsManager>().Table4);
        kidJannik.StopLookAtSomeone();
        kidMaxim.StopLookAtSomeone();
        kidJannik.studentAnimation.ResetAllAnim();
        kidMaxim.studentAnimation.ResetAllAnim();
        kidJannik.FindMyChair("Chair", jannikNewChairNumber);
        kidMaxim.FindMyChair("Chair", maximNewChairNumber);
        kidJannik.FindMyNeighbour();
        kidMaxim.FindMyNeighbour();
        jannikOriginalChair.ShowStudyMaterial(StudyMaterial.PencilBox, false);
        jannikOriginalChair.ShowStudyMaterial(StudyMaterial.WorkSheet, false);
        jannikOriginalChair.ShowStudyMaterial(StudyMaterial.Book, false);
        maximOriginalChair.ShowStudyMaterial(StudyMaterial.PencilBox, false);
        maximOriginalChair.ShowStudyMaterial(StudyMaterial.WorkSheet, false);
        maximOriginalChair.ShowStudyMaterial(StudyMaterial.Book, false);


        kidJannik.GoToAndSitInChair();
        kidMaxim.GoToAndSitInChair();

        foreach (StudentAction s in gamePlayManager.GetComponent <MainObjectsManager>().studentsAtTable4)
        {
            if (s != kidJannik && s != kidMaxim)
            {
                s.StopMyRandomLookingAnimations();
                int whichone = Random.Range(0, 2);
                if (whichone == 0)
                {
                    s.LookAtSomeone(kidJannik.transform);
                }
                else
                {
                    s.LookAtSomeone(kidMaxim.transform);
                }
            }
            yield return(new WaitForSeconds(Random.Range(0.1f, 0.3f)));
        }
        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().LookToPlayer(true, gamePlayManager.GetComponent <MainObjectsManager>().classmiddlePoint);

        jannikLeftHandStudyMaterial.SetActive(true);
        jannikRightHandStudyMaterial1.SetActive(true);
        jannikRightHandStudyMaterial2.SetActive(true);

        maximLeftHandStudyMaterial.SetActive(true);
        maximRightHandStudyMaterial1.SetActive(true);
        maximRightHandStudyMaterial2.SetActive(true);

        kidJannik.studentAnimation.WalkingToStandUpIdle(false);
        kidMaxim.studentAnimation.WalkingToStandUpIdle(false);


        jannikAndMaximSat = false;
        StartCoroutine(TriggerCheckJannikAndMaximSat());

        yield return(new WaitUntil(() => jannikAndMaximSat));

        foreach (StudentAction s in gamePlayManager.GetComponent <MainObjectsManager>().studentsAtTable4)
        {
            if (s != kidJannik && s != kidMaxim)
            {
                s.StopMyRandomLookingAnimations();
                s.StopLookAtSomeone();
                s.StartMyRandomLookingOrWrittingAnimations();
            }
            yield return(new WaitForSeconds(Random.Range(0.1f, 0.3f)));
        }

        jannikLeftHandStudyMaterial.SetActive(false);
        jannikRightHandStudyMaterial1.SetActive(false);
        jannikRightHandStudyMaterial2.SetActive(false);

        maximLeftHandStudyMaterial.SetActive(false);
        maximRightHandStudyMaterial1.SetActive(false);
        maximRightHandStudyMaterial2.SetActive(false);


        jannikNewChair.ShowStudyMaterial(StudyMaterial.PencilBox);
        jannikNewChair.ShowStudyMaterial(StudyMaterial.WorkSheet);
        jannikNewChair.ShowStudyMaterial(StudyMaterial.Book);
        maximNewChair.ShowStudyMaterial(StudyMaterial.PencilBox);
        maximNewChair.ShowStudyMaterial(StudyMaterial.WorkSheet);
        maximNewChair.ShowStudyMaterial(StudyMaterial.Book);


        yield return(new WaitForSeconds(1f));

        kidJannik.StartMyRandomLookingOrWrittingAnimations();
        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().LookToPlayer(true, gamePlayManager.GetComponent <MainObjectsManager>().Table1);
        yield return(new WaitForSeconds(3f));

        kidMaxim.StartMyRandomLookingOrWrittingAnimations();
        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().LookToPlayer(true, gamePlayManager.GetComponent <MainObjectsManager>().Table3);

        kidMaxim.SetMyMood(MoodIndicator.Middle);
        kidJannik.SetMyMood(MoodIndicator.Middle);
        yield return(new WaitForSeconds(3f));

        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().LookToPlayer(true, gamePlayManager.GetComponent <MainObjectsManager>().classmiddlePoint);
        yield return(new WaitForSeconds(6f));

        firstTimeSRPlayed = true;
        print("SR 2 finished");
    }