コード例 #1
0
    IEnumerator SR3StudentWalkTowardsFrontDesk(StudentAction stu, int val)
    {
        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 (val == 1)
        {
            stu.rightHandStudyMaterials.YellowPaper.SetActive(true);
        }
        else
        {
            stu.rightHandStudyMaterials.BluePaper.SetActive(true);
        }
        stu.studentAnimation.TakeItem(false);



        stu.GoToAndSitInChair();
        yield return(new WaitForSeconds(1f));

        yield return(new WaitUntil((() => stu.reachedSpot)));

        if (val == 1) // book yellow
        {
            stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().YellowPaper.SetActive(true);
            stu.rightHandStudyMaterials.YellowPaper.SetActive(false);
        }
        else
        {
            stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().BluePaper.SetActive(true);
            stu.rightHandStudyMaterials.BluePaper.SetActive(false);
        }
        yield return(new WaitForSeconds(4f));

        //stu.LookAtSomeone(stu.rightHandStudyMaterials.YellowPaper.transform);
        //stu.myNeighbourStudent.LookAtSomeone(stu.rightHandStudyMaterials.YellowPaper.transform);
        if (stu != KidJannik || stu != KidJannik.myNeighbourStudent)
        {
            stu.studentAnimation.MB33_WorkOnSheets(true);
            stu.myNeighbourStudent.studentAnimation.MB33_WorkOnSheets(true);
        }
        yield return(new WaitForSeconds(4f));
    }
コード例 #2
0
    IEnumerator SR1WalkTowardsFrontDesk(StudentAction stu)
    {
        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));

        stu.studentAnimation.TakeItem(false);
        stu.SetMyRightHandStudyMaterialsVisibilty(StudyMaterial.WorkSheet, true);
        stu.GoToAndSitInChair();
        yield return(new WaitUntil((() => stu.reachedSpot)));

        stu.studentAnimation.MB30_PeepToSideLeftOrRight(true);
    }
コード例 #3
0
    /*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
    }
コード例 #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());
    }
コード例 #5
0
    IEnumerator SR4StudentWalkTowardsFrontDesk(StudentAction stu, int val, float delay)
    {
        yield return(new WaitForSeconds(delay));

        stu.studentAnimation.ResetAllAnim();

        //walk to the Teacher's desk and stand and talk to your neighbor upon arriving
        //stu.InitiateGoToSpot(TeacherDesk.transform);
        stu.InitiateGoToSpot(TeacherDesk_outer.transform);
        yield return(new WaitUntil((() => stu.reachedSpot)));

        yield return(new WaitUntil((() => stu.myNeighbourStudent.reachedSpot)));

        stu.studentAnimation.MB42_StandCrossArms(true);
        yield return(new WaitForSeconds(3f));

        stu.studentAnimation.MB42_StandCrossArms(false);

        //stu.studentAnimation.WalkingToStandUpIdle(true);
        stu.InitiateGoToSpot(TeacherDesk.transform);
        yield return(new WaitForSeconds(1f));

        //take booklet and return to your seat

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

        if (val == 1)
        {
            stu.rightHandStudyMaterials.YellowPaper.SetActive(true);
        }
        else
        {
            stu.rightHandStudyMaterials.BluePaper.SetActive(true);
        }
        stu.studentAnimation.TakeItem(false);
        //stu.GoToAndSitInChair();

        yield return(new WaitUntil((() => stu.reachedSpot)));

        if (val == 1) // book yellow
        {
            stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().YellowPaper.SetActive(true);
            stu.rightHandStudyMaterials.YellowPaper.SetActive(true);
            yield return(new WaitForSeconds(2f));

            stu.GoToAndSitInChair();
        }
        else
        {
            stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().BluePaper.SetActive(true);
            stu.rightHandStudyMaterials.BluePaper.SetActive(true);
            yield return(new WaitForSeconds(2f));

            stu.GoToAndSitInChair();
        }
        yield return(new WaitForSeconds(1f));

        //stu.LookAtSomeone(stu.rightHandStudyMaterials.YellowPaper.transform);
        //stu.myNeighbourStudent.LookAtSomeone(stu.rightHandStudyMaterials.YellowPaper.transform);
        yield return(new WaitForSeconds(2f));

        if (stu != KidJannik)
        {
            stu.rightHandStudyMaterials.YellowPaper.SetActive(false);
        }
        stu.rightHandStudyMaterials.BluePaper.SetActive(false);
        stu.studentAnimation.MB33_WorkOnSheets(true);
        yield return(new WaitForSeconds(3f));
    }
コード例 #6
0
    IEnumerator SR2StudentWalkTowardsFrontDesk(StudentAction stu, int val, bool lastStudent)
    {
        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 (val == 1)
        {
            stu.rightHandStudyMaterials.YellowPaper.SetActive(true);
        }
        else
        {
            stu.rightHandStudyMaterials.BluePaper.SetActive(true);
        }
        //stu.LookAtSomeone(stu.chairPoint);
        yield return(new WaitForSeconds(0.5f));

        stu.GoToAndSitInChair();
        yield return(new WaitForSeconds(1f));

        yield return(new WaitUntil((() => stu.reachedSpot)));

        if (val == 1) // book yellow
        {
            stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().YellowPaper.SetActive(true);
            stu.rightHandStudyMaterials.YellowPaper.SetActive(false);
        }
        else
        {
            stu.chairPoint.gameObject.transform.GetComponentInChildren <StudyMaterialType>().BluePaper.SetActive(true);
            stu.rightHandStudyMaterials.BluePaper.SetActive(false);
        }
        yield return(new WaitForSeconds(1f));

        //stu.LookAtSomeone(stu.rightHandStudyMaterials.YellowPaper.transform);
        //stu.myNeighbourStudent.LookAtSomeone(stu.rightHandStudyMaterials.YellowPaper.transform);
        stu.studentAnimation.MB33_WorkOnSheets(true);
        stu.myNeighbourStudent.studentAnimation.MB33_WorkOnSheets(true);
        yield return(new WaitForSeconds(4f));

        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();

            //move to final phase, where students with blue books become bored.
            StartCoroutine(SR2_FinalPhase());
        }
    }
コード例 #7
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();
        }
    }