IEnumerator GetUpset(StudentAction stu)
    {
        stu.StopLookAtSomeone();
        stu.StopMyRandomLookingAnimations();
        stu.studentAnimation.ResetAllAnim();

        stu.studentAnimation.MB19_Protest(true);
        yield return(new WaitForSeconds(3.0f));

        stu.StopLookAtSomeone();
        stu.StopMyRandomLookingAnimations();
        stu.studentAnimation.ResetAllAnim();

        stu.studentAnimation.MB33_WorkOnSheets(true);
    }
    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 #3
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);
    }
Exemple #4
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 #5
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);
    }
Exemple #6
0
    IEnumerator StudentsTakeBookFromBag(StudentAction stu)
    {
        stu.StopLookAtSomeone();
        stu.StopMyRandomLookingAnimations();
        stu.studentAnimation.ResetAllAnim();
        // each student play iwo25 animation
        stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Bag.SetActive(true);
        yield return(new WaitForSeconds(Random.Range(2f, 4f)));

        stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().WeeklyPlan.SetActive(true);

        yield return(new WaitForSeconds(1f));

        stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Bag.SetActive(false);
        Debug.Log(stu.gameObject.name + " complete taking book from bag");
        yield return(null);
    }
    /*IEnumerator SR1Loop1Leonie(StudentAction stu)
     * {
     *  yield return new WaitForSeconds(1f);
     *  stu.LookAtSomeone(GameObject.FindGameObjectWithTag("Player").transform);
     *  yield return new WaitForSeconds(1f);
     *  stu.LookAtSomeone(GameObject.FindGameObjectWithTag("Player").transform);
     *  yield return new WaitForSeconds(1f);
     *  stu.LookAtSomeone(GameObject.FindGameObjectWithTag("Player").transform);
     * }*/
    IEnumerator StudentWalkOutOfClass(StudentAction stu)
    {
        stu.studentAnimation.MB33_WorkOnSheets(false);
        //play iwo25 animation
        stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Bag.SetActive(true);
        yield return(new WaitForSeconds(1f));

        stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().NoteBook.SetActive(false);
        stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Book.SetActive(false);
        yield return(new WaitForSeconds(1f));

        stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Bag.SetActive(false);
        yield return(new WaitForSeconds(1f));

        stu.SetStudentBag(true);
        stu.StopLookAtSomeone();
        stu.StopMyRandomLookingAnimations();
        stu.studentAnimation.ResetAllAnim();
        stu.InitiateGoToSpot(door.transform); // to go outside
    }
    IEnumerator TriggerStudentReactionFour()
    {
        //Jannik's mood starts out Bad; his neighbor's is Good
        KidJannik.SetMyMood(MoodIndicator.Bad);
        KidJannik.myNeighbourStudent.SetMyMood(MoodIndicator.Good);
        yield return(new WaitForSeconds(2f));

        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().MovePlayer(true, tableFourPoint);
        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().LookToPlace(true, gamePlayManager.GetComponent <MainObjectsManager>().Table4);

        //other students in the class engage in work
        for (int i = 0; i < StudentsInPair.Length; i++)
        {
            if (StudentsInPair[i] != KidJannik)
            {
                StartCoroutine(AllStudentsActivity(StudentsInPair[i]));
            }
        }

        //Jannik begins working with the tablet for 5 seconds while his neighbor watches, during which, Jannik's mood turns Good and his neighbor's mood turns Bad.
        KidJannik.LookAtSomeone(KidJannik.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Tablet.transform);
        KidJannik.myNeighbourStudent.LookAtSomeone(KidJannik.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Tablet.transform);
        KidJannik.SetMyMood(MoodIndicator.Good);
        KidJannik.myNeighbourStudent.SetMyMood(MoodIndicator.Bad);
        yield return(new WaitForSeconds(5f));

        //KidJannik.studentAnimation.MB9_LookAround(true);

        //Jannik looks away and begins to protest; his mood turns Bad
        KidJannik.StopLookAtSomeone();
        KidJannik.LookAtSomeone(GameObject.Find("SpotAtCuboardNearWindow").transform);
        KidJannik.studentAnimation.MB19_Protest(true);
        KidJannik.SetMyMood(MoodIndicator.Bad);

        //Jannik's neighbor works with the tablet; his mood turns Middle
        KidJannik.myNeighbourStudent.LookAtSomeone(KidJannik.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().Tablet.transform);
        KidJannik.myNeighbourStudent.SetMyMood(MoodIndicator.Middle);

        yield return(new WaitForSeconds(5f));
    }
