Esempio n. 1
0
        static IEnumerator makeData()
        {
            #region ゲーム
            MasterDungeon masterDungeon = new MasterDungeon();
            yield return(EveryStudioLibrary.Editor.EditorCoroutine.start(masterDungeon.SpreadSheet(DataManager.SS_MASTER, "dungeon", () => {
                masterDungeon.SaveEditor("07data/master", "master_dungeon");
            })));

            MasterEnemy masterEnemy = new MasterEnemy();
            yield return(EveryStudioLibrary.Editor.EditorCoroutine.start(masterEnemy.SpreadSheet(DataManager.SS_MASTER, "enemy", () => {
                masterEnemy.SaveEditor("07data/master", "master_enemy");
            })));

            MasterFloor masterFloor = new MasterFloor();
            yield return(EveryStudioLibrary.Editor.EditorCoroutine.start(masterFloor.SpreadSheet(DataManager.SS_MASTER, "floor", () => {
                masterFloor.SaveEditor("07data/master", "master_floor");
            })));

            MasterItem masterItem = new MasterItem();
            yield return(EveryStudioLibrary.Editor.EditorCoroutine.start(masterItem.SpreadSheet(DataManager.SS_MASTER, "item", () => {
                masterItem.SaveEditor("07data/master", "master_item");
            })));

            MasterMedalPrize masterMedalPrize = new MasterMedalPrize();
            yield return(EveryStudioLibrary.Editor.EditorCoroutine.start(masterMedalPrize.SpreadSheet(DataManager.SS_MASTER, "medal_prize", () => {
                masterMedalPrize.SaveEditor("07data/master", "master_medal_prize");
            })));

            MasterSkin masterSkin = new MasterSkin();
            yield return(EveryStudioLibrary.Editor.EditorCoroutine.start(masterSkin.SpreadSheet(DataManager.SS_MASTER, "skin", () => {
                masterSkin.SaveEditor("07data/master", "master_skin");
            })));

            #endregion

            #region キャンプ


            #endregion
            #region チュートリアル用
            #endregion
        }
