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

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

            target.Records = myDataList.ToArray();

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

            return(true);
        }
Example #2
0
 public Record(SpreadSheetData.CellEventData data)
 {
     this.cachedId  = 0;
     this.eventData = CellEvent.GetOrCreateAsset(data);
 }