Пример #1
0
        public static bool Load(MasterDataLevelUpCost target)
        {
            var client     = new DatabaseClient("", "");
            var error      = string.Empty;
            var db         = client.GetDatabase(SpreadSheetName, ref error);
            var table      = db.GetTable <LevelUpCostData>(WorkSheetName) ?? db.CreateTable <LevelUpCostData>(WorkSheetName);
            var myDataList = new List <MasterDataLevelUpCost.Record>();
            var all        = table.FindAll();

            foreach (var element in all)
            {
                var data = new LevelUpCostData();
                data = Cloner.DeepCopy <LevelUpCostData>(element.Element);
                myDataList.Add(new MasterDataLevelUpCost.Record(data));
            }

            target.Records = myDataList.ToArray();

            EditorUtility.SetDirty(target);
            AssetDatabase.SaveAssets();

            return(true);
        }
Пример #2
0
 public Record(SpreadSheetData.LevelUpCostData data)
 {
     this.id    = data.Id;
     this.level = data.Level;
     this.cost  = new LevelUpCost(data);
 }