Esempio n. 2
0
    private IEnumerator initialize()
    {
        base.Initialize();

        masterGameRule.Load(textMasterGameRule);

        if (masterGameRule.Read("charamode") == "multi")
        {
            chara_control.m_multiSprite.enabled  = true;
            chara_control.m_singleSprite.enabled = false;
        }
        else
        {
            chara_control.m_multiSprite.enabled  = false;
            chara_control.m_singleSprite.enabled = true;
        }

        adsbanner_top.Show(masterGameRule.Read("adbanner_top"));
        adsbanner_bottom.Show(masterGameRule.Read("adbanner_bottom"));



        masterItem.Load(textMasterItem);
        masterEnemy.Load(textMasterEnemy);
        masterFloor.Load(textMasterFloor);
        masterDungeon.Load(textMasterDungeon);
        masterMedalPrize.Load(textMasterMedalPrize);
        masterSkin.Load(textMasterSkin);
        masterAccessary.Load(textMasterAccessary);

#if UNITY_EDITOR
        if (bUseSSData)
        {
            yield return(StartCoroutine(masterItem.SpreadSheet(SS_MASTER, "item", () => { })));

            yield return(StartCoroutine(masterSkin.SpreadSheet(SS_MASTER, "skin", () => { })));

            yield return(StartCoroutine(masterEnemy.SpreadSheet(SS_MASTER, "enemy", () => { })));

            yield return(StartCoroutine(masterDungeon.SpreadSheet(SS_MASTER, "dungeon", () => { })));

            yield return(StartCoroutine(masterFloor.SpreadSheet(SS_MASTER, "floor", () => { })));

            yield return(StartCoroutine(masterMedalPrize.SpreadSheet(SS_MASTER, "medal_prize", () => { })));
        }
#else
        bUseSSData = false;
#endif


        string data_item = string.Format("{0}/{1}", floder_name, "data_item");
        dataItem = new DataItem();
        dataItem.SetSaveFilename(data_item);
        if (false == dataItem.LoadMulti(data_item))
        {
            List <MasterItemParam> initiali_data_list = masterItem.list.FindAll(p => p.item_id / MasterItem.LargeCategory <= MasterItem.CategoryMagic);
            foreach (MasterItemParam param in initiali_data_list)
            {
                if (0 < param.item_id / 10)
                {
                    dataItem.AddItem(param.item_id, 0);
                }
            }
            dataItem.Save();
        }
        dataItem.list.Sort((a, b) => a.item_id - b.item_id);

        string strUserData = string.Format("{0}/{1}", floder_name, "user_data");
        user_data.SetSaveFilename(strUserData);
        if (false == user_data.LoadMulti(strUserData))
        {
            // ユーザーデータの初期化処理
            floor_current = 1;
            floor_best    = 1;
            floor_restart = 1;

            user_data.WriteInt(Defines.KeyCoin, 0);
            user_data.WriteInt(Defines.KeyGem, 0);


            user_data.Write(Defines.KEY_SOUND_BGM, 1.0f.ToString());
            user_data.Write(Defines.KEY_SOUND_SE, 1.0f.ToString());

            user_data.WriteInt(Defines.KEY_GAMESPEEDMETER, 1);

            user_data.Save();
        }
        if (user_data.HasKey(Defines.KEY_SOUND_BGM) == false)
        {
            user_data.Write(Defines.KEY_SOUND_BGM, 1.0f.ToString());
        }
        if (user_data.HasKey(Defines.KEY_SOUND_SE) == false)
        {
            user_data.Write(Defines.KEY_SOUND_SE, 1.0f.ToString());
        }

        if (user_data.HasKey(Defines.KEY_CHARA_LEVEL))
        {
            Debug.Log("chara_restore");
            dataChara.Restore(user_data.ReadInt(Defines.KEY_CHARA_LEVEL));
        }
        else
        {
            // リスタートフロアをセットする
            //user_data.WriteInt(Defines.KEY_CHARA_FLOOR_CURRENT, Instance.floor_restart);
            Instance.floor_current = Instance.floor_restart;
            dataChara.Build(1);

            user_data.Save();
        }


        SetSpeedMeter(user_data.ReadInt(Defines.KEY_GAMESPEEDMETER));

        if (user_data.HasKey(Defines.KEY_GAMESPEED_LEVEL))
        {
            int game_speed_level = user_data.ReadInt(Defines.KEY_GAMESPEED_LEVEL);
            //Debug.Log(game_speed_level);
            gameSpeedControl.SetSpeedLevel(game_speed_level);
        }

        //Debug.Log(user_data.list.Count);
        foreach (CsvKvsParam p in user_data.list)
        {
            //Debug.Log(p.key);
        }
        Debug.Log("datamanager.initialized");

        Initialized = true;

        yield return(null);
    }
