Пример #1
0
    IEnumerator TriggerStudentReactionThree()
    {
        //Student mumbling low
        audioInClass.volume = 0.1f;
        audioInClass.Play();

        KidHanna.FindMyChair("Chair", ChairNoLena);
        KidLena.FindMyChair("Chair", ChairNoHanna);
        KidHanna.FindMyNeighbour();
        KidLena.FindMyNeighbour();
        KidJannik.FindMyNeighbour();
        KidJannik.myNeighbourStudent = KidHanna;
        for (int i = 0; i < gamePlayManager.studentsActions.Count; i++)
        {
            gamePlayManager.studentsActions[i].StopLookAtSomeone();
            gamePlayManager.studentsActions[i].StopMyRandomLookingAnimations();
            gamePlayManager.studentsActions[i].studentAnimation.ResetAllAnim();
            gamePlayManager.studentsActions[i].SetMyMood(MoodIndicator.Good);
        }
        yield return(new WaitForSeconds(1.0f));

        for (int i = 0; i < SR2StudentsInPair_1.Length; i++)
        {
            StartCoroutine(SR3StudentWalkTowardsFrontDesk(SR2StudentsInPair_1[i], 1)); // sit in different seats .. add this
        }
        for (int i = 0; i < SR2StudentsInPair_2.Length; i++)
        {
            StartCoroutine(SR3StudentWalkTowardsFrontDesk(SR2StudentsInPair_2[i], 2));
        }

        //Student mumbling middle
        audioInClass.volume = 0.3f;
        audioInClass.Play();

        yield return(new WaitForSeconds(18.0f));

        GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>().LookToPlace(true, tableFourPoint);
        KidJannik.studentAnimation.MB33_WorkOnSheets(false);
        KidJannik.myNeighbourStudent.studentAnimation.MB33_WorkOnSheets(false);
        KidJannik.SetMyMood(MoodIndicator.Bad);
        KidJannik.myNeighbourStudent.SetMyMood(MoodIndicator.Bad);
        KidJannik.studentAnimation.MB9_LookAround(true);
        KidJannik.myNeighbourStudent.studentAnimation.MB9_LookAround(true);
        yield return(new WaitForSeconds(4.0f));

        KidJannik.studentAnimation.MB33_WorkOnSheets(true);
        KidJannik.myNeighbourStudent.studentAnimation.MB33_WorkOnSheets(true);
    }
Пример #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");
    }