Example #1
0
    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);
    }
Example #2
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
    }
Example #4
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());
    }
Example #5
0
    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();
    }