Esempio n. 1
0
    private static void OnPostprocessEffectPointdata()
    {
        string     path = System.IO.Path.Combine(RESOURCE_EFFECTPOINT_DATA_FOLDER, "MeridiansEffectPosition.xml");
        TextReader tr   = new StreamReader(path);
        string     text = tr.ReadToEnd();

        if (text == null)
        {
            Debug.LogError("Equipment item file not exist");
            return;
        }
        else
        {
            XmlSpreadSheetReader.ReadSheet(text);
            XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
            string[]       keys  = XmlSpreadSheetReader.Keys;

            object[] levelIds = sheet[keys[0]];

            List <MeridiansEffectPositionData> tempList = new List <MeridiansEffectPositionData>();

            for (int i = 2; i < levelIds.Length; i++)
            {
                MeridiansEffectPositionData data = new MeridiansEffectPositionData();
                data.effectID = Convert.ToInt32(sheet["EffectID"][i]);
                data.position = Convert.ToString(sheet["Position"][i]).Split('+');

                tempList.Add(data);
            }
            CreateEffectPositionConfigDataList(tempList);
        }
    }
Esempio n. 2
0
    private static void SfxPostprocess(string tabName)
    {
        string     path = System.IO.Path.Combine(RESOURCE_SFX_FOLDER, "SFXSoundClipList.xml");
        TextReader tr   = new StreamReader(path);
        string     text = tr.ReadToEnd();

        if (text == null)
        {
            Debug.LogError(tabName + " sfx config file not exist");
            return;
        }
        else
        {
            XmlSpreadSheetReader.ReadSheet(text, tabName);
            XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
            string[]       keys  = XmlSpreadSheetReader.Keys;

            object[] levelIds = sheet[keys[0]];

            List <SoundClip> tempList = new List <SoundClip>();

            for (int i = 2; i < levelIds.Length; i++)
            {
                SoundClip clip = new SoundClip();
                clip._name = Convert.ToString(sheet["Name"][i]);
                string clipPath = Convert.ToString(sheet["Clip"][i]);
                string pathRes  = System.IO.Path.Combine(ASSET_SFX_CLIP_FOLDER, clipPath);

                clip._clip = AssetDatabase.LoadAssetAtPath(pathRes, typeof(AudioClip)) as AudioClip;
                tempList.Add(clip);
            }
            CreateSfxDataBase(tempList, tabName);
        }
    }
Esempio n. 3
0
    private static void OnPostprocessEquipment()
    {
        string     path = System.IO.Path.Combine(RESOURCE_DATA_FOLDER, "JokeConfig.xml");
        TextReader tr   = new StreamReader(path);
        string     text = tr.ReadToEnd();

        if (text == null)
        {
            Debug.LogError("Equipment item file not exist");
            return;
        }
        else
        {
            XmlSpreadSheetReader.ReadSheet(text);
            XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
            string[]       keys  = XmlSpreadSheetReader.Keys;

            object[] levelIds = sheet[keys[0]];

            List <JokeConfigData> tempList = new List <JokeConfigData>();

            for (int i = 2; i < levelIds.Length; i++)
            {
                //if (0 == i) continue;
                JokeConfigData data = new JokeConfigData();
                data.ID        = Convert.ToInt32(sheet["ID"][i]);
                data.IDS       = Convert.ToString(sheet["IDS"][i]);
                data.DelayTime = Convert.ToInt32(sheet["Time"][i]);
                tempList.Add(data);
            }


            CreateMedicamentConfigDataList(tempList);
        }
    }
Esempio n. 4
0
    private static void PlayerEffectConfigPostprocess()
    {
        string     path = System.IO.Path.Combine(RESOURCE_PLAYER_EFFECT_CONFIG_FOLDER, "resource_Players.xml");
        TextReader tr   = new StreamReader(path);
        string     text = tr.ReadToEnd();

        if (text == null)
        {
            Debug.LogError("Map Res data file not exist");

            return;
        }
        else
        {
            XmlSpreadSheetReader.ReadSheet(text);
            XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
            string[]       keys  = XmlSpreadSheetReader.Keys;

            object[]      Ids             = sheet[keys[0]];
            List <string> tempPathList    = new List <string>();
            List <string> tempSfxPathList = new List <string>();
            for (int i = 2; i < Ids.Length; i++)
            {
                string   pathesStr = Convert.ToString(sheet["Players_Effects"][i]);
                string[] pathStrs  = pathesStr.Split('+');
                tempPathList.AddRange(pathStrs);

                string   sfxPathStr  = Convert.ToString(sheet["Players_sound"][i]);
                string[] sfxPathStrs = sfxPathStr.Split('+');
                tempSfxPathList.AddRange(sfxPathStrs);
            }
            tempPathList = tempPathList.Distinct().ToList();
            CreatePlayerEffectDataBase(tempPathList, tempSfxPathList);
        }
    }
Esempio n. 5
0
    private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets,
                                               string[] movedAssets, string[] movedFromPath)
    {
        if (CheckResModified(importedAssets) || CheckResModified(deletedAssets) || CheckResModified(movedAssets))
        {
            string path = System.IO.Path.Combine(EW_RESOURCE_MULTILANGUAGE_FOLDER, "JokeLanguageText.xml");

            TextReader tr = new StreamReader(path);

            string text = tr.ReadToEnd();

            if (text == null)
            {
                Debug.LogError("language file not exist");
                return;
            }
            else
            {
                XmlSpreadSheetReader.ReadSheet(text);

                XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;

                int langCount = XmlSpreadSheetReader.Keys.Length - 1;

                string[] keys = XmlSpreadSheetReader.Keys;

                object[] textIds = sheet[keys[0]];

                for (int i = 0; i < langCount; i++)
                {
                    string lang = keys[i + 1];

                    List <JokeLanguageData> tempList = new List <JokeLanguageData>();
                    for (int j = 0; j < textIds.Length; j++)
                    {
                        if (null == textIds[j])
                        {
                            Debug.LogError("invalid ids in line: " + j.ToString());
                        }
                        if (null == sheet[lang][j])
                        {
                            Debug.LogError("invalid text for language of " + lang + " in line: " + j.ToString());
                        }

                        JokeLanguageData textEntry = new JokeLanguageData();
                        textEntry.key  = textIds[j].ToString();
                        textEntry.text = sheet[lang][j].ToString();
                        tempList.Add(textEntry);
                    }

                    if (lang != null)
                    {
                        CreateLanguageDataBase(lang.ToUpper(), tempList);
                    }
                }
            }
        }
    }
