Esempio n. 1
0
 public void ElapsedTimeUtterance()
 {
     elapsedTime = 20f;
     if (angryChar == true)
     {
         introComplete = false;
         var l = angryElapsedTimeUtterances.Length;
         var i = Random.Range(0, l);
         if (currentClip.priority < angryElapsedTimeUtterances[i].priority)
         {
             audso.Stop();
             audso.PlayOneShot(angryElapsedTimeUtterances[i].clip);
             startTime   = Time.time;
             currentClip = angryElapsedTimeUtterances[i];
             //currentPriority = angryRotationUtterances[i].priority;
         }
     }
     else
     {
         //PlayScript("death", "happy");
         introComplete = false;
         var l = happyElapsedTimeUtterances.Length;
         var i = Random.Range(0, l);
         if (currentClip.priority < happyElapsedTimeUtterances[i].priority)
         {
             audso.Stop();
             audso.PlayOneShot(happyElapsedTimeUtterances[i].clip);
             startTime   = Time.time;
             currentClip = happyElapsedTimeUtterances[i];
             //currentPriority = angryRotationUtterances[i].priority;
         }
     }
 }
Esempio n. 2
0
 public void SecondMovingPlatformUtterance()
 {
     //print("Oh wow the idiot can move a platform");
     if (angryChar == true)
     {
         if (secondMovingPlatformToggle == false)
         {
             //print("you got a coint without moving!!");
             introComplete = false;
             audso.Stop();
             audso.PlayOneShot(angrySecondMovingPlatformUtterance.clip);
             startTime   = Time.time;
             currentClip = angrySecondMovingPlatformUtterance;
             secondMovingPlatformToggle = true;
         }
     }
     else
     {
         if (secondMovingPlatformToggle == false)
         {
             //print("you got a coint without moving!!");
             introComplete = false;
             audso.Stop();
             audso.PlayOneShot(happySecondMovingPlatformUtterance.clip);
             startTime   = Time.time;
             currentClip = happySecondMovingPlatformUtterance;
             secondMovingPlatformToggle = true;
         }
     }
 }
Esempio n. 3
0
    public void SidewaysPlatformUtterance()
    {
        //print("SIDEWAYS UTTEREANCASNASCNA");

        if (angryChar == true)
        {
            if (firstSidewaysPlatformToggle == false)
            {
                introComplete = false;
                audso.Stop();
                audso.PlayOneShot(angryFirstSidewaysPlatformUtterance.clip);
                startTime   = Time.time;
                currentClip = angryFirstSidewaysPlatformUtterance;
                firstSidewaysPlatformToggle = true;
            }
        }
        else
        {
            if (firstSidewaysPlatformToggle == false)
            {
                introComplete = false;
                audso.Stop();
                audso.PlayOneShot(happyFirstSidewaysPlatformUtterance.clip);
                startTime   = Time.time;
                currentClip = happyFirstSidewaysPlatformUtterance;
                firstSidewaysPlatformToggle = true;
            }
        }
    }
Esempio n. 4
0
 public void CoinCollectUttererance()
 {
     if (angryChar == true)
     {
         if (coinWithoutMoveToggle == false)
         {
             //print("you got a coint without moving!!");
             introComplete = false;
             audso.Stop();
             audso.PlayOneShot(angryCoinWithoutMoveUtterance.clip);
             startTime             = Time.time;
             currentClip           = angryCoinWithoutMoveUtterance;
             coinWithoutMoveToggle = true;
         }
     }
     else
     {
         if (coinWithoutMoveToggle == false)
         {
             //print("you got a coint without moving!!");
             introComplete = false;
             audso.Stop();
             audso.PlayOneShot(happyCoinWithoutMoveUtterance.clip);
             startTime             = Time.time;
             currentClip           = happyCoinWithoutMoveUtterance;
             coinWithoutMoveToggle = true;
         }
     }
 }
Esempio n. 5
0
 public void LevelSixUtterance()
 {
     if (levelSixTrigger == false)
     {
         if (angryChar == true)
         {
             //print("you got a coint without moving!!");
             introComplete = false;
             audso.Stop();
             audso.PlayOneShot(angryLevelSixUtterance.clip);
             startTime   = Time.time;
             currentClip = angryLevelSixUtterance;
         }
         else
         {
             //print("you got a coint without moving!!");
             introComplete = false;
             audso.Stop();
             audso.PlayOneShot(happyLevelSixUtterance.clip);
             startTime   = Time.time;
             currentClip = happyLevelSixUtterance;
         }
         levelSixTrigger = true;
     }
 }
