private IEnumerator SecondActHouseFire() { //Conversacion con Koke a las puertas de la casa en llamas. player.stopFromMoving(); Koke = FindObjectOfType <Koke>(); Koke.popUpMeeting(); isTaskPending = true; while (isTaskPending) { yield return(new WaitForSeconds(0.1f)); } //Moveriamos a Koke Koke.enterBurnedHouse(); yield return(new WaitForSeconds(1f)); //Ahora es conversacion sola Olivia. Koke.conversationPhase += 1; Koke.popUpMeeting(); isTaskPending = true; while (isTaskPending) { yield return(new WaitForSeconds(0.1f)); } Koke.conversationPhase += 1; soundManager.stopAllAudios(); soundManager.playAudioByScene("SecondStageRevelation"); //Teletransportamos a Olivia con un gradiente blanco. //Reaprovechamos Loading Screen y lo ponemos en blanco a 0 de transparencia loadScreen.transform.Find("LoadingSprite").gameObject.SetActive(false); Image fondoBlanco = loadScreen.transform.Find("FondoNegro").GetComponent <Image>(); fondoBlanco.color = new Color(255, 255, 255, 0); loadScreen.SetActive(!loadScreen.activeSelf); float transparency = 0.05f; while (fondoBlanco.color.a < 1) { fondoBlanco.color = new Color(255, 255, 255, transparency); transparency += 0.05f; yield return(new WaitForSeconds(0.1f)); } //Termina el fade y transportamos a Olivia player.transform.position = GameObject.FindGameObjectWithTag("revelation").transform.position; //Buscamos el confiner PolygonCollider2D confinador = GameObject.FindGameObjectWithTag("Confiner").transform.Find("confinerRevelation").GetComponent <PolygonCollider2D>(); player.transform.Find("VirtualCam").GetComponent <CinemachineConfiner>().m_BoundingShape2D = confinador; yield return(new WaitForSeconds(2f)); Debug.Log("Llegamos"); while (fondoBlanco.color.a > 0) { transparency -= 0.05f; fondoBlanco.color = new Color(255, 255, 255, transparency); yield return(new WaitForSeconds(0.1f)); } loadScreen.SetActive(!loadScreen.activeSelf); player.continueMoving(); yield return(null); }
public IEnumerator waitForTaskEndFirstAct(Koke npc) { //Triggereamos la primera conversación de koke. npc.popUpMeeting(); //Esperamos a que acabe la conversacion isTaskPending = true; while (isTaskPending) { yield return(new WaitForSeconds(0.1f)); } //Cuando acabe le cambiamos la fase de conversacion npc.conversationPhase += 1; yield return(new WaitForSeconds(1f)); npc.destroyAndScalate(); yield return(new WaitForSeconds(1f)); npc.popUpMeeting(); isTaskPending = true; while (isTaskPending) { yield return(new WaitForSeconds(0.1f)); } npc.conversationPhase += 1; //Lo movemos fuera del mapa npc.MoveToPosition(); yield return(new WaitForSeconds(6f)); npc.gameObject.SetActive(false); Destroy(GameObject.FindGameObjectWithTag("FirstWall")); player.continueMoving(); isTaskPending = true; }
private IEnumerator woodsConversation() { player.stopFromMoving(); Koke kokenpc = FindObjectOfType <Koke>(); kokenpc.popUpMeeting(); isTaskPending = true; while (isTaskPending) { yield return(new WaitForSeconds(0.1f)); } kokenpc.conversationPhase += 1; kokenpc.extinted = false; //Ahora se iria y desapareceria kokenpc.exitForest(); GameObject wiki = player.transform.Find("Wiki").gameObject; wiki.transform.Find("Circuito").gameObject.SetActive(true); wiki.transform.Find("Grafos").gameObject.SetActive(true); wiki.transform.Find("Prim").gameObject.SetActive(true); wiki.transform.Find("MariaButton").gameObject.SetActive(true); yield return(new WaitForSeconds(4f)); kokenpc.gameObject.SetActive(false); player.continueMoving(); yield return(null); }
private IEnumerator waitForTaskEndFirstActHouse(Koke npc, Barbara barbnpc) { //Triggereamos la primera conversación de koke. npc.popUpMeeting(); //Esperamos a que acabe la conversacion isTaskPending = true; while (isTaskPending) { yield return(new WaitForSeconds(0.1f)); } //Cuando acabe le cambiamos la fase de conversacion npc.conversationPhase += 1; npc.extinted = false; //Movemos a Koke y Barbara a sus posiciones barbnpc.MoveToTable(); npc.MoveToBed(); canActivatePuzzle = true; yield return(new WaitForSeconds(3f)); //Cogemos sus posiciones para la carga. kokeHouse = npc.transform.position; barbHouse = barbnpc.transform.position; //Activamos el menu para la wiki GameObject.FindGameObjectWithTag("Movement").transform.Find("MenuButton").gameObject.SetActive(true); GameObject.FindGameObjectWithTag("Movement").transform.Find("Life").gameObject.SetActive(true); player.continueMoving(); player.canAttack = true; //Termina la conversacion conjunta y ahora para desactivar las puertas de las granjas Olivia tiene que hablar con el Barbara yield return(null); }
private IEnumerator SecondActMaria() { player.transform.Find("VirtualCam").GetComponent <CinemachineConfiner>().InvalidatePathCache(); PolygonCollider2D collider = GameObject.FindGameObjectWithTag("Confiner").transform.Find("confinerMaria").GetComponent <PolygonCollider2D>(); player.transform.Find("VirtualCam").GetComponent <CinemachineConfiner>().m_BoundingShape2D = collider; GameObject[] marias = GameObject.FindGameObjectsWithTag("Maria"); marias[0].transform.position = new Vector3(-4.779f, 4.418f, 0); marias[1].transform.position = new Vector3(-4.779f, 4.418f, 0); Animator anim = player.GetComponent <Animator>(); anim.SetFloat("IdleState", 1); anim.SetFloat("IdleStateY", 0.5f); Image fondoBlanco = loadScreen.transform.Find("FondoNegro").GetComponent <Image>(); float transparency = 1f; //Triggereamos conversacion nueva con Koke Koke.popUpMeeting(); isTaskPending = true; while (isTaskPending) { if (fondoBlanco.color.a > 0) { transparency -= 0.05f; fondoBlanco.color = new Color(255, 255, 255, transparency); yield return(new WaitForSeconds(0.2f)); } yield return(new WaitForSeconds(0.1f)); } Koke.conversationPhase += 1; loadScreen.SetActive(!loadScreen.activeSelf); loadScreen.transform.Find("LoadingSprite").gameObject.SetActive(true); fondoBlanco.color = new Color(0, 0, 0, 255); //Despertamos a Maria y conversacion con Koke for (int i = 0; i < marias.Length; i++) { if (marias[i].name.Equals("cifradoMaria")) { marias[i].gameObject.SetActive(false); } else { while (marias[i].transform.localScale.x < 0.75) { marias[i].transform.localScale = new Vector3(marias[i].transform.localScale.x + 0.1f, marias[i].transform.localScale.y + 0.1f, 0); yield return(new WaitForSeconds(0.1f)); } } } Koke.popUpMeeting(); isTaskPending = true; while (isTaskPending) { yield return(new WaitForSeconds(0.1f)); } //Teletransportamos a Olivia a la plataforma StartCoroutine(transitionToNewLevel("FinalBoss")); //player.continueMoving(); yield return(null); }
private IEnumerator finalBoss() { player.stopFromMoving(); Koke = FindObjectOfType <Koke>(); Koke.moveToArcaelum(); yield return(new WaitForSeconds(1f)); Koke.popUpMeeting(); isTaskPending = true; while (isTaskPending) { yield return(new WaitForSeconds(0.1f)); } Koke.conversationPhase += 1; Destroy(Instantiate(punishEffect, Koke.transform.position, Quaternion.identity), 1f); yield return(new WaitForSeconds(1f)); Koke.transform.position = new Vector2(1000, 1000); yield return(new WaitForSeconds(2f)); Koke.popUpMeeting(); isTaskPending = true; while (isTaskPending) { yield return(new WaitForSeconds(0.1f)); } Koke.conversationPhase += 1; GameObject finalBoss = GameObject.FindGameObjectWithTag("FinalBoss"); finalBoss.SetActive(false); Destroy(Instantiate(bossSpawnEffect, finalBoss.transform.position, Quaternion.identity), 1.1f); yield return(new WaitForSeconds(1f)); Instantiate(arcaelum, finalBoss.transform.position, Quaternion.identity); soundManager.playAudioByScene("FinalBossPhaseOne"); backgroundRepetion br = FindObjectOfType <backgroundRepetion>(); br.ascensionSpeed = 1f; br.canStartScrolling = true; player.continueMoving(); yield return(new WaitForSeconds(3f)); br.ascensionSpeed = 5f; }
private IEnumerator genPuzzleEvent(Koke kokenpc, Barbara barbnpc) { player.stopFromMoving(); kokenpc.conversationPhase = 4; yield return(new WaitForSeconds(2)); kokenpc.MoveToGenerator(); yield return(new WaitForSeconds(1.5f)); barbnpc.MoveToGenerator(); yield return(new WaitForSeconds(1f)); kokenpc.popUpMeeting(); isTaskPending = true; while (isTaskPending) { yield return(new WaitForSeconds(0.1f)); } kokenpc.conversationPhase += 1; kokenpc.extinted = false; //Metemos a Barbara en casa. Cerramos la puerta, abrimos la del bosque y mandamos a Koke al Bosque. Ponemos las habilidades activas GameObject abilities = GameObject.FindGameObjectWithTag("AbilitieManager"); for (int i = 0; i < abilities.transform.childCount; i++) { abilities.transform.GetChild(i).gameObject.SetActive(true); } barbnpc.backToHouse(); kokenpc.MoveToForest(); yield return(new WaitForSeconds(3f)); barbnpc.gameObject.SetActive(false); kokenpc.gameObject.SetActive(false); GameObject barreras = GameObject.FindGameObjectWithTag("barrerasHolder"); for (int i = 0; i < barreras.transform.childCount; i++) { barreras.transform.GetChild(i).gameObject.SetActive(true); } GameObject.FindGameObjectWithTag("BarreraBosque").SetActive(false); player.continueMoving(); //Cuando acabemos le damos los modulos de generador y compilador GameObject generalMenu = player.transform.Find("GeneralMenu").gameObject; Button generator = generalMenu.transform.Find("BotonGenerador").GetComponent <Button>(); generator.interactable = true; generator.GetComponentInChildren <TextMeshProUGUI>().text = "GENERADOR"; Button compilador = generalMenu.transform.Find("BotonCompilador").GetComponent <Button>(); compilador.interactable = true; compilador.GetComponentInChildren <TextMeshProUGUI>().text = "COMPILADOR"; }