Esempio n. 6
0
    private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets,
                                               string[] movedAssets, string[] movedFromPath)
    {
        if (CheckResModified(importedAssets) || CheckResModified(deletedAssets) || CheckResModified(movedAssets))
        {
            string     path = System.IO.Path.Combine(RESOURCE_UI_CONFIG_FOLDER, "ForgeRecipe.xml");
            TextReader tr   = new StreamReader(path);
            string     text = tr.ReadToEnd();

            if (text == null)
            {
                Debug.LogError("Player level config file not exist");
                return;
            }
            else
            {
                XmlSpreadSheetReader.ReadSheet(text);
                XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
                string[]       keys  = XmlSpreadSheetReader.Keys;

                object[] levelIds = sheet[keys[0]];

                List <ForgeRecipeData> tempList = new List <ForgeRecipeData>();

                for (int i = 2; i < levelIds.Length; i++)
                {
                    ForgeRecipeData data = new ForgeRecipeData();

                    data.ForgeID          = Convert.ToInt32(sheet["ForgeID"][i]);
                    data.ForgeEquipmentID = Convert.ToInt32(sheet["ForgeEquipmentID"][i]);
                    string[] str = Convert.ToString(sheet["ForgeProfession"][i]).Split('+');
                    data.ForgeProfession = new int[str.Length];
                    for (int j = 0; j < str.Length; j++)
                    {
                        data.ForgeProfession[j] = Convert.ToInt32(str[j]);
                    }
                    string[] str1 = Convert.ToString(sheet["ForgeCost"][i]).Split('|');
                    data.ForgeCost = new Recipe[str1.Length];
                    for (int j = 0; j < str1.Length; j++)
                    {
                        string[] str2   = str1[j].Split('+');
                        Recipe   recipe = new Recipe()
                        {
                            RecipeID = Convert.ToInt32(str2[0]), count = Convert.ToInt32(str2[1])
                        };
                        data.ForgeCost[j] = recipe;
                    }
                    data.ForgeIDS  = Convert.ToString(sheet["ForgeIDS"][i]);
                    data.ForgeType = (UI.Forging.ForgingType)Convert.ToInt32(sheet["ForgeType"][i]);
                    tempList.Add(data);
                }

                CreateSceneConfigDataBase(tempList);
            }
        }
    }
Esempio n. 7
0
    private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets,
                                               string[] movedAssets, string[] movedFromPath)
    {
        if (CheckResModified(importedAssets) || CheckResModified(deletedAssets) || CheckResModified(movedAssets))
        {
            string     path = System.IO.Path.Combine(RESOURCE_SHOP_CONFIG_FOLDER, "DailySignInConfig.xml");
            TextReader tr   = new StreamReader(path);
            string     text = tr.ReadToEnd();

            if (text == null)
            {
                Debug.LogError("EndlessEctypeReward config file not exist");
                return;
            }
            else
            {
                XmlSpreadSheetReader.ReadSheet(text);
                XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
                string[]       keys  = XmlSpreadSheetReader.Keys;

                object[] levelIds = sheet[keys[0]];

                List <DailySignInConfigData> tempList = new List <DailySignInConfigData>();

                for (int i = 2; i < levelIds.Length; i++)
                {
                    DailySignInConfigData data = new DailySignInConfigData();
                    data.RewardId = Convert.ToInt32(sheet["RewardId"][i]);
                    //data.RewardLevel = Convert.ToInt32(sheet["RewardLevel"][i]);
                    data.SignInReward1         = Convert.ToString(sheet["SignInReward1"][i]);
                    data.SignInReward2         = Convert.ToString(sheet["SignInReward2"][i]);
                    data.SignInReward3         = Convert.ToString(sheet["SignInReward3"][i]);
                    data.SignInReward4         = Convert.ToString(sheet["SignInReward4"][i]);
                    data.SignInReward5         = Convert.ToString(sheet["SignInReward5"][i]);
                    data.SignInReward6         = Convert.ToString(sheet["SignInReward6"][i]);
                    data.SignInReward7         = Convert.ToString(sheet["SignInReward7"][i]);
                    data.CumulativeRewardDays1 = Convert.ToInt32(sheet["CumulativeRewardDays1"][i]);
                    data.CumulativeRewardDays2 = Convert.ToInt32(sheet["CumulativeRewardDays2"][i]);
                    data.CumulativeRewardDays3 = Convert.ToInt32(sheet["CumulativeRewardDays3"][i]);
                    data.CumulativeRewardItem1 = Convert.ToString(sheet["CumulativeRewardItem1"][i]);
                    data.CumulativeRewardItem2 = Convert.ToString(sheet["CumulativeRewardItem2"][i]);
                    data.CumulativeRewardItem3 = Convert.ToString(sheet["CumulativeRewardItem3"][i]);
                    data.CumulativeRewardRes1  = Convert.ToString(sheet["CumulativeRewardRes1"][i]);
                    data.CumulativeRewardRes2  = Convert.ToString(sheet["CumulativeRewardRes2"][i]);
                    data.CumulativeRewardRes3  = Convert.ToString(sheet["CumulativeRewardRes3"][i]);
                    data.CumulativeRewardTips1 = Convert.ToInt32(sheet["CumulativeRewardTips1"][i]);
                    data.CumulativeRewardTips2 = Convert.ToInt32(sheet["CumulativeRewardTips2"][i]);
                    data.CumulativeRewardTips3 = Convert.ToInt32(sheet["CumulativeRewardTips3"][i]);
                    tempList.Add(data);
                }

                CreateConfigDataBase(tempList);
            }
        }
    }
Esempio n. 8
0
    private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets,
                                               string[] movedAssets, string[] movedFromPath)
    {
        if (CheckResModified(importedAssets) || CheckResModified(deletedAssets) || CheckResModified(movedAssets))
        {
            string     path = System.IO.Path.Combine(RESOURCE_SHOP_CONFIG_FOLDER, "Shopmall.xml");
            TextReader tr   = new StreamReader(path);
            string     text = tr.ReadToEnd();

            if (text == null)
            {
                Debug.LogError("Player level config file not exist");
                return;
            }
            else
            {
                XmlSpreadSheetReader.ReadSheet(text);
                XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
                string[]       keys  = XmlSpreadSheetReader.Keys;

                object[] levelIds = sheet[keys[0]];

                List <ShopConfigData> tempList = new List <ShopConfigData>();

                for (int i = 0; i < levelIds.Length; i++)
                {
                    if (0 == i || 1 == i)
                    {
                        continue;
                    }
                    ShopConfigData data = new ShopConfigData();
                    data._shopGoodsID   = Convert.ToInt32(sheet["ShopGoodsID"][i]);
                    data._goodsNum      = Convert.ToInt32(sheet["GoodsNum"][i]);
                    data._shopName      = Convert.ToString(sheet["ShopName"][i]);
                    data._shopID        = Convert.ToInt32(sheet["nShopID"][i]);
                    data.GoodsID        = Convert.ToInt32(sheet["GoodsID"][i]);
                    data.BuyLvl         = Convert.ToInt32(sheet["BuyLvl"][i]);
                    data.BuyType        = Convert.ToInt32(sheet["lBuyType"][i]);
                    data.Price          = Convert.ToInt32(sheet["lPrice"][i]);
                    data.ExChangeGoodID = Convert.ToString(sheet["lExChangeGoodID"][i]);
                    data.GoodsPicture   = Convert.ToString(sheet["GoodsPicture"][i]);
                    data.GoodsNameIds   = Convert.ToString(sheet["GoodsNameIds"][i]);
                    if (!data.GoodsPicture.Equals("0"))
                    {
                        data.goodsPicturePrefab = (GameObject)Resources.LoadAssetAtPath(data.GoodsPicture + ".prefab", typeof(GameObject));                        //Prefab/GUI/IconPrefab/QuickBuyIcon
                    }
                    data.PackageNeed = Convert.ToInt32(sheet["PackageNeed"][i]);
                    tempList.Add(data);
                }

                CreateConfigDataBase(tempList);
            }
        }
    }
