Beispiel #1
0
    public bool getQuestCount(int id, bool daily)
    {
        Entity_quest_count_mst questMst = Resources.Load("Data/quest_count_mst") as Entity_quest_count_mst;
        bool dailyTmp = questMst.param[id].daily;

        if (dailyTmp == daily)
        {
        }
        return(daily);
    }
Beispiel #2
0
    void getAllData()
    {
        kuniLv = PlayerPrefs.GetInt("kuniLv");
        if (kuniLv <= 0)
        {
            kuniLv = 1;
        }
        PlayerPrefs.SetInt("kuniLv", kuniLv);
        kuniExp    = PlayerPrefs.GetInt("kuniExp");
        myDaimyo   = PlayerPrefs.GetInt("myDaimyo");
        addJinkei1 = PlayerPrefs.GetBool("addJinkei1");
        addJinkei2 = PlayerPrefs.GetBool("addJinkei2");
        addJinkei3 = PlayerPrefs.GetBool("addJinkei3");
        addJinkei4 = PlayerPrefs.GetBool("addJinkei4");

        //common
        yearSeason     = PlayerPrefs.GetString("yearSeason");
        seiryoku       = PlayerPrefs.GetString("seiryoku");
        money          = PlayerPrefs.GetInt("money");
        busyoDama      = PlayerPrefs.GetInt("busyoDama");
        syogunDaimyoId = PlayerPrefs.GetInt("syogunDaimyoId");
        doumei         = PlayerPrefs.GetString("doumei");
        movieCount     = PlayerPrefs.GetInt("movieCount");

        Entity_quest_mst questMst = Resources.Load("Data/quest_mst") as Entity_quest_mst;

        for (int i = 0; i < questMst.param.Count; i++)
        {
            bool dailyFlg = questMst.param[i].daily;
            if (!dailyFlg)
            {
                string tmp       = "questSpecialFlg" + i.ToString();
                bool   activeFlg = PlayerPrefs.GetBool(tmp, false);
                if (activeFlg)
                {
                    questSpecialFlgId.Add(i);
                    string tmp2       = "questSpecialReceivedFlg" + i.ToString();
                    bool   activeFlg2 = PlayerPrefs.GetBool(tmp2, false);
                    if (!activeFlg2)
                    {
                        questSpecialReceivedFlgId.Add(false);
                    }
                    else
                    {
                        questSpecialReceivedFlgId.Add(true);
                    }
                }
            }
        }
        Entity_quest_count_mst questCountMst = Resources.Load("Data/quest_count_mst") as Entity_quest_count_mst;

        for (int i = 0; i < questCountMst.param.Count; i++)
        {
            bool dailyFlg = questCountMst.param[i].daily;
            if (!dailyFlg)
            {
                string tmp       = "questSpecialCountReceivedFlg" + i.ToString();
                bool   activeFlg = PlayerPrefs.GetBool(tmp, false);
                if (activeFlg)
                {
                    questSpecialCountReceivedFlg.Add(true);
                }
                else
                {
                    questSpecialCountReceivedFlg.Add(false);
                }
            }
        }


        //busyo
        myBusyo        = PlayerPrefs.GetString("myBusyo");
        gacyaDaimyoHst = PlayerPrefs.GetString("gacyaDaimyoHst");

        char[] delimiterChars = { ',' };
        if (myBusyo.Contains(","))
        {
            myBusyoList = new List <string>(myBusyo.Split(delimiterChars));
        }
        else
        {
            myBusyoList.Add(myBusyo);
        }
        for (int i = 0; i < myBusyoList.Count; i++)
        {
            string busyoId = myBusyoList[i];

            int busyoLv = PlayerPrefs.GetInt(busyoId);
            lvList.Add(busyoLv);

            string heiTmp    = "hei" + busyoId;
            string heiString = PlayerPrefs.GetString(heiTmp);
            heiList.Add(heiString);

            string senpouTmp = "senpou" + busyoId;
            int    senpouLv  = PlayerPrefs.GetInt(senpouTmp);
            senpouLvList.Add(senpouLv);

            string sakuTmp = "saku" + busyoId;
            int    sakuLv  = PlayerPrefs.GetInt(sakuTmp);
            sakuLvList.Add(sakuLv);

            string kahouTmp    = "kahou" + busyoId;
            string kahouString = PlayerPrefs.GetString(kahouTmp);
            kahouList.Add(kahouString);

            //addLevel
            string addLvTmp = "addlv" + busyoId.ToString();
            int    addlv    = PlayerPrefs.GetInt(addLvTmp);
            addLvList.Add(addlv);

            //gokui
            string gokuiTmp = "gokui" + busyoId;
            int    gokuiId  = PlayerPrefs.GetInt(gokuiTmp);
            gokuiList.Add(gokuiId);

            //kanni
            string kanniTmp = "kanni" + busyoId;
            int    kanniId  = PlayerPrefs.GetInt(kanniTmp);
            kanniList.Add(kanniId);
        }

        //item
        myKanni              = PlayerPrefs.GetString("myKanni");
        availableBugu        = PlayerPrefs.GetString("availableBugu");
        availableKabuto      = PlayerPrefs.GetString("availableKabuto");
        availableGusoku      = PlayerPrefs.GetString("availableGusoku");
        availableMeiba       = PlayerPrefs.GetString("availableMeiba");
        availableCyadougu    = PlayerPrefs.GetString("availableCyadougu");
        availableHeihousyo   = PlayerPrefs.GetString("availableHeihousyo");
        availableChishikisyo = PlayerPrefs.GetString("availableChishikisyo");
        kanjyo      = PlayerPrefs.GetString("kanjyo");
        cyouheiYR   = PlayerPrefs.GetString("cyouheiYR");
        cyouheiKB   = PlayerPrefs.GetString("cyouheiKB");
        cyouheiTP   = PlayerPrefs.GetString("cyouheiTP");
        cyouheiYM   = PlayerPrefs.GetString("cyouheiYM");
        hidensyoGe  = PlayerPrefs.GetInt("hidensyoGe");
        hidensyoCyu = PlayerPrefs.GetInt("hidensyoCyu");
        hidensyoJyo = PlayerPrefs.GetInt("hidensyoJyo");
        shinobiGe   = PlayerPrefs.GetInt("shinobiGe");
        shinobiCyu  = PlayerPrefs.GetInt("shinobiCyu");
        shinobiJyo  = PlayerPrefs.GetInt("shinobiJyo");
        kengouItem  = PlayerPrefs.GetString("kengouItem");
        gokuiItem   = PlayerPrefs.GetString("gokuiItem");
        nanbanItem  = PlayerPrefs.GetString("nanbanItem");
        transferTP  = PlayerPrefs.GetInt("transferTP");
        transferKB  = PlayerPrefs.GetInt("transferKB");
        meisei      = PlayerPrefs.GetInt("meisei");
        shiro       = PlayerPrefs.GetString("shiro");
        koueki      = PlayerPrefs.GetString("koueki");
        cyoutei     = PlayerPrefs.GetString("cyoutei");

        //zukan
        zukanBusyoHst       = PlayerPrefs.GetString("zukanBusyoHst");
        zukanBuguHst        = PlayerPrefs.GetString("zukanBuguHst");
        zukanGusokuHst      = PlayerPrefs.GetString("zukanGusokuHst");
        zukanKabutoHst      = PlayerPrefs.GetString("zukanKabutoHst");
        zukanMeibaHst       = PlayerPrefs.GetString("zukanMeibaHst");
        zukanCyadouguHst    = PlayerPrefs.GetString("zukanCyadouguHst");
        zukanChishikisyoHst = PlayerPrefs.GetString("zukanChishikisyoHst");
        zukanHeihousyoHst   = PlayerPrefs.GetString("zukanHeihousyoHst");
        gameClearDaimyo     = PlayerPrefs.GetString("gameClearDaimyo");
        gameClearDaimyoHard = PlayerPrefs.GetString("gameClearDaimyoHard");

        //naisei
        Entity_kuni_mst kuniMst = Resources.Load("Data/kuni_mst") as Entity_kuni_mst;

        for (int i = 0; i < kuniMst.param.Count; i++)
        {
            int    kuniId    = i + 1;
            string naiseiTmp = "naisei" + kuniId.ToString();
            if (PlayerPrefs.HasKey(naiseiTmp))
            {
                naiseiKuniList.Add(kuniId);
                naiseiList.Add(PlayerPrefs.GetString(naiseiTmp));

                string shiroTmp = "shiro" + kuniId;
                int    shiroId  = PlayerPrefs.GetInt(shiroTmp, 0);
                naiseiShiroList.Add(shiroId);
            }
        }
    }
