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

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

            target.Records = myDataList.ToArray();

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

            return(true);
        }
Example #2
0
 public Record(SpreadSheetData.UnlockCellBundleData data)
 {
     this.id = data.Id;
     this.unlockCellBundleGroup = data.Unlockcellbundlegroup;
     this.needPopulation        = data.Needpopulation;
 }