Esempio n. 3
0
    IEnumerator init_network()
    {
        Debug.Log("init_network start");
        yield return(StartCoroutine(config.SpreadSheet(Defines.SS_MASTER, "config", () => { })));

        masterChara.SetSaveFilename(Defines.FILENAME_MASTERCHARA);

        masterChara.Load(m_textAssetHolder.Get("master_chara"));
        masterWeapon.Load(m_textAssetHolder.Get("master_weapon"));
        masterArmor.Load(m_textAssetHolder.Get("master_armor"));
        masterSkill.Load(m_textAssetHolder.Get("master_skill"));
        masterPotion.Load(m_textAssetHolder.Get("master_potion"));
        masterTreasure.Load(m_textAssetHolder.Get("master_treasure"));
        masterEnemy.Load(m_textAssetHolder.Get("master_enemy"));
        masterItem.Load(m_textAssetHolder.Get("master_item"));
        masterStage.Load(m_textAssetHolder.Get("master_stage"));
        masterFloor.Load(m_textAssetHolder.Get("master_floor"));
        masterHelp.Load(m_textAssetHolder.Get("master_help"));

#if UNITY_EDITOR
        if (m_bLoadNetworkData)
        {
            #region 通信初期化
            yield return(StartCoroutine(masterChara.SpreadSheet(Defines.SS_MASTER, "chara", () => { })));

            yield return(StartCoroutine(masterWeapon.SpreadSheet(Defines.SS_MASTER, "weapon", () => { })));

            yield return(StartCoroutine(masterArmor.SpreadSheet(Defines.SS_MASTER, "armor", () => { })));

            yield return(StartCoroutine(masterSkill.SpreadSheet(Defines.SS_MASTER, "skill", () => { })));

            yield return(StartCoroutine(masterPotion.SpreadSheet(Defines.SS_MASTER, "potion", () => { })));

            yield return(StartCoroutine(masterTreasure.SpreadSheet(Defines.SS_MASTER, "treasure", () =>
            {
                /*
                 * foreach( MasterTreasureParam master in masterTreasure.list)
                 * {
                 *      Debug.Log(string.Format("id:{0} name:{1} sprite:{2}", master.treasure_id , master.name , master.sprite_name));
                 * }
                 */
            })));

            yield return(StartCoroutine(masterEnemy.SpreadSheet(Defines.SS_MASTER, "enemy", () => { })));

            yield return(StartCoroutine(masterItem.SpreadSheet(Defines.SS_MASTER, "item", () => { })));

            yield return(StartCoroutine(masterStage.SpreadSheet(Defines.SS_MASTER, "stage", () => { })));

            yield return(StartCoroutine(masterFloor.SpreadSheet(Defines.SS_MASTER, "floor", () => { })));

            yield return(StartCoroutine(masterHelp.SpreadSheet(Defines.SS_MASTER, "help", () => { })));

            #endregion
        }
#endif
        // 未初期化扱い
        if (!user_data.HasKey(Defines.KEY_AUTOPOTION_RATE))
        {
            user_data.WriteInt(Defines.KEY_USE_AUTOMOVE, 1);
            user_data.WriteInt(Defines.KEY_USE_AUTOPOTION, 1);

            user_data.WriteFloat(Defines.KEY_AUTOPOTION_RATE, Defines.DEFAULT_AUTOPOTION_RATE);
            user_data.WriteFloat(Defines.KEY_SOUNDVOLUME_BGM, Defines.SOUND_VOLME_DEFAULT);
            user_data.WriteFloat(Defines.KEY_SOUNDVOLUME_SE, Defines.SOUND_VOLME_DEFAULT);
        }


        game_data.SetSaveFilename(Defines.FILENAME_GAMEDATA);
        if (game_data.LoadMulti() == false)
        {
            // なんかする
            // なにもしなくてok
        }
        dataChara.SetSaveFilename(Defines.FILENAME_DATACHARA);
        if (dataChara.LoadMulti() == false)
        {
            // 初期データ的ななにか保存はしない
            DataCharaParam slime = new DataCharaParam();
            slime.chara_id = 1;
            slime.status   = DataChara.STATUS.USING.ToString();
            dataChara.list.Add(slime);
        }
        dataWeapon.SetSaveFilename(Defines.FILENAME_DATAWEAPON);
        if (dataWeapon.LoadMulti() == false)
        {
            DataWeaponParam add_weapon = new DataWeaponParam();
            add_weapon.weapon_id = 1;
            add_weapon.level     = 1;
            add_weapon.equip     = 1;           // 武器はtfで良いのでは?
            dataWeapon.Add(add_weapon);
        }
        dataWeaponAlbum.SetSaveFilename(Defines.FILENAME_DATAWEAPONALBUM);
        if (dataWeaponAlbum.LoadMulti() == false)
        {
            dataWeaponAlbum.AddAlbum(1);
        }


        dataArmor.SetSaveFilename(Defines.FILENAME_DATAARMOR);
        if (dataArmor.LoadMulti() == false)
        {
            for (int i = 0; i < MasterArmor.ArmorPositionArr.Length; i++)
            {
                DataArmorParam add = new DataArmorParam();
                add.position = MasterArmor.ArmorPositionArr[i];
                add.level    = 1;
                MasterArmorParam mas = masterArmor.list.Find(p => p.position == add.position && p.level == add.level);
                add.armor_id = mas.armor_id;
                dataArmor.list.Add(add);
            }
        }
        dataSkill.SetSaveFilename(Defines.FILENAME_DATASKILL);
        if (dataSkill.LoadMulti() == false)
        {
            dataSkill.list.Add(new DataSkillParam(1, 1));
        }
        dataPotion.SetSaveFilename(Defines.FILENAME_DATAPOTION);
        if (dataPotion.LoadMulti() == false)
        {
            DataPotionParam add = new DataPotionParam();
            add.potion_id = 1;
            add.num       = 9;
            add.is_use    = true;
            dataPotion.list.Add(add);
        }

        dataTreasure.SetSaveFilename(Defines.FILENAME_DATATREASURE);
        if (dataTreasure.LoadMulti() == false)
        {
            /*
             * int add_serial = dataTreasure.Add(1001);
             * DataTreasureParam add_treasure = dataTreasure.list.Find(p => p.serial == add_serial);
             * add_treasure.equip = 1;
             */
        }
        dataTreasureAlbum.SetSaveFilename(Defines.FILENAME_DATATREASUREALBUM);
        if (dataTreasureAlbum.LoadMulti() == false)
        {
            /*
             * dataTreasureAlbum.Add(1002);
             * dataTreasureAlbum.Add(1003);
             * dataTreasureAlbum.Add(1006);
             * dataTreasureAlbum.Add(1010);
             * dataTreasureAlbum.Add(1026);
             */
        }

        /*
         * dataScroll.SetSaveFilename(Defines.FILENAME_DATASCROLL);
         * if( dataScroll.LoadMulti()== false)
         * {
         *      dataScroll.list.Add(new DataScrollParam(1, 120));
         *      dataScroll.list.Add(new DataScrollParam(2, 120));
         *      dataScroll.list.Add(new DataScrollParam(3, 120));
         *      dataScroll.list.Add(new DataScrollParam(4, 120));
         *      dataScroll.list.Add(new DataScrollParam(5, 120));
         * }
         */
        dataUnit.SetSaveFilename(Defines.FILENAME_DATAUNIT);
        if (dataUnit.LoadMulti() == false)
        {
        }
        dataItem.SetSaveFilename(Defines.FILENAME_DATAITEM);
        if (dataItem.LoadMulti() == false)
        {
            for (int i = 0; i < 5; i++)
            {
                dataItem.Add(Defines.ITEM_ID_SCROLL_BLUE + i, 0);
            }
        }
        dataGetItem.SetSaveFilename(Defines.FILENAME_DATAITEM_GET);
        if (dataGetItem.LoadMulti() == false)
        {
        }
        dataStage.SetSaveFilename(Defines.FILENAME_DATASTAGE);
        if (dataStage.LoadMulti() == false)
        {
            DataStageParam data = new DataStageParam();
            data.stage_id = 1;
            data.status   = 1;
            dataStage.list.Add(data);
        }
        dataFloor.SetSaveFilename(Defines.FILENAME_DATAFLOOR);
        if (dataFloor.LoadMulti() == false)
        {
            DataFloorParam data = new DataFloorParam();
            data.floor_id = 1;
            data.status   = 1;
            dataFloor.list.Add(data);
        }


        if (m_txtKey != null)
        {
            user_data.AddListenerInt(Defines.KeyKey, (iValue) =>
            {
                m_txtKey.text = iValue.ToString();
            });
            user_data.AddListenerInt(Defines.KeyGoldKey, (iValue) =>
            {
                m_txtGoldKey.text = iValue.ToString();
            });
            user_data.AddListenerInt(Defines.KeyCoin, (iValue) =>
            {
                m_txtCoin.text = iValue.ToString();
            });
            user_data.AddListenerInt(Defines.KeyGem, (iValue) =>
            {
                m_txtGem.text = iValue.ToString();
            });

#if UNITY_EDITOR
            /*
             * AddGem(debug_gem);
             * AddCoin(debug_coin);
             * AddKey(debug_key);
             * AddGoldKey(debug_gold_key);
             */
#endif
            //m_txtKey.text = user_data.ReadInt(Defines.KeyKey).ToString(); ;
            //m_txtGoldKey.text = user_data.Read(Defines.KeyGoldKey);
            //m_txtCoin.text = user_data.Read(Defines.KeyCoin);
            //m_txtGem.text = user_data.Read(Defines.KeyGem);
        }



        Initialized = true;
        Debug.Log("init_network end");
        yield return(null);
    }