Esempio n. 9
0
    private static void MakePlayGenerateConfigDataList(string xmlFileName, string sheetName)
    {
        string     path = Path.Combine(RESOURCE_CHARACTER_DATA_FOLDER, xmlFileName + ".xml");
        TextReader tr   = new StreamReader(path);
        string     text = tr.ReadToEnd();

        if (text == null)
        {
            Debug.LogError("Equipment item file not exist");
            return;
        }
        else
        {
            XmlSpreadSheetReader.ReadSheet(text, sheetName);
            XmlSpreadSheet sheet    = XmlSpreadSheetReader.Output;
            string[]       keys     = XmlSpreadSheetReader.Keys;
            object[]       levelIds = sheet[keys[0]];

            List <NewCharacterConfigData> tempList = new List <NewCharacterConfigData>();

            for (int i = 2; i < levelIds.Length; i++)
            {
                NewCharacterConfigData data = new NewCharacterConfigData();
                //data.m_SzName = Convert.ToString(sheet["szName"][i]);
                //data.m_IEquipmentID = Convert.ToInt32(sheet["lEquimentID"][i]);
                data.VocationID = Convert.ToInt32(sheet["VocationID"][i]);
                data.Picture    = Convert.ToString(sheet["Picture"][i]);
                data.Model      = Convert.ToString(sheet["Model"][i]);
                string Weapon = Convert.ToString(sheet["Weapon"][i]);
                if (!string.IsNullOrEmpty(Weapon) && Weapon != "0")
                {
                    var displayPath = Path.Combine(ASSET_CHARACTER_DATA_PREFAB_FOLDER, Weapon + ".prefab");
                    var displayGo   = AssetDatabase.LoadAssetAtPath(displayPath, typeof(GameObject)) as GameObject;
                    data.Weapon = displayGo;
                }
                data.WeaponPosition = Convert.ToString(sheet["WeaponPosition"][i]);
                string AnimationTime = Convert.ToString(sheet["Animations"][i]);
                data.AnimationsStr       = Convert.ToString(sheet["Animations"][i]);
                data.SelectAnimationsStr = Convert.ToString(sheet["SelectAni"][i]);
                data.Introductions       = Convert.ToString(sheet["Introductions"][i]);
                data.EffectName          = Convert.ToString(sheet["EffectName"][i]);
                data.EffectPrefab        = (GameObject)Resources.LoadAssetAtPath("Assets/Effects/Prefab/" + data.EffectName + ".prefab", typeof(GameObject));
                data.EffectTime          = Convert.ToSingle(sheet["EffectTime"][i]);
                data.SelectAniSound      = Convert.ToString(sheet["SelectAniSound"][i]);
                data.ChooseVoice         = Convert.ToString(sheet["ChooseVoice"][i]);
                data.PostprocessorAnimation();
                tempList.Add(data);
            }

            CreateMedicamentConfigDataList(tempList);
        }
    }
Esempio n. 10
0
    private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets,
                                               string[] movedAssets, string[] movedFromPath)
    {
        if (CheckResModified(importedAssets) || CheckResModified(deletedAssets) || CheckResModified(movedAssets))
        {
            string     path = System.IO.Path.Combine(RESOURCE_UI_CONFIG_FOLDER, "EvaluateConfig.xml");
            TextReader tr   = new StreamReader(path);
            string     text = tr.ReadToEnd();

            if (text == null)
            {
                Debug.LogError("Player level config file not exist");
                return;
            }
            else
            {
                XmlSpreadSheetReader.ReadSheet(text);
                XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
                string[]       keys  = XmlSpreadSheetReader.Keys;

                object[] levelIds = sheet[keys[0]];

                List <EvaluateData> tempList_Battle = new List <EvaluateData>();
                List <EvaluateData> tempList_Town   = new List <EvaluateData>();

                for (int i = 2; i < levelIds.Length; i++)
                {
                    EvaluateData data_Battle = new EvaluateData();
                    EvaluateData data_Town   = new EvaluateData();

                    data_Battle.Evaluate = Convert.ToString(sheet["Evaluate"][i]);
                    data_Town.Evaluate   = Convert.ToString(sheet["Evaluate"][i]);
                    string icon = Convert.ToString(sheet["Icon"][i]);

                    string pathRes = System.IO.Path.Combine(ASSET_ECTYPE_RES_CONFIG_FOLDER, icon + ".prefab");
                    data_Battle.IconPrefab = (GameObject)AssetDatabase.LoadAssetAtPath(pathRes, typeof(GameObject));

                    string Staricon    = Convert.ToString(sheet["StarRating"][i]);
                    string StarpathRes = System.IO.Path.Combine(ASSET_ECTYPE_RES_CONFIG_FOLDER, Staricon + ".prefab");
                    data_Town.StarIconPrefab   = (GameObject)AssetDatabase.LoadAssetAtPath(StarpathRes, typeof(GameObject));
                    data_Battle.StarIconPrefab = data_Town.StarIconPrefab;

                    tempList_Battle.Add(data_Battle);
                    tempList_Town.Add(data_Town);
                }

                CreateSceneConfigDataBase(tempList_Battle, "_Battle");
                CreateSceneConfigDataBase(tempList_Town, "_Town");
            }
        }
    }
Esempio n. 11
0
    private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets,
                                               string[] movedAssets, string[] movedFromPath)
    {
        if (CheckResModified(importedAssets) || CheckResModified(deletedAssets) || CheckResModified(movedAssets))
        {
            string     path = System.IO.Path.Combine(RESOURCE_BUFF_CONFIG_FOLDER, "BUFF.xml");
            TextReader tr   = new StreamReader(path);
            string     text = tr.ReadToEnd();

            if (text == null)
            {
                Debug.LogError("Player level config file not exist");
                return;
            }
            else
            {
                XmlSpreadSheetReader.ReadSheet(text);
                XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
                string[]       keys  = XmlSpreadSheetReader.Keys;

                object[] levelIds = sheet[keys[0]];

                List <BuffConfigData> tempList = new List <BuffConfigData>();

                for (int i = 0; i < levelIds.Length; i++)
                {
                    if (0 == i || 1 == i)
                    {
                        continue;
                    }
                    BuffConfigData data = new BuffConfigData();
                    data._buffID = Convert.ToInt32(sheet["buffid"][i]);
                    data._iconID = Convert.ToString(sheet["IconID"][i]);
                    //data._buffLv = Convert.ToInt32(sheet["bufflevel"][i]);
                    //data._durativeTime = Convert.ToSingle(sheet["DurativeNum"]);
                    data._buffName     = Convert.ToString(sheet["buffname"][i]);
                    data._buffEffMount = Convert.ToString(sheet["BuffEffMount"][i]);

                    string prefabpath = Convert.ToString(sheet["BuffEffect"][i]);
                    string pathRes    = System.IO.Path.Combine(ASSET_BUFF_RES_CONFIG_FOLDER, prefabpath + ".prefab");
                    data._buffEffect = (GameObject)AssetDatabase.LoadAssetAtPath(pathRes, typeof(GameObject));

                    data._buffSound = Convert.ToString(sheet["BuffSound"][i]);

                    tempList.Add(data);
                }

                CreateConfigDataBase(tempList);
            }
        }
    }
