Example #1
0
    IEnumerator Story()
    {
        ShowTalkBox showTalkBox = mainGame.CreateTalkBox(Resources.Load("Scenarios/S4-2") as TextAsset);

        while (true)
        {
            if (showTalkBox != null)
            {
                yield return(new WaitForSeconds(0.2f));
            }
            else
            {
                break;
            }
        }
        while (Me.transform.position.y > -3.5)
        {
            Me.GetComponent <Rigidbody2D>().velocity = new Vector2(0, -2);
            yield return(new WaitForSeconds(0.1f));
        }
        while (Me.transform.position.x < 5.6)
        {
            Me.GetComponent <Rigidbody2D>().velocity = new Vector2(2, 0);
            yield return(new WaitForSeconds(0.1f));
        }
        Me.GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0);

        SceneMove.Instance.Move("Ending03");
    }
Example #2
0
    public ShowTalkBox CreateTalkBox(TextAsset a)
    {
        ShowTalkBox Box = Instantiate(showTalkBox);

        Box.transform.SetParent(Canvas, false);
        Box.textAsset = a;
        Box.AA();

        return(Box);
    }
Example #3
0
    IEnumerator Story()
    {
        CoroutineCalled = true;
        ShowTalkBox showTalkBox = mainGame.CreateTalkBox(Resources.Load("Scenarios/Home") as TextAsset);

        while (true)
        {
            if (showTalkBox != null)
            {
                yield return(new WaitForSeconds(0.2f));
            }
            else
            {
                break;
            }
        }
        SceneMove.Instance.Move("S4");
    }
Example #4
0
    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);
    }
Example #5
0
    IEnumerator asdasd()
    {
        for (; Me.transform.position.y <= Park.transform.position.y - 2;)
        {
            Me.GetComponent <Rigidbody2D>().velocity = new Vector2(0, 1.5f);
            yield return(new WaitForSeconds(0.1f));
        }
        Me.GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0);

        var tmp = mainGame.CreateTalkBox(Resources.Load("Scenarios/S") as TextAsset);

        while (true)
        {
            if (tmp != 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)
            {
                Destroy(popUp.gameObject);

                ShowTalkBox g = mainGame.CreateTalkBox(Resources.Load("Scenarios/S-A") as TextAsset);

                while (true)
                {
                    if (g != null)
                    {
                        yield return(new WaitForSeconds(0.2f));
                    }
                    else
                    {
                        for (; Vector3.Distance(Park.transform.position, Gang.transform.position) >= 0.8f;)
                        {
                            Park.transform.Translate((Gang.transform.position - Park.transform.position).normalized * 0.2f);
                        }

                        ShowTalkBox g1 = mainGame.CreateTalkBox(Resources.Load("Scenarios/S-A(2)") as TextAsset);

                        Me.AddComponent <CharacterMove>();
                        Camera.main.gameObject.AddComponent <Cam>();
                        Camera.main.gameObject.GetComponent <Cam>().Player = Me;
                        SchoolEnter.SetActive(true);

                        break;
                    }
                }
                break;
            }
            else if (popUp.FlagB)
            {
                Destroy(popUp.gameObject);

                Me.AddComponent <CharacterMove>();
                Camera.main.gameObject.AddComponent <Cam>();
                Camera.main.gameObject.GetComponent <Cam>().Player = Me;
                SchoolEnter.SetActive(true);

                break;
            }
        }

        while (true)
        {
            if (Me.GetComponent <CharacterMove>().SchoolEnter == true)
            {
                SceneMove.Instance.Move("S2");
                break;
            }
            else
            {
                yield return(new WaitForSeconds(0.2f));
            }
        }
        yield return(null);
    }
Example #6
0
    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);
    }
Example #7
0
    IEnumerator Story()
    {
        Rigidbody2D CharacterRig = Me.GetComponent <Rigidbody2D>();

        /*CharacterRig.velocity = new Vector2(5, 0);
        *  yield return new WaitForSeconds(1f);
        *  CharacterRig.velocity = new Vector2(0, 0);
        *  yield return new WaitForSeconds(2f);
        *  CharacterRig.velocity = new Vector2(-5, 0);
        *  yield return new WaitForSeconds(1f);
        *  CharacterRig.velocity = new Vector2(0, 0);
        *  yield return new WaitForSeconds(1f);
        *  CharacterRig.velocity = new Vector2(0, -5);
        *  yield return new WaitForSeconds(0.3f);
        *  CharacterRig.velocity = new Vector2(0, 5);
        *  yield return new WaitForSeconds(0.3f);
        *  CharacterRig.velocity = new Vector2(0, 0);*/

        PopUp popUp = mainGame.CreateBox("핸드폰에서 박형석의 번호를 찾아보자.", "학생의 본분을 다한다");

        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/S4") as TextAsset);

                while (true)
                {
                    if (g != null)
                    {
                        yield return(new WaitForSeconds(0.2f));
                    }
                    else
                    {
                        break;
                    }
                }


                SceneMove.Instance.Move("S5");
                break;
            }
            else if (popUp.FlagB)
            {
                Destroy(popUp.gameObject);

                SceneMove.Instance.Move("S4-2");

                break;
            }
        }


        Camera.main.gameObject.AddComponent <Cam>();
        Camera.main.gameObject.GetComponent <Cam>().Player = Me;

        //기본 시나리오 작업
        //SceneMove.Instance.Move("#Scenes/Story/S5");
    }
Example #8
0
    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");
    }