Esempio n. 1
0
    private void GetReadyForQuestion()
    {
        // Reset text
        dribblingTime.text = LocalizeBase.GetLocalizedString("time_left") + 5;

        // Look at the selected.
        closest.transform.LookAt(selectedPlayer.transform);

        // Trigger head animation
        if (selectedPlayer.name != "bluePlayer6")
        {
            StartCoroutine(closest.GetComponent <PlayerAI>().head(ball));
        }



        // After time finishes
        // Movement disabled and ready for shoot

        // Disable him to move
        selectedPlayer.GetComponent <PlayerControl>().canMove = false;

        //Turn the player towards his next passing mate
        selectedPlayer.transform.LookAt(targetPlayer.transform);

        // Ready for shoot
        selectedPlayer.GetComponent <Animator>().SetBool("readyForShoot", true);

        // Make invisible the Text
        dribblingTime.gameObject.SetActive(false);

        // Put ball in front of player
        putBallInfrontOfPlayer();

        // Hide joystick
        joystick.gameObject.SetActive(false);

        // Brings up the question UI and holds the control until player answeres correctly
        questionManager.AskQuestion(false);

        Sprites2D.SetActive(false);
    }