public Record(SpreadSheetData.CellBundleData data) { this.id = data.Id; this.group = data.Group; this.cellRecordId = data.Cellrecordid; this.position = new Vector2Int(data.X, data.Y); }
public static bool Load(MasterDataCellBundle target) { var client = new DatabaseClient("", ""); var error = string.Empty; var db = client.GetDatabase(SpreadSheetName, ref error); var table = db.GetTable <CellBundleData>(WorkSheetName) ?? db.CreateTable <CellBundleData>(WorkSheetName); var myDataList = new List <MasterDataCellBundle.Record>(); var all = table.FindAll(); foreach (var element in all) { var data = new CellBundleData(); data = Cloner.DeepCopy <CellBundleData>(element.Element); myDataList.Add(new MasterDataCellBundle.Record(data)); } target.Records = myDataList.ToArray(); EditorUtility.SetDirty(target); AssetDatabase.SaveAssets(); return(true); }