private IEnumerator JannikNeighbourActivity(StudentAction stu)
    {
        yield return(new WaitForSeconds(Random.Range(1.0f, 4.0f)));

        stu.LookAtSomeone(stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Tablet.transform);
        yield return(new WaitForSeconds(3.0f));

        stu.studentAnimation.MB33_WorkOnSheets(true);
        yield return(new WaitForSeconds(4.0f));

        stu.studentAnimation.MB33_WorkOnSheets(false);

        //yield return new WaitForSeconds(Random.Range(1.0f, 4.0f));
        stu.LookAtSomeone(stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Tablet.transform);
        yield return(new WaitForSeconds(3.0f));

        stu.studentAnimation.MB33_WorkOnSheets(true);
        yield return(new WaitForSeconds(4.0f));

        stu.studentAnimation.MB33_WorkOnSheets(false);

        //yield return new WaitForSeconds(Random.Range(1.0f, 4.0f));
        stu.LookAtSomeone(stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Tablet.transform);
        yield return(new WaitForSeconds(3.0f));

        stu.studentAnimation.MB33_WorkOnSheets(true);
        yield return(new WaitForSeconds(4.0f));

        stu.studentAnimation.MB33_WorkOnSheets(false);
    }
Exemple #2
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));
    }
    IEnumerator TriggerStudentReactionOne()
    {
        //Set student mumbling to zero
        audioInClass.volume = 0f;
        audioInClass.Play();

        for (int i = 0; i < gamePlayManager.studentsActions.Count; i++)
        {
            gamePlayManager.studentsActions[i].StopLookAtSomeone();
            gamePlayManager.studentsActions[i].StopMyRandomLookingAnimations();
            gamePlayManager.studentsActions[i].studentAnimation.ResetAllAnim();

            if (gamePlayManager.studentsActions[i] != kidLeonie)
            {
                StartCoroutine(SRLoop1(gamePlayManager.studentsActions[i]));
            }
            else
            {
                gamePlayManager.studentsActions[i].studentAnimation.MB9_LookAround(true);
                //StartCoroutine(SR1Loop1Leonie(gamePlayManager.studentsActions[i]));
            }
        }
        yield return(new WaitForSeconds(6f));

        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().MovePlayer(true, gamePlayManager.GetComponent <MainObjectsManager>().Table1MoveToPoint);
        GameObject.FindGameObjectWithTag("Player").GetComponent <Transform>().transform.rotation = gamePlayManager.GetComponent <MainObjectsManager>().Table1MoveToPoint.rotation;
        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().LookToPlace(true, gamePlayManager.GetComponent <MainObjectsManager>().Table1);
        //   GameObject.FindGameObjectWithTag("Player").GetComponent<Transform>().transform.rotation = tableOnePoint.rotation;
        yield return(new WaitForSeconds(2f));

        kidLeonie.StopLookAtSomeone();
        kidLeonie.studentAnimation.ResetAllAnim();
        yield return(new WaitForSeconds(0.5f));

        kidLeonie.LookAtSomeone(GameObject.FindGameObjectWithTag("Player").transform);
        yield return(new WaitForSeconds(1f));

        kidLeonie.LookAtSomeone(kidLeonie.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Tablet.transform);
        kidLeonie.studentAnimation.MB33_WorkOnSheets(true);
        yield return(new WaitForSeconds(1f));

        kidLeonie.studentAnimation.MB33_WorkOnSheets(true);
        yield return(new WaitForSeconds(1f));

        kidLeonie.studentAnimation.MB33_WorkOnSheets(true);
        yield return(new WaitForSeconds(2f));

        kidLeonie.studentAnimation.MB33_WorkOnSheets(true);
        yield return(new WaitForSeconds(2f));

        schoolBellAudio.Play();
        yield return(new WaitForSeconds(1f));

        for (int i = 0; i < gamePlayManager.studentsActions.Count; i++)
        {
            StartCoroutine(StudentWalkOutOfClass(gamePlayManager.studentsActions[i]));
        }
    }
Exemple #4
0
    IEnumerator StudentsRaiseHands(StudentAction stu)
    {
        yield return(new WaitForSeconds(Random.Range(0.1f, 2f)));

        stu.studentAnimation.RaiseHandAndKeep(true);
        stu.LookAtSomeone(GameObject.FindGameObjectWithTag("Player").transform);
    }
