Exemplo n.º 1
0
    public IEnumerator InnerText(int id)
    {
        while (true)
        {
            t          = "";
            img.sprite = talkDatas[id].talks[i].img;
            name.text  = talkDatas[id].talks[i].name;
            char[] charArr = talkDatas[id].talks[i].talk.ToCharArray();
            for (int j = 0; j < charArr.Length; j++)
            {
                yield return(new WaitForSeconds(0.1f));

                t        += charArr[j];
                talk.text = t;
            }
            if (talkDatas[id].talks[i].eventCheck)
            {
                this.id        = id;
                this.i         = i + 1;
                this.eventBuff = talkDatas[id].talks[i].eventCnt;
                OpenNoBtn();
                break;
            }
            yield return(new WaitForSeconds(2));

            if (talkDatas[id].talks[i].endCheck)
            {
                EventPlay(id, talkDatas[id].talks[i].eventLine);
                mainMoneySystem.RestartSystem();
                break;
            }
            i++;
            if (i == talkDatas[id].talks.Count)
            {
                mainMoneySystem.RestartSystem();
                break;
            }
        }
    }
    public void Save()
    {
        mainSystem.ErrorPopup("저장을 시작합니다.");
        mainSystem.PauseSystem();

        PlayerPrefs.SetInt("Chief0", (int)mainSystem.chief.workPower);
        PlayerPrefs.SetInt("Chief1", (int)mainSystem.chief.workCritical);
        PlayerPrefs.SetInt("Chief2", (int)mainSystem.chief.handsCnt);
        PlayerPrefs.SetString("CopMoney", mainSystem.GetMoney().ToString());
        PlayerPrefs.SetInt("SlaveCnt", mainSystem.Slaves.Count);
        for (int i = 0; i < mainSystem.Slaves.Count; i++)
        {
            PlayerPrefs.SetString("SlaveKey_" + i, mainSystem.Slaves[i].key);
            PlayerPrefs.SetInt("SlaveStar_" + i, mainSystem.Slaves[i].star);
            PlayerPrefs.SetString("SlaveName_" + i, mainSystem.Slaves[i].name);
            PlayerPrefs.SetInt("SlaveHealth_" + i, mainSystem.Slaves[i].health);
            PlayerPrefs.SetInt("SlaveStress_" + i, (int)mainSystem.Slaves[i].stressBase);
            PlayerPrefs.SetInt("SlaveLoyal_" + i, (int)mainSystem.Slaves[i].loyaltyBase);
            PlayerPrefs.SetInt("SlavePay_" + i, mainSystem.Slaves[i].pay);
            PlayerPrefs.SetInt("SlavePower_" + i, (int)mainSystem.Slaves[i].workPowerBase);
            PlayerPrefs.SetInt("SlaveTitle_" + i, mainSystem.Slaves[i].titleKey);
        }
        PlayerPrefs.SetInt("WorkCnt", mainSystem.Works.Count);
        for (int i = 0; i < mainSystem.Works.Count; i++)
        {
            PlayerPrefs.SetString("WorkKey_" + i, mainSystem.Works[i].key);
            PlayerPrefs.SetInt("WorkCP_" + i, (int)mainSystem.Works[i].workCheckPoint);
        }
        PlayerPrefs.SetInt("ItemCnt", mainSystem.Items.Count);
        for (int i = 0; i < mainSystem.Items.Count; i++)
        {
            PlayerPrefs.SetInt("ItemCnt_" + i, mainSystem.Items[i].cnt);
        }
        PlayerPrefs.SetInt("Year", mainSystem.dateManager.year);
        PlayerPrefs.SetInt("Mon", mainSystem.dateManager.month);
        PlayerPrefs.SetInt("Day", mainSystem.dateManager.day);

        PlayerPrefs.SetInt("ChiefPower", (int)mainSystem.chief.workPower);
        PlayerPrefs.SetInt("ChiefPC", (int)mainSystem.chief.wpCost);
        PlayerPrefs.SetInt("ChiefCri", (int)mainSystem.chief.workCritical);
        PlayerPrefs.SetInt("ChiefCC", (int)mainSystem.chief.wcCost);
        PlayerPrefs.SetInt("ChiefHands", (int)mainSystem.chief.handsCnt);
        PlayerPrefs.SetInt("ChiefHC", (int)mainSystem.chief.handsCost);

        mainSystem.RestartSystem();
        mainSystem.ErrorPopup("저장을 끝났습니다.");
    }