コード例 #1
0
    private bool Story2GoOn()
    {
        if (storyStatus == 0)
        {
            //场景开始
            ShowTextOnePage("Bot008: We have 90 seconds before the next Garbage-Collect!\n\n\n(Click the left mouse button continue)");
            timeText.gameObject.SetActive(true);
            storyStatus++;
        }
        else if (storyStatus == 1)
        {
            WaitingPlayerClickLeftMouse();
        }
        else if (storyStatus == 2)
        {
            ShowTextOnePage("Bot008: Make more enemy bodies! At least...100!!\n\n\n\n(Click the left mouse button continue)");
            enemyNumberText.gameObject.SetActive(true);
            storyStatus++;
        }
        else if (storyStatus == 3)
        {
            WaitingPlayerClickLeftMouse();
        }
        else if (storyStatus == 4)
        {
            ShowTextOnePage("Bot008: I made some adjustments to your weapon, But the less memory, the weaker it is.\n\n\n(Click the left mouse button continue)");
            //改变玩家武器大小
            player.changeWeaponSize(enemyNumber);
            storyStatus++;
        }
        else if (storyStatus == 5)
        {
            //等待玩家点击开始
            WaitingPlayerClickLeftMouse();
        }
        else if (storyStatus == 6)
        {
            ShowTextOnePage("Bot008: Now, let's DANCE!!!\n\n\n\n(Click the left mouse button continue)");
            storyStatus++;
        }
        else if (storyStatus == 7)
        {
            //等待玩家点击开始
            WaitingPlayerClickLeftMouse();
        }
        else if (storyStatus == 8)
        {
            ResetScene2();
            DrawCountText();
            storyStatus = 10;
        }
        else if (storyStatus == 10)
        {
            //正常刷怪
            return(false);
        }
        else if (storyStatus == 100)
        {
            //通关
            if (!isDialogGoing)
            {
                string[] chatStrings = new[]
                {
                    "Bot008: DONE!!! I've *SERIALIZED* our data!",
                    "Bot008: See you outside!"
                };
                if (chatStrings.Length > dialogStatus)
                {
                    ShowOnePageTextAndCountDown2Hide(chatStrings[dialogStatus]);
                    dialogStatus++;
                }
                else
                {
                    storyStatus++;
                }
            }

            return(true);
        }
        else if (storyStatus == 101)
        {
            //画面ZoomOut++
            player.mainCamera.GetComponent <CameraManager>().ZoomOutPlus();
            endText.gameObject.SetActive(true);
            pressRText.gameObject.SetActive(false);
            enemyNumberText.gameObject.SetActive(false);
            timeText.gameObject.SetActive(false);
            StartCoroutine(DeleteOnyByOne());
        }
        else if (storyStatus == 102)
        {
            //生成文件
            string Current = Directory.GetCurrentDirectory();
            Debug.Log(Current);
            string Robot213File = FileUtil.LoadFile(Current, "_Robot213");
            string Bot008File   = FileUtil.LoadFile(Current, "_Bot008");
            string FileInfo     = "Thank you for playing!\nSource:https://github.com/RhythmRhyme/LD47.git";
            if (Robot213File == null)
            {
                FileUtil.CreateFile(Current, "_Robot213.data", FileUtil.Base64Encode(FileInfo));
            }

            if (Bot008File == null)
            {
                FileUtil.CreateFile(Current, "_Bot008.data", FileUtil.Base64Encode(FileInfo));
            }
            //退出游戏
            Debug.Log("Application.Quit()");
            Application.Quit();
        }
        else if (storyStatus == -100)
        {
            //玩家死亡
            ShowTextOnePage("Bot008: You can't be killed, or we'll LOOSE TIME!(-5s)\n\n\n\n(Press \"R\" continue)");
            time = Mathf.Max(time - 5, 0);
            storyStatus++;
        }
        else if (storyStatus == -99)
        {
            //按R键继续
            if (Input.GetKeyDown(KeyCode.R))
            {
                HideText();
                storyStatus = 10;
                player.checkPressR(false);
            }
        }
        else if (storyStatus == -200)
        {
            //时间到
            ShowTextOnePage(
                "Bot008: The garbage collection mechanism is here. It's put in place to prevent you from being cleaned up. We have to start over\n\n(Click the left mouse button continue)");
            storyStatus++;
        }
        else if (storyStatus == -199)
        {
            WaitingPlayerClickLeftMouse();
        }
        else if (storyStatus == -198)
        {
            SceneManager.LoadScene("Scene2");
        }

        return(true);
    }