Exemple #5
0
    //public student



    IEnumerator TriggerMainActionThree()
    {
        // random kids will continue with mb33
        // remaining 9 kids will do talk animation
        // leonie will raise hand
        //jannik will continue with mb33



        //yield return new WaitForSeconds(10.0f);
        Debug.Log("main action 3 starts");

        audioInClass.volume = 0.05f;



        for (int i = 0; i < gamePlayManager.studentsActions.Count; i++) // everyone except leonie and jannik
        {
            //if (gamePlayManager.studentsActions[i] != kidLeonie && gamePlayManager.studentsActions[i] != kidJannik &&
            //    gamePlayManager.studentsActions[i] != randomKids[0] &&
            //    gamePlayManager.studentsActions[i] != randomKids[1] &&
            //    gamePlayManager.studentsActions[i] != randomKids[2] &&
            //    gamePlayManager.studentsActions[i] != randomKids[3] &&
            //    gamePlayManager.studentsActions[i] != randomKids[4] &&
            //    gamePlayManager.studentsActions[i] != randomKids[5])
            //{
            //    gamePlayManager.studentsActions[i].studentAnimation.MB9_LookAround(false);
            //    gamePlayManager.studentsActions[i].SetMyMood(MoodIndicator.Middle);
            //    StartCoroutine(TriggerStudentTalkToFriends(gamePlayManager.studentsActions[i]));
            //}

            if (gamePlayManager.studentsActions[i] != kidLeonie && gamePlayManager.studentsActions[i] != kidJannik &&
                gamePlayManager.studentsActions[i] != randomKids[0] &&
                gamePlayManager.studentsActions[i] != randomKids[1] &&
                gamePlayManager.studentsActions[i] != randomKids[2] &&
                gamePlayManager.studentsActions[i] != randomKids[3])
            {
                gamePlayManager.studentsActions[i].studentAnimation.MB9_LookAround(false);
                gamePlayManager.studentsActions[i].SetMyMood(MoodIndicator.Middle);
                StartCoroutine(TriggerStudentTalkToFriends(gamePlayManager.studentsActions[i]));
            }
        }
        kidLeonie.studentAnimation.ResetAllAnim();
        yield return(new WaitForSeconds(0.5f));

        kidLeonie.LookAtSomeone(GameObject.FindGameObjectWithTag("Player").transform);
        kidLeonie.studentAnimation.RaiseHand(true);
        yield return(new WaitForSeconds(4.0f)); // edit delay after testing

        //return player position to front of class
        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().MovePlayer(true, gamePlayManager.GetComponent <MainObjectsManager>().TeacherInFrontOfClassPoint);
        GameObject.FindGameObjectWithTag("Player").GetComponent <Transform>().transform.rotation = gamePlayManager.GetComponent <MainObjectsManager>().TeacherInFrontOfClassPoint.rotation;
        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().LookToPlace(true, gamePlayManager.GetComponent <MainObjectsManager>().classmiddlePoint);

        yield return(new WaitForSeconds(4.0f));


        gamePlayManager.StartPhaseFive();
    }
    IEnumerator SR1Activity(StudentAction stu)
    {
        yield return(new WaitForSeconds(UnityEngine.Random.Range(0.1f, 2.5f)));

        stu.studentAnimation.MB33_WorkOnSheets(false);
        stu.studentAnimation.RaiseHand(true);
        stu.LookAtSomeone(GameObject.FindGameObjectWithTag("Player").transform);
    }
    IEnumerator TriggerStudentReactionThree()
    {
        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().MovePlayer(true, tableFourPoint);
        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().LookToPlace(true, gamePlayManager.GetComponent <MainObjectsManager>().Table4);

        //Set Jannik's mood to Bad; set his neighbor's to Middle
        KidJannik.SetMyMood(MoodIndicator.Middle);

        for (int i = 0; i < StudentsInPair.Length; i++)
        {
            if (StudentsInPair[i] != KidJannik)
            {
                StartCoroutine(AllStudentsActivity(StudentsInPair[i]));
            }
        }

        //KidJannik.SetMyMood(MoodIndicator.Middle);
        yield return(new WaitForSeconds(0.5f));

        //KidJannik.myNeighbourStudent.ChairNumber = 6;

        KidJannik.myNeighbourStudent.FindMyChair("Chair", 6);
        KidJannik.myNeighbourStudent.GoToAndSitInChair();
        KidJannik.myNeighbourStudent.SetMyMood(MoodIndicator.Middle);

        KidJannik.LookAtSomeone(KidJannik.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Tablet.transform);
        KidSimon.LookAtSomeone(KidSimon.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Tablet.transform);
        KidJannik.myNeighbourStudent.LookAtSomeone(KidSimon.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Tablet.transform);
        yield return(new WaitForSeconds(5f));

        KidJannik.studentAnimation.MB33_WorkOnSheets(true);
        KidJannik.SetMyMood(MoodIndicator.Good);

        KidSimon.studentAnimation.MB33_WorkOnSheets(true);
        KidSimon.SetMyMood(MoodIndicator.Bad);
        KidJannik.myNeighbourStudent.studentAnimation.MB33_WorkOnSheets(true);
        yield return(new WaitForSeconds(3f));

        KidSimon.LookAtSomeone(KidSimon.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Tablet.transform);
        KidJannik.myNeighbourStudent.LookAtSomeone(KidSimon.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Tablet.transform);
        yield return(new WaitForSeconds(3f));

        KidSimon.studentAnimation.MB33_WorkOnSheets(true);
        KidJannik.myNeighbourStudent.studentAnimation.MB33_WorkOnSheets(true);
        yield return(new WaitForSeconds(3f));
    }
    IEnumerator TriggerStudentReactionOne()
    {
        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().MovePlayer(true, tableFourPoint);
        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().LookToPlace(true, gamePlayManager.GetComponent <MainObjectsManager>().Table4);

        //Set Jannik's mood to Bad
        KidJannik.SetMyMood(MoodIndicator.Bad);

        for (int i = 0; i < StudentsInPair.Length; i++)
        {
            if (StudentsInPair[i] != KidJannik)
            {
                StartCoroutine(AllStudentsActivity(StudentsInPair[i]));
            }
        }


        KidJannik.myNeighbourStudent.StopLookAtSomeone();
        KidJannik.myNeighbourStudent.StopMyRandomLookingAnimations();
        KidJannik.myNeighbourStudent.studentAnimation.ResetAllAnim();

        yield return(new WaitForSeconds(1f));

        KidJannik.LookAtNeighbourRoutine();
        KidJannik.myNeighbourStudent.studentAnimation.VI11_TalkToFriendsLeftAndRight();
        yield return(new WaitForSeconds(4f));

        KidJannik.myNeighbourStudent.studentAnimation.VI11_TalkToFriendsStop();

        //Jannik's mood turns Good after neighbor stops talking
        KidJannik.SetMyMood(MoodIndicator.Good);

        KidJannik.LookAtNeighbourRoutineStop();
        KidJannik.LookAtSomeone(KidJannik.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Tablet.transform);
        KidJannik.myNeighbourStudent.LookAtSomeone(KidJannik.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Tablet.transform);
        yield return(new WaitForSeconds(3f));

        KidJannik.studentAnimation.MB33_WorkOnSheets(true);
        KidJannik.myNeighbourStudent.studentAnimation.MB33_WorkOnSheets(true);
    }