Esempio n. 12
0
    private static void StroyLineConfigPostprocess()
    {
        string     path = System.IO.Path.Combine(RESOURCE_STROY_CONFIG_FOLDER, "StroyLineConfig.xml");
        TextReader tr   = new StreamReader(path);
        string     text = tr.ReadToEnd();

        if (text == null)
        {
            Debug.LogError("stroyline config file not exist");
            return;
        }
        else
        {
            XmlSpreadSheetReader.ReadSheet(text);
            XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
            string[]       keys  = XmlSpreadSheetReader.Keys;

            object[] levelIds = sheet[keys[0]];

            List <StroyLineConfigData> tempList = new List <StroyLineConfigData>();

            for (int i = 0; i < levelIds.Length; i++)
            {
                if (0 == i || 1 == i)
                {
                    continue;
                }
                StroyLineConfigData data = new StroyLineConfigData();
                data._StroyLineID      = Convert.ToInt32(sheet["StroyLineID"][i]);
                data._SceneMapID       = Convert.ToInt32(sheet["SceneMapID"][i]);
                data._BgMusic          = Convert.ToString(sheet["BgMusic"][i]);
                data._TriggerVocation  = Convert.ToInt32(sheet["TriggerProfession"][i]);
                data._TriggerCondition = Convert.ToInt32(sheet["TriggerCondition"][i]);
                data._EctypeID         = Convert.ToInt32(sheet["EctypeID"][i]);

                string   cameraStr      = Convert.ToString(sheet["CameraGroup"][i]);
                string[] splitCameraStr = cameraStr.Split("+".ToCharArray());
                data._CameraGroup = new List <int>();//new int[splitCameraStr.Length];
                data.WeaponType   = Convert.ToInt32(sheet["WeaponType"][i]);
                for (int j = 0; j < splitCameraStr.Length; j++)
                {
                    data._CameraGroup.Add(Convert.ToInt32(splitCameraStr[j]));
                }

                tempList.Add(data);
            }

            CreateStroyLineConfigDataBase(tempList);
        }
    }
Esempio n. 13
0
    private static void StroyDialogConfigPostprocess()
    {
        string     path = System.IO.Path.Combine(RESOURCE_STROY_CONFIG_FOLDER, "DialogConfig.xml");
        TextReader tr   = new StreamReader(path);
        string     text = tr.ReadToEnd();

        if (text == null)
        {
            Debug.LogError("CameraGroup config file not exist");
            return;
        }
        else
        {
            XmlSpreadSheetReader.ReadSheet(text);
            XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
            string[]       keys  = XmlSpreadSheetReader.Keys;

            object[] levelIds = sheet[keys[0]];

            List <StroyDialogConfigData> tempList = new List <StroyDialogConfigData>();

            for (int i = 0; i < levelIds.Length; i++)
            {
                if (0 == i || 1 == i)
                {
                    continue;
                }
                StroyDialogConfigData data = new StroyDialogConfigData();
                data._DialogID = Convert.ToInt32(sheet["DialogID"][i]);
                data._Content  = Convert.ToString(sheet["Content"][i]);
                var      viewOffsetString = Convert.ToString(sheet["ViewOffset"][i]);
                string[] viewposList      = viewOffsetString.Split("+".ToCharArray());
                float    viewoffsetX      = Convert.ToSingle(viewposList[0]);
                float    viewoffsetY      = Convert.ToSingle(viewposList[1]);
                data._ViewOffset  = new Vector3(viewoffsetX, viewoffsetY, 0);
                data._NpcOrPlayer = Convert.ToInt32(sheet["TalkNPCID"][i]);
                data._DialogType  = Convert.ToInt32(sheet["DialogType"][i]);
                data._NpcName     = Convert.ToString(sheet["NpcName"][i]);
                data._NpcIconName = Convert.ToString(sheet["NpcIconName"][i]);
                //1玩家,2是npc
                if (data._NpcOrPlayer == 2)
                {
                    data.npcIconPrefab = (GameObject)Resources.LoadAssetAtPath("Assets/Prefab/GUI/IconPrefab/StroyPersonHead/" + data._NpcIconName + ".prefab", typeof(GameObject));                  //Prefab/GUI/IconPrefab/QuickBuyIcon
                }
                tempList.Add(data);
            }

            CreateDialogConfigDataBase(tempList);
        }
    }
Esempio n. 14
0
    private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets,
                                               string[] movedAssets, string[] movedFromPath)
    {
        if (CheckResModified(importedAssets) || CheckResModified(deletedAssets) || CheckResModified(movedAssets))
        {
            string     path = System.IO.Path.Combine(RESOURCE_TRAP_CONFIG_FOLDER, "BoxConfig.xml");
            TextReader tr   = new StreamReader(path);
            string     text = tr.ReadToEnd();

            if (text == null)
            {
                Debug.LogError("Player level config file not exist");
                return;
            }
            else
            {
                XmlSpreadSheetReader.ReadSheet(text);
                XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
                string[]       keys  = XmlSpreadSheetReader.Keys;

                object[] levelIds = sheet[keys[0]];

                List <DamageConfigData> tempList = new List <DamageConfigData>();

                for (int i = 0; i < levelIds.Length; i++)
                {
                    if (0 == i || 1 == i)
                    {
                        continue;
                    }
                    DamageConfigData data = new DamageConfigData();
                    data._damageID   = Convert.ToInt32(sheet["BoxID"][i]);
                    data._damageName = Convert.ToString(sheet["BoxName"][i]);
                    data._boxType    = Convert.ToInt32(sheet["BoxType"][i]);

                    string prefabName = Convert.ToString(sheet["ResID"][i]);
                    string prefabPath = System.IO.Path.Combine(ASSET_TRAP_RES_CONFIG_FOLDER, prefabName + ".prefab");
                    data._damagePrefab = (GameObject)AssetDatabase.LoadAssetAtPath(prefabPath, typeof(GameObject));
                    string   correspondingItemIDStr       = Convert.ToString(sheet["BoxGoodsDrop"][i]);
                    string[] splitCorrespondingItemIDStrs = correspondingItemIDStr.Split("+".ToCharArray());
                    data._correspondingItemID = Convert.ToInt32(splitCorrespondingItemIDStrs[0]);

                    tempList.Add(data);
                }

                CreateSceneConfigDataBase(tempList);
            }
        }
    }