Esempio n. 6
0
    public void LevelCompleteUtterance(int sceneIndex)
    {
        //calling increment/reset in Fall and Rotate, resetting count after one utterance (might want to change)
        //print("Round and round we go!!");
        if (angryChar == true)
        {
            if (currentClip.priority < angryLevelCompleteUtterances[sceneIndex - 1].priority)
            {
                introComplete = false;
                audso.Stop();
                audso.PlayOneShot(angryLevelCompleteUtterances[sceneIndex - 1].clip);
                startTime   = Time.time;
                currentClip = angryLevelCompleteUtterances[sceneIndex - 1];
                //currentPriority = angryLevelCompleteUtterances[sceneIndex].priority;
            }


            //PlayScript("rotations", "angry");
        }
        else
        {
            if (currentClip.priority < happyLevelCompleteUtterances[sceneIndex - 1].priority)
            {
                introComplete = false;
                audso.Stop();
                audso.PlayOneShot(happyLevelCompleteUtterances[sceneIndex - 1].clip);
                startTime   = Time.time;
                currentClip = happyLevelCompleteUtterances[sceneIndex - 1];
                //currentPriority = angryLevelCompleteUtterances[sceneIndex].priority;
            }
        }
    }
Esempio n. 7
0
    public void NotEnoughCoinsUttererance()
    {
        //print("you dont have all the coins idiot");

        if (angryChar == true)
        {
            if (finishWithoutCoinToggle == false)
            {
                introComplete = false;
                audso.Stop();
                audso.PlayOneShot(angryFinishWithoutCoinsUtterance.clip);
                startTime               = Time.time;
                currentClip             = angryFinishWithoutCoinsUtterance;
                finishWithoutCoinToggle = true;
            }
        }
        else
        {
            if (finishWithoutCoinToggle == false)
            {
                introComplete = false;
                audso.Stop();
                audso.PlayOneShot(happyFinishWithoutCoinsUtterance.clip);
                startTime               = Time.time;
                currentClip             = happyFinishWithoutCoinsUtterance;
                finishWithoutCoinToggle = true;
            }
        }
    }
Esempio n. 8
0
 public void LevelIntroductionUtterance(int sceneIndex)
 {
     //print("lv intro!!");
     if (angryChar == true)
     {
         //print(sceneIndex);
         if (currentClip.priority < angryLevelIntroUtterances[sceneIndex - 1].priority)
         {
             //print("intro!!");
             audso.Stop();
             audso.PlayOneShot(angryLevelIntroUtterances[sceneIndex - 1].clip);
             startTime   = Time.time;
             currentClip = angryLevelIntroUtterances[sceneIndex - 1];
         }
     }
     else
     {
         if (currentClip.priority < happyLevelIntroUtterances[sceneIndex - 1].priority)
         {
             //print("intro!!");
             audso.Stop();
             audso.PlayOneShot(happyLevelIntroUtterances[sceneIndex - 1].clip);
             startTime   = Time.time;
             currentClip = happyLevelIntroUtterances[sceneIndex - 1];
         }
     }
 }
Esempio n. 9
0
 public void QEUtterance()
 {
     //calling increment/reset in Fall and Rotate, resetting count after one utterance (might want to change)
     //print("Round and round we go!!");
     if (angryChar == true)
     {
         //PlayScript("qe", "angry");
         var l = angryQEUtterances.Length;
         var i = Random.Range(0, l);
         if (currentClip.priority < angryQEUtterances[i].priority)
         {
             audso.Stop();
             audso.PlayOneShot(angryQEUtterances[i].clip);
             startTime   = Time.time;
             currentClip = angryQEUtterances[i];
             //currentPriority = angryRotationUtterances[i].priority;
         }
     }
     else
     {
         var l = happyQEUtterances.Length;
         var i = Random.Range(0, l);
         if (currentClip.priority < happyQEUtterances[i].priority)
         {
             audso.Stop();
             audso.PlayOneShot(happyQEUtterances[i].clip);
             startTime   = Time.time;
             currentClip = happyQEUtterances[i];
             //currentPriority = angryRotationUtterances[i].priority;
         }
     }
 }