Exemple #9
0
    IEnumerator TriggerMainActionThree()
    {
        yield return(new WaitForSeconds(1.0f)); // timeframe is already covered for nearly 10 seconds


        ////Leonie talks back - moved from here to MainActionTwo
        //string textToTalk = "Ich habe aber keine Lust.";
        //if (gamePlayManager.LOG_ENABLED) yield return StartCoroutine(SpeechManager.Instance.WaitForTalking(textToTalk));
        //yield return new WaitForSeconds(2.0f);


        kidLeonie.SetMyRightHandStudyMaterialsVisibilty(StudyMaterial.WorkSheet, false);
        kidLeonie.SetMyRightHandStudyMaterialsVisibilty(StudyMaterial.RippedPaper, false);
        kidLeonie.SetMyLeftHandStudyMaterialsVisibilty(StudyMaterial.RippedPaper, false);
        kidLeonie.StopLookAtSomeone();
        kidLeonie.StopMyRandomLookingAnimations();
        kidLeonie.studentAnimation.ResetAllAnim();

        kidLeonie.InitiateGoToSpot(leoniePosAtCubbyBox);
        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().LookToPlayer(true, kidLeonie.myCubbyBoxPos.transform);
        Debug.Log("Leonie started to walk to her cubby box");
        yield return(new WaitForSeconds(4f));

        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().MovePlayer(true, teacherPosAtCubbyBox);
        yield return(new WaitForSeconds(2f));

        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().LookToPlayer(true, kidLeonie.gameObject.transform);
        yield return(new WaitUntil(() => kidLeonie.reachedSpot));

        // GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerMovement>().LookToPlayer(true, kidLeonie.gameObject.transform);
        yield return(new WaitForSeconds(1.5f));

        kidLeonie.SetMyRightHandStudyMaterialsVisibilty(StudyMaterial.WorkSheet, true);
        yield return(new WaitForSeconds(1.5f));

        if (!ripPaperAudio.isPlaying)
        {
            ripPaperAudio.Play();
        }
        kidLeonie.SetMyRightHandStudyMaterialsVisibilty(StudyMaterial.WorkSheet, false);

        kidLeonie.SetMyRightHandStudyMaterialsVisibilty(StudyMaterial.RippedPaper, true);
        kidLeonie.SetMyLeftHandStudyMaterialsVisibilty(StudyMaterial.RippedPaper, true);

        foreach (StudentAction sa in gamePlayManager.GetComponent <MainObjectsManager>().studentsAtTable2)
        {
            sa.StopLookAtSomeone();
            sa.StopMyRandomLookingAnimations();
            sa.LookAtSomeone(kidLeonie.gameObject.transform);
            yield return(new WaitForSeconds(Random.Range(0.1f, 0.4f)));
        }

        yield return(new WaitForSeconds(1.5f));

        kidLeonie.SetMyRightHandStudyMaterialsVisibilty(StudyMaterial.RippedPaper, false);
        kidLeonie.SetMyLeftHandStudyMaterialsVisibilty(StudyMaterial.RippedPaper, false);
        kidLeonie.SetMyRightHandStudyMaterialsVisibilty(StudyMaterial.WorkSheet, true);
        if (ripPaperAudio.isPlaying)
        {
            ripPaperAudio.Stop();
        }
        yield return(new WaitForSeconds(1.5f));

        if (!ripPaperAudio.isPlaying)
        {
            ripPaperAudio.Play();
        }
        kidLeonie.SetMyRightHandStudyMaterialsVisibilty(StudyMaterial.WorkSheet, false);
        kidLeonie.SetMyRightHandStudyMaterialsVisibilty(StudyMaterial.RippedPaper, true);
        kidLeonie.SetMyLeftHandStudyMaterialsVisibilty(StudyMaterial.RippedPaper, true);

        foreach (StudentAction sa in gamePlayManager.GetComponent <MainObjectsManager>().studentsAtTable2)
        {
            sa.StopLookAtSomeone();
            sa.StartLookBetweenTwoPeopoleRoutine(GameObject.FindGameObjectWithTag("Player").transform, kidLeonie.gameObject.transform, 2f, 4f);
            yield return(new WaitForSeconds(Random.Range(0.1f, 0.4f)));
        }
        yield return(new WaitForSeconds(3f));

        Debug.Log("MA3 finished");

        //Teacher Question Panel
        StartCoroutine(TriggerTeacherQuestionPhase());
    }
    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();
    }
Exemple #11
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));
    }