Exemple #9
0
    IEnumerator SNStudentsLooksOutsideAndAroundWithDelay(StudentAction stu, float delay)
    {
        yield return(new WaitForSeconds(Random.Range(0.1f, 2f)));

        stu.studentAnimation.LookAround(true);
        yield return(new WaitForSeconds(2f));

        stu.studentAnimation.LookAround(false);
        stu.LookAtSomeone(stu.chairPoint.gameObject.GetComponent <ChairDetails>().GetAWindowToLookAt());
        yield return(new WaitForSeconds(2f));

        stu.StopLookAtSomeone();
        stu.studentAnimation.LookAround(true);
    }
Exemple #10
0
    IEnumerator SRWorkOnSheetsWithRandomDelay(StudentAction stu)
    {
        yield return(new WaitForSeconds(Random.Range(0.1f, 1.5f)));

        stu.studentAnimation.MB33_WorkOnSheets(true);
        yield return(new WaitForSeconds(Random.Range(2f, 3f)));

        stu.studentAnimation.MB33_WorkOnSheets(false);
        stu.LookAtSomeone(stu.chairPoint.gameObject.GetComponent <ChairDetails>().GetAWindowToLookAt());
        yield return(new WaitForSeconds(2f));

        stu.StopLookAtSomeone();
        stu.studentAnimation.MB33_WorkOnSheets(true);
    }
    IEnumerator Table3StudentLooksAtTeacherAndStartWriting(StudentAction whoIs)
    {
        yield return(new WaitForSeconds(Random.Range(1f, 2f)));

        if (table3KidsTalking.isPlaying)
        {
            table3KidsTalking.Stop();
        }
        //  print(whoIs.name + "Realises that students are looking at them and looks at Teacher");
        whoIs.studentAnimation.VI7_TalkToFriendsStop();
        whoIs.studentAnimation.VI11_TalkToFriendsStop();
        whoIs.LookAtSomeone(GameObject.FindGameObjectWithTag("Player").transform);
        yield return(new WaitForSeconds(3f));

        whoIs.studentAnimation.MB33_WorkOnSheets(true);
        yield return(new WaitForSeconds(5f));
    }