Beispiel #3
0
    public void OnClick()
    {
        AudioSource sound = GameObject.Find("SEController").GetComponent <AudioSource>();

        sound.PlayOneShot(sound.clip);

        if (!clicked)
        {
            clicked = true;

            //color
            Color pushedTabColor  = new Color(118f / 255f, 103f / 255f, 16f / 255f, 255f / 255f);
            Color pushedTextColor = new Color(219f / 255f, 219f / 255f, 212f / 255f, 255f / 255f);
            Color normalTabColor  = new Color(255f / 255f, 255f / 255f, 255f / 255f, 255f / 255f);
            Color normalTextColor = new Color(255f / 255f, 255f / 255f, 0f / 255f, 255f / 255f);

            GetComponent <Image>().color = pushedTabColor;
            transform.FindChild("Text").GetComponent <Text>().color = pushedTextColor;
            otherObj.GetComponent <Image>().color = normalTabColor;
            otherObj.transform.FindChild("Text").GetComponent <Text>().color = normalTextColor;
            otherObj.GetComponent <QuestMenu>().clicked = false;

            //delete previous one
            GameObject content = scrollObj.transform.FindChild("Content").gameObject;
            foreach (Transform chld in content.transform)
            {
                Destroy(chld.gameObject);
            }

            //create count slot
            string activeCountSlotPath           = "Prefabs/Map/quest/ActiveQuestCountSlot";
            Entity_quest_count_mst questCountMst = Resources.Load("Data/quest_count_mst") as Entity_quest_count_mst;
            for (int j = 0; j < activeCountList.Count; j++)
            {
                int id = activeCountList[j];

                GameObject slot = Instantiate(Resources.Load(activeCountSlotPath)) as GameObject;
                slot.transform.SetParent(content.transform);
                slot.transform.localScale = new Vector2(1, 1);
                string title = "";
                if (Application.systemLanguage != SystemLanguage.Japanese)
                {
                    title = questCountMst.param[id].titleEng;
                }
                else
                {
                    title = questCountMst.param[id].title;
                }
                string exp = "";
                if (Application.systemLanguage != SystemLanguage.Japanese)
                {
                    exp = questCountMst.param[id].expEng;
                }
                else
                {
                    exp = questCountMst.param[id].exp;
                }
                string target      = questCountMst.param[id].target;
                int    amnt        = questCountMst.param[id].amnt;
                bool   daily       = questCountMst.param[id].daily;
                string criteriaTyp = questCountMst.param[id].criteriaTyp;
                int    criteria    = questCountMst.param[id].criteria;

                string key = "";
                if (daily)
                {
                    key = "questDailyCountReceivedFlg" + id.ToString();
                }
                else
                {
                    key = "questSpecialCountReceivedFlg" + id.ToString();
                }

                int count = 0;
                if (criteriaTyp == "movieCount")
                {
                    count = PlayerPrefs.GetInt("movieCount");
                }
                else if (criteriaTyp == "zukanBusyoHstCount")
                {
                    string        zukanBusyoHst     = PlayerPrefs.GetString("zukanBusyoHst");
                    List <string> zukanBusyoHstList = new List <string>();
                    char[]        delimiterChars    = { ',' };
                    if (zukanBusyoHst != null && zukanBusyoHst != "")
                    {
                        if (zukanBusyoHst.Contains(","))
                        {
                            zukanBusyoHstList = new List <string>(zukanBusyoHst.Split(delimiterChars));
                        }
                        else
                        {
                            zukanBusyoHstList.Add(zukanBusyoHst);
                        }
                    }
                    count = zukanBusyoHstList.Count;
                }
                else if (criteriaTyp == "gameClearDaimyoCount")
                {
                    string        gameClearDaimyo     = PlayerPrefs.GetString("gameClearDaimyo");
                    List <string> gameClearDaimyoList = new List <string>();
                    char[]        delimiterChars      = { ',' };
                    if (gameClearDaimyo != null && gameClearDaimyo != "")
                    {
                        if (gameClearDaimyo.Contains(","))
                        {
                            gameClearDaimyoList = new List <string>(gameClearDaimyo.Split(delimiterChars));
                        }
                        else
                        {
                            gameClearDaimyoList.Add(gameClearDaimyo);
                        }
                    }

                    string        gameClearDaimyoHard     = PlayerPrefs.GetString("gameClearDaimyoHard");
                    List <string> gameClearDaimyoHardList = new List <string>();
                    if (gameClearDaimyoHard != null && gameClearDaimyoHard != "")
                    {
                        if (gameClearDaimyoHard.Contains(","))
                        {
                            gameClearDaimyoHardList = new List <string>(gameClearDaimyoHard.Split(delimiterChars));
                        }
                        else
                        {
                            gameClearDaimyoHardList.Add(gameClearDaimyoHard);
                        }
                    }
                    count = gameClearDaimyoList.Count + gameClearDaimyoHardList.Count;
                }

                GameObject itemImage  = slot.transform.FindChild("itemImage").gameObject;
                GameObject itemQty    = slot.transform.FindChild("itemQty").gameObject;
                GameObject titleValue = slot.transform.FindChild("titleValue").gameObject;
                GameObject expValue   = slot.transform.FindChild("expValue").gameObject;

                if (target == "busyoDama")
                {
                    string imagePath = "Prefabs/Common/Sprite/busyoDama";
                    itemImage.GetComponent <Image>().sprite =
                        Resources.Load(imagePath, typeof(Sprite)) as Sprite;
                }
                else
                {
                    string imagePath = "Prefabs/Common/Sprite/money";
                    itemImage.GetComponent <Image>().sprite =
                        Resources.Load(imagePath, typeof(Sprite)) as Sprite;
                }

                itemQty.GetComponent <Text>().text    = amnt.ToString();
                titleValue.GetComponent <Text>().text = title;
                expValue.GetComponent <Text>().text   = exp;

                slot.transform.FindChild("ReceiveButton").transform.FindChild("count").GetComponent <Text>().text = count.ToString() + "/" + criteria.ToString();
                QuestReceive btnScript = slot.transform.FindChild("ReceiveButton").GetComponent <QuestReceive>();
                btnScript.criteria = criteria;
                btnScript.count    = count;
                btnScript.id       = id;
                btnScript.key      = key;
                btnScript.target   = target;
                btnScript.amnt     = amnt;
                btnScript.slot     = slot;
            }


            //create slot
            QuestInfo questScript    = new QuestInfo();
            string    activeSlotPath = "Prefabs/Map/quest/ActiveQuestSlot";
            for (int j = 0; j < activeList.Count; j++)
            {
                int        id   = activeList[j];
                GameObject slot = Instantiate(Resources.Load(activeSlotPath)) as GameObject;
                slot.transform.SetParent(content.transform);
                slot.transform.localScale = new Vector2(1, 1);

                string title  = questScript.getQuestTitle(id);
                string exp    = questScript.getQuestExp(id);
                string target = questScript.getQuestTarget(id);
                int    amnt   = questScript.getQuestAmnt(id);
                bool   daily  = questScript.getQuestDaily(id);
                string key    = "";
                if (daily)
                {
                    key = "questDailyReceivedFlg" + id.ToString();
                }
                else
                {
                    key = "questSpecialReceivedFlg" + id.ToString();
                }

                GameObject itemImage  = slot.transform.FindChild("itemImage").gameObject;
                GameObject itemQty    = slot.transform.FindChild("itemQty").gameObject;
                GameObject titleValue = slot.transform.FindChild("titleValue").gameObject;
                GameObject expValue   = slot.transform.FindChild("expValue").gameObject;

                if (target == "busyoDama")
                {
                    string imagePath = "Prefabs/Common/Sprite/busyoDama";
                    itemImage.GetComponent <Image>().sprite =
                        Resources.Load(imagePath, typeof(Sprite)) as Sprite;
                }
                else
                {
                    string imagePath = "Prefabs/Common/Sprite/money";
                    itemImage.GetComponent <Image>().sprite =
                        Resources.Load(imagePath, typeof(Sprite)) as Sprite;
                }

                itemQty.GetComponent <Text>().text    = amnt.ToString();
                titleValue.GetComponent <Text>().text = title;
                expValue.GetComponent <Text>().text   = exp;

                QuestReceive btnScript = slot.transform.FindChild("ReceiveButton").GetComponent <QuestReceive>();
                btnScript.id     = id;
                btnScript.key    = key;
                btnScript.target = target;
                btnScript.amnt   = amnt;
                btnScript.slot   = slot;
            }

            //Show Inactive QuestSlot
            string inactiveSlotPath = "Prefabs/Map/quest/InactiveQuestSlot";
            for (int k = 0; k < inactiveList.Count; k++)
            {
                int id = inactiveList[k];

                GameObject slot = Instantiate(Resources.Load(inactiveSlotPath)) as GameObject;
                slot.transform.SetParent(content.transform);
                slot.transform.localScale = new Vector2(1, 1);

                string title  = questScript.getQuestTitle(id);
                string exp    = questScript.getQuestExp(id);
                string target = questScript.getQuestTarget(id);
                int    amnt   = questScript.getQuestAmnt(id);

                GameObject itemImage  = slot.transform.FindChild("itemImage").gameObject;
                GameObject itemQty    = slot.transform.FindChild("itemQty").gameObject;
                GameObject titleValue = slot.transform.FindChild("titleValue").gameObject;
                GameObject expValue   = slot.transform.FindChild("expValue").gameObject;

                if (target == "busyoDama")
                {
                    string imagePath = "Prefabs/Common/Sprite/busyoDama";
                    itemImage.GetComponent <Image>().sprite =
                        Resources.Load(imagePath, typeof(Sprite)) as Sprite;
                }
                else
                {
                    string imagePath = "Prefabs/Common/Sprite/money";
                    itemImage.GetComponent <Image>().sprite =
                        Resources.Load(imagePath, typeof(Sprite)) as Sprite;
                }

                itemQty.GetComponent <Text>().text    = amnt.ToString();
                titleValue.GetComponent <Text>().text = title;
                expValue.GetComponent <Text>().text   = exp;
            }

            //Scroll Position
            ScrollRect scrollRect = scrollObj.GetComponent <ScrollRect>();
            scrollRect.verticalNormalizedPosition = 1;
        }
    }
