public static bool Load(MasterDataUnlockCellEvent target) { var client = new DatabaseClient("", ""); var error = string.Empty; var db = client.GetDatabase(SpreadSheetName, ref error); var table = db.GetTable <UnlockCellEventData>(WorkSheetName) ?? db.CreateTable <UnlockCellEventData>(WorkSheetName); var myDataList = new List <MasterDataUnlockCellEvent.Record>(); var all = table.FindAll(); foreach (var element in all) { var data = new UnlockCellEventData(); data = Cloner.DeepCopy <UnlockCellEventData>(element.Element); myDataList.Add(new MasterDataUnlockCellEvent.Record(data)); } target.Records = myDataList.ToArray(); EditorUtility.SetDirty(target); AssetDatabase.SaveAssets(); return(true); }
public Record(SpreadSheetData.UnlockCellEventData data) { this.id = data.Id; this.unlockCellEventRecordId = data.Unlockcelleventrecordid; this.needCellEvents = JsonUtility.FromJson <NeedCellEvent.Json>(data.Needcellevent).NeedCellEvent; }