Esempio n. 10
0
 //UTTERANCES
 public void NoFallUtterance()
 {
     //print("You didnt even fall!");
     if (angryChar == true)
     {
         PlayScript("nofall", "angry");
     }
     else
     {
         //PlayScript("nofall", "happy");
         var l = happyNoFallUtterances.Length;
         var i = Random.Range(0, l);
         if (currentClip.priority < happyNoFallUtterances[i].priority)
         {
             audso.Stop();
             audso.PlayOneShot(happyNoFallUtterances[i].clip);
             startTime   = Time.time;
             currentClip = happyNoFallUtterances[i];
             //currentPriority = angryRotationUtterances[i].priority;
         }
     }
 }
Esempio n. 11
0
 public void ResetPriority()
 {
     //currentPriority = -1;
     currentClip = reset;
     audso.Stop();
 }
Esempio n. 12
0
    private void Update()
    {
        if (Manager.instance != null)
        {
            angryChar = Manager.instance.angryChar;
        }
        elapsedTime -= Time.deltaTime;
        if (elapsedTime <= 0)
        {
            ElapsedTimeUtterance();
        }


        //Same key in a row
        if (wCount >= 4 || aCount >= 4 || sCount >= 4 || dCount >= 4 || qCount >= 4 || eCount >= 4)
        {
            CircleUtterance();
            ResetKeyCounts();
        }
        if (notQECount > 10)
        {
            QEUtterance();
            ResetQECount();
        }


        if (introComplete == true && isPlaying() == false && angryChar == true)
        {
            PlayScript("instructions", "angry");
        }
        else if (introComplete == true && isPlaying() == false && angryChar == false)
        {
            PlayScript("instructions", "happy");
        }
        if (isPlaying() == false)
        {
            currentClip = reset;
        }
        if (audso.isPlaying == false)
        {
            currentPriority = 0;
        }
        if (Input.GetKeyDown(KeyCode.K))
        {
            if (currentPriority > clip2.priority)
            {
                //audso.Stop();
                //audso.PlayOneShot(clip2.clip);
            }
        }
        if (Input.GetKeyDown(KeyCode.Space))
        {
            //PlayScript("intro", "angry");
        }



        if (SceneManager.GetActiveScene().buildIndex == 7 && levelSevenTrigger == false)
        {
            levelSevenTimer -= Time.deltaTime;
            if (levelSevenTimer <= 0)
            {
                LevelSevenUtterance();
                levelSevenTrigger = true;
            }
        }
    }