Exemple #12
0
    IEnumerator R4Action(StudentAction stu, int i)
    {
        yield return(new WaitForSeconds(Random.Range(0.1f, 3f)));

        if (i < 7)
        {
            stu.LookAtSomeone(stu.chairPoint.gameObject.GetComponentInChildren <StudyMaterialType>().GetStudyMaterial(StudyMaterial.WorkSheet).transform);
            stu.SetMyMood(MoodIndicator.Middle);
        }
        else if (i >= 7 && i < 10)
        {
            stu.LookAtWindowRoutine();
            stu.SetMyMood(MoodIndicator.Middle);
        }
        else //if (i >= 10 && i < 16)
        {
            stu.studentAnimation.VI11_TalkToFriendsLeftAndRight();
        }
    }
Exemple #13
0
    IEnumerator SNStudentsLooksOutsideAndAroundWithDelay(StudentAction stu)
    {
        stu.StopLookAtSomeone();
        yield return(new WaitForSeconds(Random.Range(1f, 3f)));

        stu.studentAnimation.LookAround(true);
        yield return(new WaitForSeconds(2f));

        stu.studentAnimation.LookAround(false);
        //stu.LookAtSomeone(stu.chairPoint.gameObject.GetComponent<ChairDetails>().GetAWindowToLookAt());
        //stu.LookAtWindowRoutine();

        //look out window
        stu.studentAnimation.ResetAllAnim();
        stu.LookAtSomeone(GameObject.Find("SpotAtCuboardNearWindow").transform);
        yield return(new WaitForSeconds(5f));

        stu.StopLookAtSomeone();
        //stu.LookAtWindowRoutineStop();
        stu.studentAnimation.LookAround(true);
    }
    private IEnumerator AllStudentsActivity(StudentAction stu)
    {
        yield return(new WaitForSeconds(Random.Range(1.0f, 4.0f)));

        stu.LookAtSomeone(stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Tablet.transform);
        if (stu.myNeighbourStudent != null)
        {
            stu.myNeighbourStudent.LookAtSomeone(stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Tablet.transform);
        }
        yield return(new WaitForSeconds(3.0f));

        stu.studentAnimation.MB33_WorkOnSheets(true);
        if (stu.myNeighbourStudent != null)
        {
            stu.myNeighbourStudent.studentAnimation.MB33_WorkOnSheets(true);
        }
        yield return(new WaitForSeconds(4.0f));

        stu.studentAnimation.MB33_WorkOnSheets(false);
        if (stu.myNeighbourStudent != null)
        {
            stu.myNeighbourStudent.studentAnimation.MB33_WorkOnSheets(false);
        }

        //yield return new WaitForSeconds(Random.Range(1.0f, 4.0f));
        stu.LookAtSomeone(stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Tablet.transform);
        if (stu.myNeighbourStudent != null)
        {
            stu.myNeighbourStudent.LookAtSomeone(stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Tablet.transform);
        }
        yield return(new WaitForSeconds(3.0f));

        stu.studentAnimation.MB33_WorkOnSheets(true);
        if (stu.myNeighbourStudent != null)
        {
            stu.myNeighbourStudent.studentAnimation.MB33_WorkOnSheets(true);
        }
        yield return(new WaitForSeconds(4.0f));

        stu.studentAnimation.MB33_WorkOnSheets(false);
        if (stu.myNeighbourStudent != null)
        {
            stu.myNeighbourStudent.studentAnimation.MB33_WorkOnSheets(false);
        }

        //yield return new WaitForSeconds(Random.Range(1.0f, 4.0f));
        stu.LookAtSomeone(stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Tablet.transform);
        if (stu.myNeighbourStudent != null)
        {
            stu.myNeighbourStudent.LookAtSomeone(stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Tablet.transform);
        }
        yield return(new WaitForSeconds(3.0f));

        stu.studentAnimation.MB33_WorkOnSheets(true);
        if (stu.myNeighbourStudent != null)
        {
            stu.myNeighbourStudent.studentAnimation.MB33_WorkOnSheets(true);
        }
        yield return(new WaitForSeconds(4.0f));

        stu.studentAnimation.MB33_WorkOnSheets(false);
        if (stu.myNeighbourStudent != null)
        {
            stu.myNeighbourStudent.studentAnimation.MB33_WorkOnSheets(false);
        }
        yield return(null);

        //StartCoroutine(TriggerMainActionTwo());
    }
