IEnumerator OpenCharacterSelection() { // Activer écran Character Selection blockInputs = true; inputActivationScript.inputDeactivation(); characterSelection.SetActive(true); characterSelection.GetComponent <Animator>().SetBool("slideTransition", false); // Lancer anim ouverture portes rightBackgroundDoorScript = GameObject.Find("BackgroundRight").GetComponent <BackgroundDoor>(); leftBackgroundDoorScript = GameObject.Find("BackgroundLeft").GetComponent <BackgroundDoor>(); rightBackgroundAnim = GameObject.Find("BackgroundRight").GetComponent <Animator>(); leftBackgroundAnim = GameObject.Find("BackgroundLeft").GetComponent <Animator>(); rightBackgroundAnim.SetBool("closeDoor", true); leftBackgroundAnim.SetBool("closeDoor", true); yield return(new WaitUntil(() => rightBackgroundDoorScript.closeOver && leftBackgroundDoorScript.closeOver)); rightBackgroundAnim.SetBool("closeDoor", false); leftBackgroundAnim.SetBool("closeDoor", false); // set inputOK une fois l'anim terminée characterInputActivationScript.inputOK = true; // Activer hints hints.SetActive(true); // Désactiver écran sélection map blockInputs = false; transform.transform.parent.gameObject.SetActive(false); }
void Start() { screenManager = FindObjectOfType <ScreenManager> (); inputActivationScript = transform.parent.GetComponent <ActivateInput>(); rightBackgroundAnim = GameObject.Find("BackgroundRight").GetComponent <Animator>(); leftBackgroundAnim = GameObject.Find("BackgroundLeft").GetComponent <Animator>(); hints = GameObject.Find("Hints"); MusicManager.instance.PlayMusic("menu"); rightBackgroundDoorScript = GameObject.Find("BackgroundRight").GetComponent <BackgroundDoor>(); leftBackgroundDoorScript = GameObject.Find("BackgroundLeft").GetComponent <BackgroundDoor>(); }