Esempio n. 15
0
    private static void OnPostprocessEquipment()
    {
        string     path = System.IO.Path.Combine(RESOURCE_DATA_FOLDER, "LinkConfig.xml");
        TextReader tr   = new StreamReader(path);
        string     text = tr.ReadToEnd();

        if (text == null)
        {
            Debug.LogError("Equipment item file not exist");
            return;
        }
        else
        {
            XmlSpreadSheetReader.ReadSheet(text);
            XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
            string[]       keys  = XmlSpreadSheetReader.Keys;

            object[] levelIds = sheet[keys[0]];

            List <LinkConfigItemData> tempList = new List <LinkConfigItemData>();

            for (int i = 2; i < levelIds.Length; i++)
            {
                //if (0 == i) continue;
                LinkConfigItemData data = new LinkConfigItemData();

                data.LinkID       = Convert.ToString(sheet["LinkID"][i]);
                data.LinkType     = (LinkType)Convert.ToInt32(sheet["LinkType"][i]);
                data.LinkPara     = Convert.ToString(sheet["LinkPara"][i]);
                data.LinkChildren = Convert.ToInt32(sheet["LinkChildren"][i]);
                data.LinkName     = Convert.ToString(sheet["LinkName"][i]);
                data.Des          = Convert.ToString(sheet["Des"][i]);
                string[]          LinkIconPaths = Convert.ToString(sheet["LinkIcon"][i]).Split('+');
                List <GameObject> prefabList    = new List <GameObject>();
                foreach (string item in LinkIconPaths)
                {
                    string     pathRes = System.IO.Path.Combine(ASSET_ITEM_DATA_ICON_FOLDER, item + ".prefab");
                    GameObject go      = (GameObject)AssetDatabase.LoadAssetAtPath(pathRes, typeof(GameObject));
                    prefabList.Add(go);
                }

                data.LinkIcon = prefabList;
                tempList.Add(data);
            }


            CreateMedicamentConfigDataList(tempList);
        }
    }
Esempio n. 16
0
    private static void RobotConfigPostprocess()
    {
        string     path = System.IO.Path.Combine(RESOURCE_ROBOT_CONFIG_FOLDER, "RobotConfig.xml");
        TextReader tr   = new StreamReader(path);
        string     text = tr.ReadToEnd();

        if (text == null)
        {
            Debug.LogError("Robot config file not exist");
            return;
        }
        else
        {
            XmlSpreadSheetReader.ReadSheet(text);
            XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
            string[]       keys  = XmlSpreadSheetReader.Keys;

            object[] levelIds = sheet[keys[0]];

            List <RobotConfigData> tempList = new List <RobotConfigData>();

            for (int i = 0; i < levelIds.Length; i++)
            {
                if (0 == i || 1 == i)
                {
                    continue;
                }
                RobotConfigData data = new RobotConfigData();

                data.RobotId         = Convert.ToInt32(sheet["RobotId"][i]);
                data.RobotName       = Convert.ToString(sheet["RobotName"][i]);
                data.RobotLevel      = Convert.ToInt32(sheet["RobotLevel"][i]);
                data.RobotOccupation = Convert.ToInt32(sheet["RobotOccupation"][i]);
                data.RobotFashion    = Convert.ToInt32(sheet["RobotFashion"][i]);
                data.RobotWeapon     = Convert.ToInt32(sheet["RobotWeapon"][i]);
                data.RobotHat        = Convert.ToInt32(sheet["RobotHat"][i]);
                data.RobotClothes    = Convert.ToInt32(sheet["RobotClothes"][i]);
                data.RobotShoes      = Convert.ToInt32(sheet["RobotShoes"][i]);
                data.RobotJewelry    = Convert.ToInt32(sheet["RobotJewelry"][i]);
                data.RobotVipLevel   = Convert.ToInt32(sheet["RobotVipLevel"][i]);
                data.RobotTitle      = Convert.ToInt32(sheet["RobotTitle"][i]);


                tempList.Add(data);
            }

            CreateRobotConfigDataBase(tempList);
        }
    }
Esempio n. 17
0
    private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets,
                                               string[] movedAssets, string[] movedFromPath)
    {
        if (CheckResModified(importedAssets) || CheckResModified(deletedAssets) || CheckResModified(movedAssets))
        {
            string     path = System.IO.Path.Combine(BUNDLE_CONFIG_RES_FOLDER, "AssetBundlesConfig.xml");
            TextReader tr   = new StreamReader(path);
            string     text = tr.ReadToEnd();

            if (text == null)
            {
                Debug.LogError("Bullet data file not exist");
                return;
            }
            else
            {
                XmlSpreadSheetReader.ReadSheet(text);
                XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
                string[]       keys  = XmlSpreadSheetReader.Keys;

                object[] levelIds = sheet[keys[0]];

                List <AssetBundlesConfig.Rule> tempList = new List <AssetBundlesConfig.Rule>();

                for (int i = 2; i < levelIds.Length; i++)
                {
                    AssetBundlesConfig.Rule rule = new AssetBundlesConfig.Rule();
                    rule._name        = Convert.ToString(sheet["Name"][i]);
                    rule._bundleName  = Convert.ToString(sheet["BundleName"][i]);
                    rule._enabled     = true;
                    rule._bundleOrder = i - 1;
                    rule._isolate     = false;
                    rule._pattern     = Convert.ToString(sheet["Pattern"][i]);

                    rule._patternOptions                   = new AssetBundlesConfig.RegexOptionsWrapper();
                    rule._patternOptions._ignoreCase       = Convert.ToBoolean(sheet["IgnoreCase"][i]);
                    rule._patternOptions._ignoreWhitespace = true;
                    rule._patternOptions._rightToLeft      = false;

                    rule._patternReplaceModifier = AssetBundlesConfig.RegexReplaceModifier.Lowercase;
                    rule._type = AssetBundlesConfig.RuleType.Include;
                    tempList.Add(rule);
                }

                CreateAssetBundlesConfigDataBase(tempList);
            }
        }
    }
Esempio n. 18
0
    private static void NPCConfigPostprocess()
    {
        string     path = System.IO.Path.Combine(RESOURCE_NPC_CONFIG_FOLDER, "NPCConfig.xml");
        TextReader tr   = new StreamReader(path);
        string     text = tr.ReadToEnd();

        if (text == null)
        {
            Debug.LogError("npc config file not exist");
            return;
        }
        else
        {
            XmlSpreadSheetReader.ReadSheet(text);
            XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
            string[]       keys  = XmlSpreadSheetReader.Keys;

            object[] levelIds = sheet[keys[0]];

            List <NPCConfigData> tempList = new List <NPCConfigData>();

            for (int i = 0; i < levelIds.Length; i++)
            {
                if (0 == i || 1 == i)
                {
                    continue;
                }
                NPCConfigData data = new NPCConfigData();
                data._NPCID    = Convert.ToInt32(sheet["NpcID"][i]);
                data._szName   = Convert.ToString(sheet["NpcName"][i]);
                data._npcTitle = Convert.ToString(sheet["NpcTitle"][i]);
                string PrefabName = Convert.ToString(sheet["PortraitID"][i]);
                string PrefabPath = System.IO.Path.Combine("Assets/Prefab/GUI/IconPrefab/StroyPersonHead", PrefabName + ".prefab");
                data.PortraitID = (GameObject)AssetDatabase.LoadAssetAtPath(PrefabPath, typeof(GameObject));
                string   cameraOffsetStr = Convert.ToString(sheet["CameraOffset"][i]);
                string[] splitStrs       = cameraOffsetStr.Split('|');
                data.CameraOffset = new Vector3(Convert.ToSingle(splitStrs[0]), Convert.ToSingle(splitStrs[1]), Convert.ToSingle(splitStrs[2]));
                string prefabpath = Convert.ToString(sheet["NpcPrefabPath"][i]);
                string pathRes    = System.IO.Path.Combine(ASSET_NPC_RES_CONFIG_FOLDER, prefabpath + ".prefab");
                data._NPCPrefab = (GameObject)AssetDatabase.LoadAssetAtPath(pathRes, typeof(GameObject));

                tempList.Add(data);
            }

            CreateNPCConfigDataBase(tempList);
        }
    }