Exemple #15
0
    IEnumerator TriggerSRInitialActions()
    {
        // move Player to their original position and turn towards original rotation.
        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().LookToPlayer(true, gamePlayManager.GetComponent <MainObjectsManager>().Table4);
        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().MovePlayer(true, gamePlayManager.GetComponent <MainObjectsManager>().TeacherInFrontOfClassPoint);

        /*
         *      for (int i = 0; i < gamePlayManager.studentsActions.Count; i++)
         *      {
         *          gamePlayManager.studentsActions[i].studentAnimation.ResetCurrentAnim();
         *          if (gamePlayManager.studentsActions[i] != kidJannik && gamePlayManager.studentsActions[i] != kidMaxim) gamePlayManager.studentsActions[i].SetMyMood(MoodIndicator.Good);
         *          gamePlayManager.studentsActions[i].StopMyRandomLookingAnimations();
         *      }
         */

        kidJannik.StopLookAtSomeone();
        kidMaxim.StopLookAtSomeone();

        kidJannik.FindMyChair("Chair", jannikOriginalChairNumber);
        kidMaxim.FindMyChair("Chair", maximOriginalChairNumber);
        kidJannik.GoToAndSitInChair();
        kidMaxim.GoToAndSitInChair();
        kidJannik.studentAnimation.WalkingToStandUpIdle(false);
        kidMaxim.studentAnimation.WalkingToStandUpIdle(false);

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

        jannikAndMaximSat = false;
        StartCoroutine(TriggerCheckJannikAndMaximSat());

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

        jannikOriginalChair.ShowStudyMaterial(StudyMaterial.PencilBox);
        jannikOriginalChair.ShowStudyMaterial(StudyMaterial.WorkSheet);
        jannikOriginalChair.ShowStudyMaterial(StudyMaterial.Book);
        maximOriginalChair.ShowStudyMaterial(StudyMaterial.PencilBox);
        maximOriginalChair.ShowStudyMaterial(StudyMaterial.WorkSheet);
        maximOriginalChair.ShowStudyMaterial(StudyMaterial.Book);


        //yield return new WaitForSeconds(1f);


        kidJannik.studentAnimation.MB26_FoldHands(true);
        kidMaxim.studentAnimation.MB26_FoldHands(true);
        kidJannik.LookAtSomeone(kidMaxim.transform);
        kidMaxim.LookAtSomeone(kidJannik.transform);
        kidJannik.SetMyMood(MoodIndicator.Bad);
        kidMaxim.SetMyMood(MoodIndicator.Bad);

        yield return(new WaitUntil(() => !GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().isMove));

        foreach (StudentAction studentAction in gamePlayManager.studentsActions)
        {
            if (studentAction != kidJannik && studentAction != kidMaxim)
            {
                studentAction.SetMyMood(MoodIndicator.Good);
            }
            studentAction.ShowMyMoodNow(true);
            studentAction.StartMyRandomLookingOrWrittingAnimations();
            yield return(new WaitForSeconds(Random.Range(0.1f, 0.3f)));
        }
        yield return(new WaitForSeconds(0.5f));
    }
Exemple #16
0
    IEnumerator StudentsLookAtTeacherWithDelay(StudentAction stu)
    {
        yield return(new WaitForSeconds(Random.Range(0.1f, 2f)));

        stu.LookAtSomeone(GameObject.FindGameObjectWithTag("Player").transform);
    }