Beispiel #4
0
    private void Start()
    {
        Entity_quest_mst       questMst      = Resources.Load("Data/quest_mst") as Entity_quest_mst;
        Entity_quest_count_mst questCountMst = Resources.Load("Data/quest_count_mst") as Entity_quest_count_mst;

        //Set common param
        if (name == "Daily")
        {
            daily = true;
        }
        foreach (Transform chld in transform.parent)
        {
            if (chld.name != gameObject.name)
            {
                otherObj = chld.gameObject;
            }
        }

        //Set quest count data
        List <int> skipGrpList = new List <int>();

        for (int i = 0; i < questCountMst.param.Count; i++)
        {
            bool dailyFlg = questCountMst.param[i].daily;
            int  grpId    = questCountMst.param[i].grp;
            if (!skipGrpList.Contains(grpId))
            {
                if (!dailyFlg && !daily)
                {
                    //Special
                    string tmp         = "questSpecialCountReceivedFlg" + i.ToString();
                    bool   receivedFlg = PlayerPrefs.GetBool(tmp, false);

                    if (!receivedFlg)
                    {
                        activeCountList.Add(i);
                        skipGrpList.Add(grpId);
                    }
                }
                else if (dailyFlg && daily)
                {
                    //Daily
                    string tmp         = "questDailyCountReceivedFlg" + i.ToString();
                    bool   receivedFlg = PlayerPrefs.GetBool(tmp, false);
                    if (!receivedFlg)
                    {
                        activeCountList.Add(i);
                        skipGrpList.Add(grpId);
                    }
                }
            }
        }

        //Set quest data
        for (int i = 0; i < questMst.param.Count; i++)
        {
            bool dailyFlg = questMst.param[i].daily;

            if (!dailyFlg && !daily)
            {
                //Special
                string tmp       = "questSpecialFlg" + i.ToString();
                bool   activeFlg = PlayerPrefs.GetBool(tmp, false);
                if (activeFlg)
                {
                    string tmp2       = "questSpecialReceivedFlg" + i.ToString();
                    bool   activeFlg2 = PlayerPrefs.GetBool(tmp2, false);
                    if (!activeFlg2)
                    {
                        activeList.Add(i);
                    }
                }
                else
                {
                    string tmp2       = "questSpecialReceivedFlg" + i.ToString();
                    bool   activeFlg2 = PlayerPrefs.GetBool(tmp2, false);
                    if (!activeFlg2)
                    {
                        inactiveList.Add(i);
                    }
                }
            }
            else if (dailyFlg && daily)
            {
                //Daily
                string tmp       = "questDailyFlg" + i.ToString();
                bool   activeFlg = PlayerPrefs.GetBool(tmp, false);
                if (activeFlg)
                {
                    //active
                    string tmp2       = "questDailyReceivedFlg" + i.ToString();
                    bool   activeFlg2 = PlayerPrefs.GetBool(tmp2, false);
                    if (!activeFlg2)
                    {
                        activeList.Add(i);
                    }
                }
                else
                {
                    //inactive
                    string tmp2       = "questSpecialReceivedFlg" + i.ToString();
                    bool   activeFlg2 = PlayerPrefs.GetBool(tmp2, false);
                    if (!activeFlg2)
                    {
                        inactiveList.Add(i);
                    }
                }
            }
        }

        //initial set
        if (daily)
        {
            OnClick();
        }
    }
    public void OnClick()
    {
        AudioSource[] audioSources = GameObject.Find("SEController").GetComponents <AudioSource>();

        if (name == "YesButton")
        {
            audioSources[0].Play();
            RecoveryDataStore RecoveryDataStore = GameObject.Find("RecoveryDataStore").GetComponent <RecoveryDataStore>();

            //Common
            PlayerPrefs.SetBool("tutorialDoneFlg", true);
            PlayerPrefs.SetInt("kuniLv", RecoveryDataStore.kuniLv);
            Exp expScript   = new Exp();
            int jinkeiLimit = expScript.getJinkeiLimit(RecoveryDataStore.kuniLv);
            int stockLimit  = expScript.getStockLimit(RecoveryDataStore.kuniLv);
            PlayerPrefs.SetInt("jinkeiLimit", jinkeiLimit);
            PlayerPrefs.SetInt("stockLimit", stockLimit);
            PlayerPrefs.SetString("userId", RecoveryDataStore.inputUserId);
            if (RecoveryDataStore.addJinkei1)
            {
                PlayerPrefs.SetBool("addJinkei1", true);
            }
            else
            {
                PlayerPrefs.SetBool("addJinkei1", false);
            }
            if (RecoveryDataStore.addJinkei2)
            {
                PlayerPrefs.SetBool("addJinkei2", true);
            }
            else
            {
                PlayerPrefs.SetBool("addJinkei2", false);
            }
            if (RecoveryDataStore.addJinkei3)
            {
                PlayerPrefs.SetBool("addJinkei3", true);
            }
            else
            {
                PlayerPrefs.SetBool("addJinkei3", false);
            }
            if (RecoveryDataStore.addJinkei4)
            {
                PlayerPrefs.SetBool("addJinkei4", true);
            }
            else
            {
                PlayerPrefs.SetBool("addJinkei4", false);
            }

            if (RecoveryDataStore.dataStore_userId == 0)
            {
                /***dataStore***/
                PlayerPrefs.SetInt("kuniExp", RecoveryDataStore.kuniExp);
                PlayerPrefs.SetString("yearSeason", RecoveryDataStore.yearSeason);
                PlayerPrefs.SetInt("movieCount", RecoveryDataStore.movieCount);
                string seiryoku = RecoveryDataStore.seiryoku;
                if (seiryoku == "")
                {
                    seiryoku = "1,2,3,4,5,6,7,8,3,4,9,10,12,11,13,14,15,16,3,17,18,17,19,8,19,19,20,21,22,23,24,25,26,27,28,29,30,31,31,32,33,34,35,35,36,37,38,38,38,38,31,31,31,39,40,41,41,41,41,42,43,44,45,45,46";
                }
                PlayerPrefs.SetString("seiryoku", seiryoku);
                KuniInfo kuniScript = new KuniInfo();
                kuniScript.updateOpenKuni(RecoveryDataStore.myDaimyo, seiryoku);
                kuniScript.updateClearedKuni(RecoveryDataStore.myDaimyo, seiryoku);
                PlayerPrefs.SetInt("money", RecoveryDataStore.money);
                PlayerPrefs.SetInt("busyoDama", RecoveryDataStore.busyoDama);
                PlayerPrefs.SetInt("syogunDaimyoId", RecoveryDataStore.syogunDaimyoId);
                PlayerPrefs.SetString("doumei", RecoveryDataStore.doumei);

                for (int i = 0; i < RecoveryDataStore.questSpecialFlgId.Count; i++)
                {
                    int    questId = RecoveryDataStore.questSpecialFlgId[i];
                    string tmp     = "questSpecialFlg" + questId.ToString();
                    string tmp2    = "questSpecialReceivedFlg" + questId.ToString();
                    PlayerPrefs.SetBool(tmp, true);

                    bool questReceivedFlg = RecoveryDataStore.questSpecialReceivedFlgId[i];
                    if (questReceivedFlg)
                    {
                        PlayerPrefs.SetBool(tmp2, true);
                    }
                    else
                    {
                        PlayerPrefs.SetBool(tmp2, false);
                    }
                }

                Entity_quest_count_mst questCountMst = Resources.Load("Data/quest_count_mst") as Entity_quest_count_mst;
                for (int i = 0; i < questCountMst.param.Count; i++)
                {
                    bool dailyFlg = questCountMst.param[i].daily;
                    if (!dailyFlg)
                    {
                        countSpecialList.Add(i);
                    }
                }
                if (RecoveryDataStore.questSpecialCountReceivedFlg.Count != 0)
                {
                    for (int i = 0; i < countSpecialList.Count; i++)
                    {
                        int    id  = countSpecialList[i];
                        string tmp = "questSpecialCountReceivedFlg" + id.ToString();
                        bool   questReceivedFlg = RecoveryDataStore.questSpecialCountReceivedFlg[i];
                        if (questReceivedFlg)
                        {
                            PlayerPrefs.SetBool(tmp, true);
                        }
                        else
                        {
                            PlayerPrefs.SetBool(tmp, false);
                        }
                    }
                }


                int    count   = 0;
                string myBusyo = "";
                for (int i = 0; i < RecoveryDataStore.busyoList.Count; i++)
                {
                    int busyoId = RecoveryDataStore.busyoList[i];

                    if (busyoId != 0)
                    {
                        //add busyo
                        if (myBusyo == null || myBusyo == "")
                        {
                            myBusyo = busyoId.ToString();
                        }
                        else
                        {
                            myBusyo = myBusyo + "," + busyoId.ToString();
                        }
                        //add parametor
                        int    lv       = RecoveryDataStore.lvList[count];
                        string hei      = RecoveryDataStore.heiList[count];
                        int    senpouLv = RecoveryDataStore.senpouLvList[count];
                        int    sakuLv   = RecoveryDataStore.sakuLvList[count];
                        string kahou    = RecoveryDataStore.kahouList[count];

                        //lv
                        PlayerPrefs.SetInt(busyoId.ToString(), lv);
                        if (lv <= 0)
                        {
                            lv = 1;
                        }

                        //hei
                        string heiTmp = "hei" + busyoId.ToString();
                        PlayerPrefs.SetString(heiTmp, hei);

                        //senpou
                        string senpou = "senpou" + busyoId.ToString();
                        PlayerPrefs.SetInt(senpou, senpouLv); //Lv

                        //saku
                        string saku = "saku" + busyoId.ToString();
                        PlayerPrefs.SetInt(saku, sakuLv); //Lv

                        //kahou
                        string kahouTmp = "kahou" + busyoId.ToString();
                        PlayerPrefs.SetString(kahouTmp, kahou);

                        //exp
                        string exp           = "exp" + busyoId.ToString();
                        int    totalBusyoExp = expScript.getExpforNextLv(lv - 1);
                        PlayerPrefs.SetInt(exp, totalBusyoExp);

                        //addLv
                        string addlvTmp = "addlv" + busyoId.ToString();
                        int    addlv    = RecoveryDataStore.addLvList[count];
                        if (addlv != 0)
                        {
                            PlayerPrefs.SetInt(addlvTmp, addlv);
                        }

                        //gokui
                        string gokuiTmp = "gokui" + busyoId.ToString();
                        int    gokui    = RecoveryDataStore.gokuiList[count];
                        if (gokui != 0)
                        {
                            PlayerPrefs.SetInt(gokuiTmp, gokui);
                        }

                        //gokui
                        string kanniTmp = "kanni" + busyoId.ToString();
                        int    kanni    = RecoveryDataStore.kanniList[count];
                        if (kanni != 0)
                        {
                            PlayerPrefs.SetInt(kanniTmp, kanni);
                        }

                        count = count + 1;
                    }
                }

                PlayerPrefs.SetInt("myDaimyo", RecoveryDataStore.myDaimyo);
                Daimyo daimyoScript = new Daimyo();
                PlayerPrefs.SetInt("myDaimyoBusyo", daimyoScript.getDaimyoBusyoId(RecoveryDataStore.myDaimyo));
                PlayerPrefs.SetString("myBusyo", myBusyo);
                PlayerPrefs.SetString("myKanni", RecoveryDataStore.myKanni);
                PlayerPrefs.SetString("availableBugu", RecoveryDataStore.availableBugu);
                PlayerPrefs.SetString("availableKabuto", RecoveryDataStore.availableKabuto);
                PlayerPrefs.SetString("availableGusoku", RecoveryDataStore.availableGusoku);
                PlayerPrefs.SetString("availableMeiba", RecoveryDataStore.availableMeiba);
                PlayerPrefs.SetString("availableCyadougu", RecoveryDataStore.availableCyadougu);
                PlayerPrefs.SetString("availableHeihousyo", RecoveryDataStore.availableHeihousyo);
                PlayerPrefs.SetString("availableChishikisyo", RecoveryDataStore.availableChishikisyo);
                PlayerPrefs.SetString("kanjyo", RecoveryDataStore.kanjyo);
                PlayerPrefs.SetString("cyouheiYR", RecoveryDataStore.cyouheiYR);
                PlayerPrefs.SetString("cyouheiKB", RecoveryDataStore.cyouheiKB);
                PlayerPrefs.SetString("cyouheiTP", RecoveryDataStore.cyouheiTP);
                PlayerPrefs.SetString("cyouheiYM", RecoveryDataStore.cyouheiYM);
                PlayerPrefs.SetInt("hidensyoGe", RecoveryDataStore.hidensyoGe);
                PlayerPrefs.SetInt("hidensyoCyu", RecoveryDataStore.hidensyoCyu);
                PlayerPrefs.SetInt("hidensyoJyo", RecoveryDataStore.hidensyoJyo);
                PlayerPrefs.SetInt("shinobiGe", RecoveryDataStore.shinobiGe);
                PlayerPrefs.SetInt("shinobiCyu", RecoveryDataStore.shinobiCyu);
                PlayerPrefs.SetInt("shinobiJyo", RecoveryDataStore.shinobiJyo);
                PlayerPrefs.SetString("kengouItem", RecoveryDataStore.kengouItem);
                PlayerPrefs.SetString("gokuiItem", RecoveryDataStore.gokuiItem);
                PlayerPrefs.SetString("nanbanItem", RecoveryDataStore.nanbanItem);
                PlayerPrefs.SetInt("transferTP", RecoveryDataStore.transferTP);
                PlayerPrefs.SetInt("transferKB", RecoveryDataStore.transferKB);
                PlayerPrefs.SetInt("meisei", RecoveryDataStore.meisei);
                PlayerPrefs.SetString("shiro", RecoveryDataStore.shiro);
                PlayerPrefs.SetString("koueki", RecoveryDataStore.koueki);
                PlayerPrefs.SetString("cyoutei", RecoveryDataStore.cyoutei);
                PlayerPrefs.SetString("zukanBusyoHst", RecoveryDataStore.zukanBusyoHst);
                PlayerPrefs.SetString("zukanBuguHst", RecoveryDataStore.zukanBuguHst);
                PlayerPrefs.SetString("zukanGusokuHst", RecoveryDataStore.zukanGusokuHst);
                PlayerPrefs.SetString("zukanKabutoHst", RecoveryDataStore.zukanKabutoHst);
                PlayerPrefs.SetString("zukanMeibaHst", RecoveryDataStore.zukanMeibaHst);
                PlayerPrefs.SetString("zukanCyadouguHst", RecoveryDataStore.zukanCyadouguHst);
                PlayerPrefs.SetString("zukanChishikisyoHst", RecoveryDataStore.zukanChishikisyoHst);
                PlayerPrefs.SetString("zukanHeihousyoHst", RecoveryDataStore.zukanHeihousyoHst);
                PlayerPrefs.SetString("gameClearDaimyo", RecoveryDataStore.gameClearDaimyo);
                PlayerPrefs.SetString("gameClearDaimyoHard", RecoveryDataStore.gameClearDaimyoHard);

                //jinkei
                PlayerPrefs.SetInt("jinkei", RecoveryDataStore.jinkeiId);
                PlayerPrefs.SetInt("soudaisyo" + RecoveryDataStore.jinkeiId, RecoveryDataStore.soudaisyo);
                for (int i = 0; i < 25; i++)
                {
                    int busyoId = RecoveryDataStore.busyoMapList[i];
                    int id      = i + 1;
                    if (busyoId == 0)
                    {
                        string tmp = RecoveryDataStore.jinkeiId.ToString() + "map" + id.ToString();
                        PlayerPrefs.DeleteKey(tmp);
                    }
                    else
                    {
                        string tmp = RecoveryDataStore.jinkeiId.ToString() + "map" + id.ToString();
                        PlayerPrefs.SetInt(tmp, busyoId);
                    }
                }

                //naisei
                for (int i = 0; i < RecoveryDataStore.naiseiKuniList.Count; i++)
                {
                    int    kuniId    = RecoveryDataStore.naiseiKuniList[i];
                    string naiseiTmp = "naisei" + kuniId.ToString();
                    PlayerPrefs.SetString(naiseiTmp, RecoveryDataStore.naiseiList[i]);

                    if (RecoveryDataStore.naiseiShiroList[i] != 0)
                    {
                        string shiroTmp = "shiro" + kuniId.ToString();
                        PlayerPrefs.SetInt(shiroTmp, RecoveryDataStore.naiseiShiroList[i]);
                    }
                }

                //Add Qty & PvP Name
                PlayerPrefs.SetInt("myBusyoQty", RecoveryDataStore.busyoList.Count);
                string userName = RecoveryDataStore.userName;
                if (userName == "")
                {
                    userName = "******";
                }
                PlayerPrefs.SetString("PvPName", userName);
            }
            else
            {
                /***userId + pvpJinkei***/
                int totalExp = expScript.getTotalExp(RecoveryDataStore.kuniLv);
                PlayerPrefs.SetInt("kuniExp", totalExp);
                PlayerPrefs.SetInt("myDaimyo", RecoveryDataStore.myDaimyo);
                Daimyo daimyoScript = new Daimyo();
                PlayerPrefs.SetInt("myDaimyoBusyo", daimyoScript.getDaimyoBusyoId(RecoveryDataStore.myDaimyo));

                //pvp jinkei
                string        myBusyoString  = PlayerPrefs.GetString("myBusyo");
                List <string> myBusyoList    = new List <string>();
                char[]        delimiterChars = { ',' };
                if (myBusyoString != null && myBusyoString != "")
                {
                    if (myBusyoString.Contains(","))
                    {
                        myBusyoList = new List <string>(myBusyoString.Split(delimiterChars));
                    }
                    else
                    {
                        myBusyoList.Add(myBusyoString);
                    }
                }

                //zukan
                string        zukanBusyoHst     = PlayerPrefs.GetString("zukanBusyoHst");
                List <string> zukanBusyoHstList = new List <string>();
                if (zukanBusyoHst != null && zukanBusyoHst != "")
                {
                    if (zukanBusyoHst.Contains(","))
                    {
                        zukanBusyoHstList = new List <string>(zukanBusyoHst.Split(delimiterChars));
                    }
                    else
                    {
                        zukanBusyoHstList.Add(zukanBusyoHst);
                    }
                }

                //Daimyo Busyo History
                Daimyo        daimyo             = new Daimyo();
                string        gacyaDaimyoHst     = PlayerPrefs.GetString("gacyaDaimyoHst");
                List <string> gacyaDaimyoHstList = new List <string>();
                if (gacyaDaimyoHst != null && gacyaDaimyoHst != "")
                {
                    if (gacyaDaimyoHst.Contains(","))
                    {
                        gacyaDaimyoHstList = new List <string>(gacyaDaimyoHst.Split(delimiterChars));
                    }
                    else
                    {
                        gacyaDaimyoHstList.Add(gacyaDaimyoHst);
                    }
                }

                int count = 0;
                for (int i = 0; i < RecoveryDataStore.busyoList.Count; i++)
                {
                    int busyoId = RecoveryDataStore.busyoList[i];

                    if (busyoId != 0)
                    {
                        //add busyo
                        if (!myBusyoList.Contains(busyoId.ToString()))
                        {
                            if (myBusyoString == null || myBusyoString == "")
                            {
                                myBusyoString = busyoId.ToString();
                            }
                            else
                            {
                                myBusyoString = myBusyoString + "," + busyoId.ToString();
                            }
                            PlayerPrefs.SetString("myBusyo", myBusyoString);
                        }

                        //add zukan
                        if (!zukanBusyoHstList.Contains(busyoId.ToString()))
                        {
                            if (zukanBusyoHst == null || zukanBusyoHst == "")
                            {
                                zukanBusyoHst = busyoId.ToString();
                            }
                            else
                            {
                                zukanBusyoHst = zukanBusyoHst + "," + busyoId.ToString();
                            }
                            PlayerPrefs.SetString("zukanBusyoHst", zukanBusyoHst);
                        }

                        //add daimyo busyo
                        if (daimyo.daimyoBusyoCheck(busyoId))
                        {
                            if (!gacyaDaimyoHstList.Contains(busyoId.ToString()))
                            {
                                if (gacyaDaimyoHst == null || gacyaDaimyoHst == "")
                                {
                                    gacyaDaimyoHst = busyoId.ToString();
                                }
                                else
                                {
                                    gacyaDaimyoHst = gacyaDaimyoHst + "," + busyoId.ToString();
                                }
                                PlayerPrefs.SetString("gacyaDaimyoHst", gacyaDaimyoHst);
                            }
                        }

                        //add parametor
                        int    lv       = RecoveryDataStore.lvList[count];
                        string hei      = RecoveryDataStore.heiList[count];
                        int    senpouLv = RecoveryDataStore.senpouLvList[count];
                        int    sakuLv   = RecoveryDataStore.sakuLvList[count];
                        string kahou    = RecoveryDataStore.kahouList[count];

                        //lv
                        PlayerPrefs.SetInt(busyoId.ToString(), lv);

                        //hei
                        string heiTmp = "hei" + busyoId.ToString();
                        PlayerPrefs.SetString(heiTmp, hei);

                        //senpou
                        string senpou = "senpou" + busyoId.ToString();
                        PlayerPrefs.SetInt(senpou, senpouLv); //Lv

                        //saku
                        string saku = "saku" + busyoId.ToString();
                        PlayerPrefs.SetInt(saku, sakuLv); //Lv

                        //kahou
                        string kahouTmp = "kahou" + busyoId.ToString();
                        PlayerPrefs.SetString(kahouTmp, kahou);

                        //exp
                        string exp           = "exp" + busyoId.ToString();
                        int    totalBusyoExp = expScript.getExpforNextLv(lv - 1);
                        PlayerPrefs.SetInt(exp, totalBusyoExp);

                        count = count + 1;
                    }
                }
                PlayerPrefs.Flush();

                //Add Qty & PvP Name
                string        myBusyoStringCount = PlayerPrefs.GetString("myBusyo");
                List <string> myBusyoListCount   = new List <string>();
                if (myBusyoStringCount.Contains(","))
                {
                    myBusyoListCount = new List <string>(myBusyoStringCount.Split(delimiterChars));
                }
                else
                {
                    myBusyoListCount.Add(myBusyoStringCount);
                }
                PlayerPrefs.SetInt("myBusyoQty", myBusyoListCount.Count);
                string userName = RecoveryDataStore.userName;
                if (userName == "")
                {
                    userName = "******";
                }
                PlayerPrefs.SetString("PvPName", userName);
            }

            PlayerPrefs.Flush();

            //add data recovery history
            RecoveryDataStore.UpdateDataRecovery(RecoveryDataStore.inputUserId);


            //Final Process
            audioSources[3].Play();
            Destroy(back.gameObject);
            Destroy(msg.gameObject);
            GameObject.Find("Start").GetComponent <Button>().enabled = false;
            Message msgScript = new Message();
            msgScript.makeMessage(msgScript.getMessage(151));
        }
        else
        {
            RecoveryDataStore RecoveryDataStore = GameObject.Find("RecoveryDataStore").GetComponent <RecoveryDataStore>();
            RecoveryDataStore.ResetValue();

            audioSources[1].Play();
            Destroy(back.gameObject);
            Destroy(msg.gameObject);
        }
    }