Esempio n. 19
0
    private static void OnPostprocessEquipment()
    {
        string     path = System.IO.Path.Combine(RESOURCE_DATA_FOLDER, "PlayerStrengthCost.xml");
        TextReader tr   = new StreamReader(path);
        string     text = tr.ReadToEnd();

        if (text == null)
        {
            Debug.LogError("Equipment item file not exist");
            return;
        }
        else
        {
            XmlSpreadSheetReader.ReadSheet(text);
            XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
            string[]       keys  = XmlSpreadSheetReader.Keys;

            object[] levelIds = sheet[keys[0]];

            List <PlayerStrengthCost> tempList = new List <PlayerStrengthCost>();

            for (int i = 2; i < levelIds.Length; i++)
            {
                //if (0 == i) continue;
                PlayerStrengthCost data = new PlayerStrengthCost();
                data.GainType       = (UpgradeType)Convert.ToInt32(sheet["GainType"][i]);
                data.GainLevel      = Convert.ToInt32(sheet["GainLevel"][i]);
                data.lGoodsSubClass = (EquiptType)Convert.ToInt32(sheet["lGoodsSubClass"][i]);
                string[] UpgradeRequireStr            = Convert.ToString(sheet["UpgradeRequires"][i]).Split('|');
                List <UpgradeRequire> UpgradeRequires = new List <UpgradeRequire>();
                foreach (string item in UpgradeRequireStr)
                {
                    UpgradeRequire ur   = new UpgradeRequire();
                    string[]       strs = item.Split('+');
                    ur.GoodsId = Convert.ToInt32(strs[0]);
                    ur.Count   = Convert.ToInt32(strs[1]);
                    UpgradeRequires.Add(ur);
                }

                data.UpgradeRequires = UpgradeRequires;
                tempList.Add(data);
            }


            CreateMedicamentConfigDataList(tempList);
        }
    }
Esempio n. 20
0
    private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets,
                                               string[] movedAssets, string[] movedFromPath)
    {
        if (CheckResModified(importedAssets) || CheckResModified(deletedAssets) || CheckResModified(movedAssets))
        {
            string     path = System.IO.Path.Combine(RESOURCE_TRAP_CONFIG_FOLDER, "DailyTask.xml");
            TextReader tr   = new StreamReader(path);
            string     text = tr.ReadToEnd();

            if (text == null)
            {
                Debug.LogError("Player level config file not exist");
                return;
            }
            else
            {
                XmlSpreadSheetReader.ReadSheet(text);
                XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
                string[]       keys  = XmlSpreadSheetReader.Keys;

                object[] levelIds = sheet[keys[0]];

                List <DailyTaskConfigData> tempList = new List <DailyTaskConfigData>();

                for (int i = 0; i < levelIds.Length; i++)
                {
                    if (0 == i || 1 == i)
                    {
                        continue;
                    }
                    DailyTaskConfigData data = new DailyTaskConfigData();

                    data._taskID             = Convert.ToInt32(sheet["TaskID"][i]);
                    data._taskType           = Convert.ToInt32(sheet["TaskType"][i]);
                    data._triggerCondition   = Convert.ToInt32(sheet["TriggerCondition"][i]);
                    data._taskDescription    = Convert.ToString(sheet["TaskDescription"][i]);
                    data._conditionParameter = Convert.ToInt32(sheet["ConditionParameter"][i]);
                    data._activeValue        = Convert.ToInt32(sheet["ActiveValue"][i]);
                    data._quickTripTo        = Convert.ToInt32(sheet["QuickTripTo"][i]);

                    tempList.Add(data);
                }

                CreateSceneConfigDataBase(tempList);
            }
        }
    }
Esempio n. 21
0
    private static void PostProcessorFruitData()
    {
        string     path = System.IO.Path.Combine(RESOURCE_TREASURETREES_CONFIG_FOLDER, "PlayerFruit.xml");
        TextReader tr   = new StreamReader(path);
        string     text = tr.ReadToEnd();

        if (text == null)
        {
            Debug.LogError("Player level config file not exist");
            return;
        }
        else
        {
            XmlSpreadSheetReader.ReadSheet(text);
            XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
            string[]       keys  = XmlSpreadSheetReader.Keys;

            object[] levelIds = sheet[keys[0]];

            List <FruitData> tempList = new List <FruitData>();

            for (int i = 0; i < levelIds.Length; i++)
            {
                if (0 == i || 1 == i)
                {
                    continue;
                }
                FruitData data = new FruitData();
                data.FruitID       = Convert.ToInt32(sheet["FruitID"][i]);
                data.FruitName     = Convert.ToString(sheet["FruitName"][i]);
                data.SeedModelID   = Convert.ToString(sheet["SeedModelID"][i]);
                data.FlowerModelID = Convert.ToString(sheet["FlowerModelID"][i]);
                data.GrowModelID   = Convert.ToString(sheet["GrowModelID"][i]);
                data.RipenModelID  = Convert.ToString(sheet["RipenModelID"][i]);
                data.FruitLevel    = Convert.ToInt32(sheet["FruitLevel"][i]);
                data.FlowerTime    = Convert.ToInt32(sheet["FlowerTime"][i]);
                data.GrowTime      = Convert.ToInt32(sheet["GrowTime"][i]);
                data.RipenTime     = Convert.ToInt32(sheet["RipenTime"][i]);
                data.RewardType    = Convert.ToInt32(sheet["RewardType"][i]);
                data.RewardNumber  = Convert.ToString(sheet["RewardNumber"][i]);
                data.FruitReward   = Convert.ToString(sheet["FruitReward"][i]).Split('+');
                tempList.Add(data);
            }

            CreateConfigDataBase(tempList);
        }
    }
Esempio n. 22
0
    private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets,
                                               string[] movedAssets, string[] movedFromPath)
    {
        if (CheckResModified(importedAssets) || CheckResModified(deletedAssets) || CheckResModified(movedAssets))
        {
            string     path = System.IO.Path.Combine(RESOURCE_PORTAL_CONFIG_FOLDER, "MapChunnel.xml");
            TextReader tr   = new StreamReader(path);
            string     text = tr.ReadToEnd();

            if (text == null)
            {
                Debug.LogError("Portal config file not exist");
                return;
            }
            else
            {
                XmlSpreadSheetReader.ReadSheet(text);
                XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
                string[]       keys  = XmlSpreadSheetReader.Keys;

                object[] levelIds = sheet[keys[0]];

                List <PortalConfigData> tempList = new List <PortalConfigData>();

                for (int i = 0; i < levelIds.Length; i++)
                {
                    if (0 == i || 1 == i)
                    {
                        continue;
                    }
                    PortalConfigData data = new PortalConfigData();
                    data._SID        = Convert.ToInt32(sheet["sid"][i]);
                    data._portalType = Convert.ToInt32(sheet["type"][i]);
                    string[] mapID = Convert.ToString(sheet["destmapid"][i]).Split('+');
                    data._desMapID = new int[mapID.Length];
                    for (int j = 0; j < mapID.Length; ++j)
                    {
                        data._desMapID[j] = int.Parse(mapID[j]);
                    }

                    tempList.Add(data);
                }

                CreateConfigDataBase(tempList);
            }
        }
    }
