Beispiel #1
0
    // // // // // // // // // // // // // // // // /

    private void gameOver()
    {
        Debug.Log("GAME OVER");
        GetComponent <Animator> ().enabled = true;
        animator.SetBool("isGameOver", true);
        targetRotationX              = 0;
        targetRotationY              = 0;
        leftHand.transform.position  = inposLeftHand;
        rigthHand.transform.position = inposRigthHand;
        leftleg.transform.position   = inposLeftleg;
        rigthLeg.transform.position  = inposRigthLeg;

        for (int i = 0; i < players.Length; i++)
        {
            poseController playerPose = players[i].GetComponent <poseController> ();

            if (!playerPose.isGameOver)
            {
                playerPose.gameOver();
                playerPose.win();
            }
            else
            {
                playerPose.lose();
            }
        }
    }
Beispiel #2
0
    public void checkPlayersPose()
    {
        bool playerPass = false;

        for (int i = 0; i < players.Length; i++)
        {
            bool playerBodyPass = checkBody(players [i]);
            bool playerHeadPass = checkHead(players [i]);
            if (playerBodyPass && playerHeadPass)
            {
                poseController currentPlayer = players [i].GetComponent <poseController> ();
                if (currentPlayer.npc)
                {
                    currentPlayer.resetPositionsButtons();
                }
                playerPass = true;
                players [i].GetComponent <poseController> ().animator.SetBool("rigthPose", true);
                players [i].GetComponent <poseController> ().animator.enabled = true;
            }
            else if (!players [i].GetComponent <poseController> ().isGameOver)
            {
                players [i].GetComponent <poseController> ().animator.SetBool("wrongPose", true);
                players [i].GetComponent <poseController> ().gameOver();
                contGameOver++;
            }
        }

        StartCoroutine(timeFeedback(playerPass));
    }
Beispiel #3
0
 private void setNpcPose()      //NPC MEXE O CORPO
 {
     for (int i = 0; i < players.Length; i++)
     {
         poseController playerPose = players[i].GetComponent <poseController> ();
         if (playerPose.npc && !playerPose.isGameOver)
         {
             playerPose.setNPCControler(sortButtons, new Vector2(targetRotationX, targetRotationY), currentLevel);
         }
     }
 }
Beispiel #4
0
    public IEnumerator timeFeedback(bool _pass)
    {
        yield return(new WaitForSeconds(3));

        for (int i = 0; i < players.Length; i++)
        {
            poseController pose = players [i].GetComponent <poseController> ();
            pose.animator.SetBool("rigthPose", false);
            pose.animator.SetBool("wrongPose", false);
            if (!pose.isGameOver)
            {
                pose.animator.enabled = false;
            }
        }
        if (contGameOver >= 3)
        {
            gameOver();
        }
        if (_pass && contGameOver < 3)
        {
            danceAgain();
        }
    }