Esempio n. 13
0
 public void PlayScript(string category, string emotion)
 {
     if (category == "intro" && emotion == "happy")
     {
         //print("play lvl 1 intro");
         var l = happyIntroUtterances.Length;
         var i = Random.Range(0, l);
         audso.PlayOneShot(happyIntroUtterances[0].clip);
         //isPlayingCheck
         startTime     = Time.time;
         currentClip   = happyIntroUtterances[0];
         introComplete = true;
         //currentPriority = happyIntroUtterances[i].priority;
     }
     if (category == "intro" && emotion == "angry")
     {
         var l = angryIntroUtterances.Length;
         var i = Random.Range(0, l);
         audso.PlayOneShot(angryIntroUtterances[0].clip);
         startTime     = Time.time;
         currentClip   = angryIntroUtterances[0];
         introComplete = true;
         //currentPriority = angryIntroUtterances[i].priority;
     }
     if (category == "instructions" && emotion == "angry")
     {
         audso.PlayOneShot(angryInstructionUtterance.clip);
         startTime     = Time.time;
         currentClip   = angryInstructionUtterance;
         introComplete = false;
         //currentPriority = angryIntroUtterances[i].priority;
     }
     if (category == "instructions" && emotion == "happy")
     {
         audso.PlayOneShot(happyInstructionUtterance.clip);
         startTime     = Time.time;
         currentClip   = happyInstructionUtterance;
         introComplete = false;
         //currentPriority = angryIntroUtterances[i].priority;
     }
     if (category == "rotations" && emotion == "angry")
     {
         var l = angryRotationUtterances.Length;
         var i = Random.Range(0, l);
         if (currentClip.priority < angryRotationUtterances[i].priority)
         {
             audso.Stop();
             audso.PlayOneShot(angryRotationUtterances[i].clip);
             startTime   = Time.time;
             currentClip = angryRotationUtterances[i];
             //currentPriority = angryRotationUtterances[i].priority;
         }
     }
     if (category == "nofall" && emotion == "angry")
     {
         var l = angryNoFallUtterances.Length;
         var i = Random.Range(0, l);
         if (currentClip.priority < angryNoFallUtterances[i].priority)
         {
             audso.Stop();
             audso.PlayOneShot(angryNoFallUtterances[i].clip);
             startTime   = Time.time;
             currentClip = angryNoFallUtterances[i];
             //currentPriority = angryRotationUtterances[i].priority;
         }
     }
     if (category == "death" && emotion == "angry")
     {
         introComplete = false;
         var l = angryDeathUtterances.Length;
         var i = Random.Range(0, l);
         if (currentClip.priority < angryDeathUtterances[i].priority)
         {
             audso.Stop();
             audso.PlayOneShot(angryDeathUtterances[i].clip);
             startTime   = Time.time;
             currentClip = angryDeathUtterances[i];
             //currentPriority = angryRotationUtterances[i].priority;
         }
     }
     if (category == "restart" && emotion == "angry")
     {
         introComplete = false;
         if (deathByBoundry == true)
         {
             var l = angryRespawnBoundryUtterances.Length;
             var i = Random.Range(0, l);
             if (currentClip.priority < angryRespawnBoundryUtterances[i].priority)
             {
                 audso.Stop();
                 audso.PlayOneShot(angryRespawnBoundryUtterances[i].clip);
                 startTime   = Time.time;
                 currentClip = angryRespawnBoundryUtterances[i];
             }
         }
         else if (deathBySpike == true)
         {
             var l = angryRespawnSpikeUtterances.Length;
             var i = Random.Range(0, l);
             if (currentClip.priority < angryRespawnSpikeUtterances[i].priority)
             {
                 audso.Stop();
                 audso.PlayOneShot(angryRespawnSpikeUtterances[i].clip);
                 startTime   = Time.time;
                 currentClip = angryRespawnSpikeUtterances[i];
             }
         }
         else if (deathByWall == true)
         {
             var l = angryRespawnWallUtterances.Length;
             var i = Random.Range(0, l);
             if (currentClip.priority < angryRespawnWallUtterances[i].priority)
             {
                 audso.Stop();
                 audso.PlayOneShot(angryRespawnWallUtterances[i].clip);
                 startTime   = Time.time;
                 currentClip = angryRespawnWallUtterances[i];
             }
         }
         deathByWall    = false;
         deathBySpike   = false;
         deathByBoundry = false;
     }
     if (category == "restart" && emotion == "happy")
     {
         introComplete = false;
         if (deathByBoundry == true)
         {
             var l = happyRespawnBoundryUtterances.Length;
             var i = Random.Range(0, l);
             if (currentClip.priority < happyRespawnBoundryUtterances[i].priority)
             {
                 audso.Stop();
                 audso.PlayOneShot(happyRespawnBoundryUtterances[i].clip);
                 startTime   = Time.time;
                 currentClip = happyRespawnBoundryUtterances[i];
             }
         }
         else if (deathBySpike == true)
         {
             var l = happyRespawnSpikeUtterances.Length;
             var i = Random.Range(0, l);
             if (currentClip.priority < happyRespawnSpikeUtterances[i].priority)
             {
                 audso.Stop();
                 audso.PlayOneShot(happyRespawnSpikeUtterances[i].clip);
                 startTime   = Time.time;
                 currentClip = happyRespawnSpikeUtterances[i];
             }
         }
         else if (deathByWall == true)
         {
             var l = happyRespawnWallUtterances.Length;
             var i = Random.Range(0, l);
             if (currentClip.priority < happyRespawnWallUtterances[i].priority)
             {
                 audso.Stop();
                 audso.PlayOneShot(happyRespawnWallUtterances[i].clip);
                 startTime   = Time.time;
                 currentClip = happyRespawnWallUtterances[i];
             }
         }
         deathByWall    = false;
         deathBySpike   = false;
         deathByBoundry = false;
     }
 }