Esempio n. 23
0
    private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets,
                                               string[] movedAssets, string[] movedFromPath)
    {
        if (CheckResModified(importedAssets) || CheckResModified(deletedAssets) || CheckResModified(movedAssets))
        {
            string     path = System.IO.Path.Combine(RESOURCE_PROFESSION_CONFIG_FOLDER, "ProfessionConfig.xml");
            TextReader tr   = new StreamReader(path);
            string     text = tr.ReadToEnd();

            if (text == null)
            {
                Debug.LogError("Portal config file not exist");
                return;
            }
            else
            {
                XmlSpreadSheetReader.ReadSheet(text);
                XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
                string[]       keys  = XmlSpreadSheetReader.Keys;

                object[] levelIds = sheet[keys[0]];

                List <ProfessionConfigData> tempList = new List <ProfessionConfigData>();

                for (int i = 0; i < levelIds.Length; i++)
                {
                    if (0 == i || 1 == i)
                    {
                        continue;
                    }
                    ProfessionConfigData data = new ProfessionConfigData();
                    data._professionID   = Convert.ToInt32(sheet["ProfessionID"][i]);
                    data._professionName = Convert.ToString(sheet["ProfessionName"][i]);


                    string prefabpath = Convert.ToString(sheet["PlayerIcon"][i]);
                    string pathRes    = System.IO.Path.Combine(ASSET_PLAYERICON_RES_CONFIG_FOLDER, prefabpath + ".prefab");
                    data._playerIcon = (GameObject)AssetDatabase.LoadAssetAtPath(pathRes, typeof(GameObject));

                    tempList.Add(data);
                }

                CreateConfigDataBase(tempList);
            }
        }
    }
Esempio n. 24
0
    private static void OnPostprocessEquipment()
    {
        string     path = System.IO.Path.Combine(RESOURCE_PLAYER_DATA_FOLDER, "PlayerPropParam.xml");
        TextReader tr   = new StreamReader(path);
        string     text = tr.ReadToEnd();

        if (text == null)
        {
            Debug.LogError("Equipment item file not exist");
            return;
        }
        else
        {
            XmlSpreadSheetReader.ReadSheet(text);
            XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
            string[]       keys  = XmlSpreadSheetReader.Keys;

            object[] levelIds = sheet[keys[0]];

            List <PlayerBasePropData> tempList = new List <PlayerBasePropData>();

            for (int i = 1; i < levelIds.Length; i++)
            {
                if (1 >= i)
                {
                    continue;
                }
                PlayerBasePropData data = new PlayerBasePropData();
                //data.PlayerKind = Convert.ToInt32(sheet["PlayerKind"][i]);
                //data.BasePropID = Convert.ToInt32(sheet["BasePropID"][i]);
                //data.BaseProp = Convert.ToString(sheet["BaseProp"][i]);
                //data.ParamA = Convert.ToSingle(sheet["ParamA"][i])/1000;
                //data.ParamB = Convert.ToSingle(sheet["ParamB"][i]) / 1000;
                //data.ParamC = Convert.ToSingle(sheet["ParamC"][i]) / 1000;
                //data.ParamD = Convert.ToSingle(sheet["ParamD"][i]) / 1000;
                data.nPropID   = Convert.ToInt32(sheet["nPropID"][i]);
                data.nSettleID = Convert.ToInt32(sheet["nSettleID"][i]);

                tempList.Add(data);
            }


            CreateMedicamentConfigDataList(tempList);
        }
    }
Esempio n. 25
0
    private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets,
                                               string[] movedAssets, string[] movedFromPath)
    {
        if (CheckResModified(importedAssets) || CheckResModified(deletedAssets) || CheckResModified(movedAssets))
        {
            string path = System.IO.Path.Combine(EW_RESOURCE_PLAYER_LEVEL_CONFIG_FOLDER, "PlayerLevelConfig.xml");

            TextReader tr = new StreamReader(path);

            string text = tr.ReadToEnd();

            if (text == null)
            {
                Debug.LogError("Player level config file not exist");
                return;
            }
            else
            {
                XmlSpreadSheetReader.ReadSheet(text);

                XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;

                string[] keys = XmlSpreadSheetReader.Keys;


                object[] levelIds = sheet[keys[0]];

                List <PlayerLevelConfigData> tempList = new List <PlayerLevelConfigData>();

                for (int i = 0; i < levelIds.Length; i++)
                {
                    PlayerLevelConfigData data = new PlayerLevelConfigData();
                    data._hp           = Convert.ToInt32(sheet["hp"][i]);
                    data._level        = Convert.ToInt32(sheet["level"][i]);
                    data._xp           = Convert.ToInt32(sheet["xp"][i]);
                    data._skillPoint   = Convert.ToInt32(sheet["skillpoint"][i]);
                    data._reviveHcCost = Convert.ToInt32(sheet["revive_hc"][i]);

                    tempList.Add(data);
                }

                CreatePlayerLevelConfigDataBase(tempList);
            }
        }
    }
Esempio n. 26
0
    /**
     * 创建xml
     * */
    private static void createXML(string url, string xmlName)
    {
        string     path = System.IO.Path.Combine(url, xmlName + ".xml");
        TextReader tr   = new StreamReader(path);
        string     text = tr.ReadToEnd();



        if (text == null)
        {
            Debug.LogError("Player level config file not exist");
            return;
        }
        else
        {
            XmlSpreadSheetReader.ReadSheet(text);
            XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;    //所有的输出
            string[]       keys  = XmlSpreadSheetReader.Keys;      //所有的kes


            // 数据
            Dictionary <string, Dictionary <string, string> > dic = new Dictionary <string, Dictionary <string, string> >();

            //id数组
            object[] idArray = sheet[keys[0]];
            for (int i = 3; i < idArray.Length; i++)           //从第二个开始  0:id 1:说明 2
            {
                Dictionary <string, string> one = new Dictionary <string, string>();
                for (int j = 0; j < keys.Length; j++)
                {
                    string key   = Convert.ToString(keys[j]);
                    string type  = Convert.ToString(sheet[key][0]);
                    string value = Convert.ToString(sheet[key][i]);
                    one[key] = value;

                    Debug.Log(key + "==" + value + "==" + type);
                }

                string current = Convert.ToString(idArray[i]);
                dic[current] = one;
            }

            //CreateSceneConfigDataBase(tempList);
        }
    }
