IEnumerator Yeah() { ShowTalkBox showTalkBox = mainGame.CreateTalkBox(Resources.Load("Scenarios/S5-5") as TextAsset); while (true) { if (showTalkBox != null) { yield return(new WaitForSeconds(0.2f)); } else { break; } } PopUp popUp = mainGame.CreateBox("알아서들 해결해겠지", "가서 (오징어를)말린다"); while (true) { if (!popUp.FlagA && !popUp.FlagB) { yield return(new WaitForSeconds(0.2f)); } else if (popUp.FlagA) // 2번엔딩 { Destroy(popUp.gameObject); StartCoroutine(sceneMove.FadeOut()); Gang.transform.Translate(-2, 0, 0); Park.transform.rotation = new Quaternion(); Friend.transform.position = new Vector3((Gang.transform.position.x + Park.transform.position.x) / 2, (Gang.transform.position.y + Park.transform.position.y) / 2, -0.1f); yield return(new WaitForSeconds(0.5f)); StartCoroutine(sceneMove.FadeIn()); ShowTalkBox showTalkBox1 = mainGame.CreateTalkBox(Resources.Load("Scenarios/S5-6") as TextAsset); while (true) { if (showTalkBox1 != null) { yield return(new WaitForSeconds(0.2f)); } else { break; } } StartCoroutine(sceneMove.FadeOut()); yield return(new WaitForSeconds(0.5f)); Destroy(Park); Destroy(Gang); Destroy(Friend); ShowTalkBox showTalkBox2 = mainGame.CreateTalkBox(Resources.Load("Scenarios/S5-7") as TextAsset); while (true) { if (showTalkBox2 != null) { yield return(new WaitForSeconds(0.2f)); } else { break; } } TheEnd.SetActive(true); while (true) { if (Input.GetKeyUp(KeyCode.Space)) { sceneMove.Move("Intro"); break; } else { yield return(new WaitForSeconds(0.2f)); } } break; } else if (popUp.FlagB) { Destroy(popUp.gameObject); ShowTalkBox show = mainGame.CreateTalkBox(Resources.Load("Scenarios/S5-8") as TextAsset); while (true) { if (show != null) { yield return(new WaitForSeconds(0.2f)); } else { break; } } Me.transform.Translate((Me.transform.position - Gang.transform.position).normalized); StartCoroutine(sceneMove.FadeOut()); Gang.transform.Rotate(0, 0, -45); Park.transform.position = Gang.transform.position + new Vector3(0, 1, 0); yield return(new WaitForSeconds(5f)); StartCoroutine(sceneMove.FadeIn()); ShowTalkBox show1 = mainGame.CreateTalkBox(Resources.Load("Scenarios/S5-9") as TextAsset); while (true) { if (show1 != null) { yield return(new WaitForSeconds(0.2f)); } else { break; } } StartCoroutine(sceneMove.FadeOut()); yield return(new WaitForSeconds(0.2f)); ShowTalkBox show2 = mainGame.CreateTalkBox(Resources.Load("Scenarios/S5-10") as TextAsset); while (true) { if (show2 != null) { yield return(new WaitForSeconds(0.2f)); } else { break; } } while (true) { if (Input.GetKeyUp(KeyCode.Space) || Input.GetMouseButtonUp(0)) { sceneMove.Move("Intro"); } else { yield return(new WaitForSeconds(0.2f)); } } //sceneMove.Move("CookieEnding1"); break; } } yield return(null); }
IEnumerator Story() { while (Me.transform.position.x >= NPC1.transform.position.x + 1) { //Me.transform.Translate(-0.1f, 0, 0); Me.GetComponent <Rigidbody2D>().velocity = new Vector2(-2, 0); yield return(new WaitForSeconds(0.1f)); } Me.GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0); yield return(null); //기본 시나리오 작업 ShowTalkBox showTalkBox = mainGame.CreateTalkBox(Resources.Load("Scenarios/S3") as TextAsset); while (true) { if (showTalkBox != null) { yield return(new WaitForSeconds(0.2f)); } else { break; } } PopUp popUp = mainGame.CreateBox("박형석에 대하여 물어본다.", "그냥 자리에 앉는다."); bool Flag = false; while (true) { if (!popUp.FlagA && !popUp.FlagB) { yield return(new WaitForSeconds(0.2f)); } else if (popUp.FlagA) { Destroy(popUp.gameObject); ShowTalkBox g = mainGame.CreateTalkBox(Resources.Load("Scenarios/S3-A") as TextAsset); while (true) { if (g != null) { yield return(new WaitForSeconds(0.2f)); } else { break; } } break; } else if (popUp.FlagB) { Flag = true; Destroy(popUp.gameObject); break; } } showTalkBox = mainGame.CreateTalkBox(Resources.Load("Scenarios/S3-A2") as TextAsset); while (true) { if (showTalkBox != null) { yield return(new WaitForSeconds(0.2f)); } else { break; } } Me.AddComponent <CharacterMove>(); Camera.main.gameObject.AddComponent <Cam>(); Camera.main.gameObject.GetComponent <Cam>().Player = Me; while (true) { if (Me.GetComponent <CharacterMove>().Chair) { Door.SetActive(true); Me.GetComponent <CharacterMove>().enabled = false; break; } else { yield return(new WaitForSeconds(0.2f)); } } StartCoroutine(sceneMove.FadeOut()); Destroy(NPC1); schoolRing.Play(); ShowTalkBox 시발 = mainGame.CreateTalkBox(Resources.Load("Scenarios/Gohome") as TextAsset); while (true) { if (시발 != null) { yield return(new WaitForSeconds(0.2f)); } else { break; } } yield return(new WaitForSeconds(2.0f)); StartCoroutine(sceneMove.FadeIn()); Me.GetComponent <CharacterMove>().enabled = true; while (true) { if (Me.GetComponent <CharacterMove>().Door) { if (Flag) { SceneMove.Instance.Move("S4-2"); break; } else { SceneMove.Instance.Move("GoHome"); break; } } else { yield return(new WaitForSeconds(0.2f)); } } //시나리오 작업 이후 //SceneMove.Instance.Move("S3"); yield return(null); }
IEnumerator Story() { ShowTalkBox showTalkBox1 = mainGame.CreateTalkBox(Resources.Load("Scenarios/S5") as TextAsset); while (true) { if (showTalkBox1 != null) { yield return(new WaitForSeconds(0.1f)); } else { break; } } while (Me.transform.position.x > 6.0f) { Me.GetComponent <Rigidbody2D>().velocity = new Vector2(-2, 0); yield return(new WaitForSeconds(0.2f)); } Me.GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0); ShowTalkBox showTalkBox2 = mainGame.CreateTalkBox(Resources.Load("Scenarios/S5-2") as TextAsset); while (true) { if (showTalkBox2 != null) { yield return(new WaitForSeconds(0.2f)); } else { break; } } StartCoroutine(sceneMove.FadeOut()); //schoolRing.Play(); yield return(new WaitForSeconds(2.0f)); Me.transform.position = new Vector2(-20f, -5.5f); StartCoroutine(sceneMove.FadeIn()); ShowTalkBox showTalkBox3 = mainGame.CreateTalkBox(Resources.Load("Scenarios/S5-3") as TextAsset); audio.enabled = true; while (true) { if (showTalkBox3 != null) { yield return(new WaitForSeconds(0.2f)); } else { break; } } while (Letter.color.a <= 1) { Letter.color = new Color(1, 1, 1, Letter.color.a + 0.02f); yield return(new WaitForSeconds(0.1f)); } ShowTalkBox tmp = mainGame.CreateTalkBox(Resources.Load("Scenarios/Letter") as TextAsset); while (true) { if (tmp != null) { yield return(new WaitForSeconds(0.2f)); } else { break; } } while (Letter.color.a >= 0) { Letter.color = new Color(1, 1, 1, Letter.color.a - 0.2f); yield return(new WaitForSeconds(0.1f)); } Me.GetComponent <Rigidbody2D>().velocity = new Vector2(0, -2f); yield return(new WaitForSeconds(2.2f)); Me.GetComponent <Rigidbody2D>().velocity = new Vector2(8, 0); yield return(new WaitForSeconds(4f)); Me.GetComponent <Rigidbody2D>().velocity = Vector2.zero; SceneMove.Instance.Move("S5-2"); }