Exemple #17
0
    IEnumerator SR1StudentWalkTowardsFrontDesk(StudentAction stu, bool lastStudent)
    {
        int rand = Random.Range(1, 3);

        yield return(new WaitForSeconds(UnityEngine.Random.Range(0.1f, 1.5f)));

        //stu.studentAnimation.ResetAllAnim();
        stu.InitiateGoToSpot(TeacherDesk.transform);
        yield return(new WaitUntil((() => stu.reachedSpot)));

        stu.studentAnimation.TakeItem(true);
        yield return(new WaitForSeconds(1f));

        if (stu == KidJannik.myNeighbourStudent)
        {
            stu.rightHandStudyMaterials.YellowPaper.SetActive(true);
        }
        else
        {
            if (rand == 1) // book yellow
            {
                stu.rightHandStudyMaterials.YellowPaper.SetActive(true);
            }
            if (rand == 2) // book blue
            {
                stu.rightHandStudyMaterials.BluePaper.SetActive(true);
            }
        }


        stu.studentAnimation.TakeItem(false);
        stu.GoToAndSitInChair();
        yield return(new WaitUntil((() => stu.reachedSpot)));

        if (stu == KidJannik.myNeighbourStudent)
        {
            stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().YellowPaper.SetActive(true);
            stu.rightHandStudyMaterials.YellowPaper.SetActive(false);
        }
        else
        {
            if (rand == 1) // book yellow
            {
                stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().YellowPaper.SetActive(true);
                stu.rightHandStudyMaterials.YellowPaper.SetActive(false);
            }
            if (rand == 2) // book blue
            {
                stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().BluePaper.SetActive(true);
                stu.rightHandStudyMaterials.BluePaper.SetActive(false);
            }
        }

        yield return(new WaitForSeconds(4f));

        if (rand == 1) // book yellow
        {
            stu.LookAtSomeone(stu.rightHandStudyMaterials.YellowPaper.transform);
            stu.myNeighbourStudent.LookAtSomeone(stu.rightHandStudyMaterials.YellowPaper.transform);
        }
        if (rand == 2) // book blue
        {
            stu.LookAtSomeone(stu.rightHandStudyMaterials.BluePaper.transform);
            stu.myNeighbourStudent.LookAtSomeone(stu.rightHandStudyMaterials.BluePaper.transform);
        }
        yield return(new WaitForSeconds(5f));

        if (lastStudent == true)
        {
            //wait for last student to to be seated before showing clock
            yield return(new WaitForSeconds(10f));

            //show 10 minute time lapse
            gamePlayManager.SetTimeScaleTextToMinutes();
            gamePlayManager.StartTimer(true);

            yield return(new WaitForSeconds(10f));

            gamePlayManager.StopTimer();
        }
    }
    IEnumerator TriggerMainActionThree()
    {
        UnityEngine.Debug.Log("main action 3 starts");
        yield return(new WaitForSeconds(1.0f)); // timeframe is already covered for nearly 10 seconds


        kidMaxim.LookAtSomeone(GameObject.FindGameObjectWithTag("Player").transform);

        gamePlayManager.studentsActions[2].StopLookingAtTabletAndWrittingAnimations();
        gamePlayManager.studentsActions[3].StopLookingAtTabletAndWrittingAnimations();
        gamePlayManager.studentsActions[4].StopLookingAtTabletAndWrittingAnimations();
        gamePlayManager.studentsActions[1].StopLookingAtTabletAndWrittingAnimations();
        gamePlayManager.studentsActions[16].StopLookingAtTabletAndWrittingAnimations();

        gamePlayManager.studentsActions[2].LookAtSomeone(kidMaxim.gameObject.transform);
        gamePlayManager.studentsActions[3].LookAtSomeone(kidMaxim.gameObject.transform);
        gamePlayManager.studentsActions[4].LookAtSomeone(kidMaxim.gameObject.transform);
        gamePlayManager.studentsActions[1].LookAtSomeone(kidMaxim.gameObject.transform);
        gamePlayManager.studentsActions[16].LookAtSomeone(kidMaxim.gameObject.transform);


        //  SpeechManager.Instance.StartTalking(teacherTextToSpeak);
        yield return(new WaitForSeconds(1f));

        string studentTextToSpeak = "Fertig! Darf ich jetzt raus?";

        if (gamePlayManager.LOG_ENABLED)
        {
            SpeechManager.Instance.StartTalking(studentTextToSpeak, true);
        }
        //MaximAudio1.Play();

        yield return(new WaitForSeconds(5f));

        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.studentAnimation.SitAgitated(false);
        kidMaxim.studentAnimation.IWO29_FidgetingOnChair(false);
        kidMaxim.studentAnimation.RaiseHand(true);
        kidMaxim.LookAtSomeone(GameObject.FindGameObjectWithTag("Player").transform);

        yield return(new WaitForSeconds(5f));

        gamePlayManager.StartPhaseFive();
    }