Esempio n. 27
0
    private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets,
                                               string[] movedAssets, string[] movedFromPath)
    {
        if (CheckResModified(importedAssets) || CheckResModified(deletedAssets) || CheckResModified(movedAssets))
        {
            string     path = System.IO.Path.Combine(RESOURCE_SHOP_CONFIG_FOLDER, "GoldRecharge.xml");
            TextReader tr   = new StreamReader(path);
            string     text = tr.ReadToEnd();

            if (text == null)
            {
                Debug.LogError("Player level config file not exist");
                return;
            }
            else
            {
                XmlSpreadSheetReader.ReadSheet(text);
                XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
                string[]       keys  = XmlSpreadSheetReader.Keys;

                object[] levelIds = sheet[keys[0]];

                List <GoldRechargeData> tempList = new List <GoldRechargeData>();

                for (int i = 1; i < levelIds.Length; i++)
                {
                    GoldRechargeData data = new GoldRechargeData();
                    data.RechargeID        = Convert.ToInt32(sheet["RechargeID"][i]);
                    data.RechargeType      = Convert.ToInt32(sheet["RechargeType"][i]);
                    data.RechargePosition  = Convert.ToString(sheet["RechargePosition"][i]);
                    data.CurrencyPicture   = Convert.ToString(sheet["CurrencyPicture"][i]);
                    data.GoldPicture       = Convert.ToString(sheet["GoldPicture"][i]);
                    data.goldPicturePrefab = (GameObject)Resources.LoadAssetAtPath("Assets/Prefab/GUI/IconPrefab/VIPIcon/" + data.GoldPicture + ".prefab", typeof(GameObject));
                    data.CurrencyNumber    = Convert.ToSingle(sheet["CurrencyNumber"][i]);
                    data.GoldNumber        = Convert.ToInt32(sheet["GoldNumber"][i]);
                    data.Discount          = Convert.ToSingle(sheet["Discount"][i]);
                    data.TouchAnimation    = Convert.ToString(sheet["TouchAnimation"][i]);
                    data.TouchVoice        = Convert.ToString(sheet["TouchVoice"][i]);
                    tempList.Add(data);
                }

                CreateConfigDataBase(tempList);
            }
        }
    }
Esempio n. 28
0
    private static void OnPostprocessPVPListAward()
    {
        string     path = System.IO.Path.Combine(RESOURCE_PVP_CONFIG_FOLDER, "PVPGroupListAward.xml");
        TextReader tr   = new StreamReader(path);
        string     text = tr.ReadToEnd();

        if (text == null)
        {
            Debug.LogError("PVPGroupListAward config file not exist");
            return;
        }
        else
        {
            XmlSpreadSheetReader.ReadSheet(text);
            XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
            string[]       keys  = XmlSpreadSheetReader.Keys;

            object[] levelIds = sheet[keys[0]];

            List <PVPGroupListAward> tempList = new List <PVPGroupListAward>();

            for (int i = 2; i < levelIds.Length; i++)
            {
                PVPGroupListAward data = new PVPGroupListAward();
                data.ListAward       = Convert.ToInt32(sheet["ListAward"][i]);
                data.ListAwardType   = Convert.ToInt32(sheet["ListAwardType"][i]);
                data.ListAwardGroup  = Convert.ToInt32(sheet["ListAwardGroup"][i]);
                data.ListAwardPlace  = Convert.ToString(sheet["ListAwardPlace"][i]);
                data.ListAwardParam1 = Convert.ToString(sheet["ListAwardParam1"][i]);
                data.ListAwardParam2 = Convert.ToString(sheet["ListAwardParam2"][i]);
                data.ListAwardParam3 = Convert.ToString(sheet["ListAwardParam3"][i]);
                data.ListAwardMail   = Convert.ToInt32(sheet["ListAwardMail"][i]);
                data.ListAwardIcon   = Convert.ToString(sheet["ListAwardIcon"][i]);
                data.ListAwardName   = Convert.ToString(sheet["ListAwardName"][i]);
                data.ListAward01Icon = Convert.ToString(sheet["ListAward01Icon"][i]);
                data.ListAward01Des  = Convert.ToString(sheet["ListAward01Des"][i]);
                data.ListAward02Icon = Convert.ToString(sheet["ListAward02Icon"][i]);
                data.ListAward02Des  = Convert.ToString(sheet["ListAward02Des"][i]);

                tempList.Add(data);
            }

            CreateConfigDataBase(tempList);
        }
    }
Esempio n. 29
0
    private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets,
                                               string[] movedAssets, string[] movedFromPath)
    {
        if (CheckResModified(importedAssets) || CheckResModified(deletedAssets) || CheckResModified(movedAssets))
        {
            string     path = System.IO.Path.Combine(EW_RESOURCE_SKILL_CONFIG_FOLDER, "PlayerPassiveSkill.xml");
            TextReader tr   = new StreamReader(path);
            string     text = tr.ReadToEnd();

            if (text == null)
            {
                Debug.LogError("Bullet data file not exist");
                return;
            }
            else
            {
                XmlSpreadSheetReader.ReadSheet(text);
                XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
                string[]       keys  = XmlSpreadSheetReader.Keys;

                object[] levelIds = sheet[keys[0]];

                List <PassiveSkillData> tempList = new List <PassiveSkillData>();

                for (int i = 2; i < levelIds.Length; i++)
                {
                    PassiveSkillData data = new PassiveSkillData();

                    data.SkillID    = Convert.ToInt32(sheet["SkillID"][i]);
                    data.SkillLevel = Convert.ToInt32(sheet["SkillLevel"][i]);
                    data.MaxLevel   = Convert.ToInt32(sheet["MaxLevel"][i]);
                    data.SkillName  = Convert.ToString(sheet["SkillName"][i]);
                    data.SkillIcon  = Convert.ToString(sheet["SkillIcon"][i]);
                    data.SkillDis   = Convert.ToString(sheet["SkillDis"][i]);

                    string iconPath = System.IO.Path.Combine(SkillIconPrefabPath, data.SkillIcon + ".prefab");
                    data.SkillIconPrefab = AssetDatabase.LoadAssetAtPath(iconPath, typeof(GameObject)) as GameObject;

                    tempList.Add(data);
                }

                CreateBulletDataBase(tempList);
            }
        }
    }
Esempio n. 30
0
    private static void NPCSpecialPostprocess()
    {
        string     path = System.IO.Path.Combine(RESOURCE_NPC_CONFIG_FOLDER, "NPCSpecial.xml");
        TextReader tr   = new StreamReader(path);
        string     text = tr.ReadToEnd();

        if (text == null)
        {
            Debug.LogError("Special config file not exist");
            return;
        }
        else
        {
            XmlSpreadSheetReader.ReadSheet(text);
            XmlSpreadSheet sheet = XmlSpreadSheetReader.Output;
            string[]       keys  = XmlSpreadSheetReader.Keys;

            object[] levelIds = sheet[keys[0]];

            List <NPCSpecialConfigData> tempList = new List <NPCSpecialConfigData>();

            for (int i = 0; i < levelIds.Length; i++)
            {
                if (0 == i || 1 == i)
                {
                    continue;
                }
                NPCSpecialConfigData data = new NPCSpecialConfigData();
                data._NPCID        = Convert.ToInt32(sheet["NpcID"][i]);
                data._FunctionDesc = Convert.ToString(sheet["FunctionDesc"][i]);
                data._FunctionType = Convert.ToInt32(sheet["FunctionType"][i]);
                data.Parameters    = Convert.ToInt32(sheet["Parameters"][i]);
                data.ShopIcon      = Convert.ToString(sheet["ShopIcon"][i]);
                data.ShopTitle     = Convert.ToString(sheet["ShopTitle"][i]);
                //string prefabpath = Convert.ToString(sheet["NpcPrefabPath"][i]);
                //string pathRes = System.IO.Path.Combine(ASSET_ECTYPE_RES_CONFIG_FOLDER, prefabpath + ".prefab");
                //data._NPCPrefab = (GameObject)AssetDatabase.LoadAssetAtPath(pathRes, typeof(GameObject));

                tempList.Add(data);
            }

            CreateNPCSpecialConfigDataBase(tempList);
        }
    }