Example #1
0
        public static bool Load(MasterDataHousingLevelParameter target)
        {
            var client     = new DatabaseClient("", "");
            var error      = string.Empty;
            var db         = client.GetDatabase(SpreadSheetName, ref error);
            var table      = db.GetTable <HousingLevelParameterData>(WorkSheetName) ?? db.CreateTable <HousingLevelParameterData>(WorkSheetName);
            var myDataList = new List <MasterDataHousingLevelParameter.Record>();
            var all        = table.FindAll();

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

            target.Records = myDataList.ToArray();

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

            return(true);
        }
Example #2
0
 public Record(SpreadSheetData.HousingLevelParameterData data)
 {
     this.id         = data.Id;
     this.level      = data.Level;
     this.population = data.Population;
 }