public Record(SpreadSheetData.FacilityLevelParameterData data) { this.id = data.Id; this.level = data.Level; this.productSlot = data.Productslot; var stringAsset = AssetDatabase.LoadAssetAtPath <StringAsset>("Assets/HK/AutoAnt/DataSources/StringAsset/Item.asset"); this.productId = data.Productid; this.needProductTime = data.Needproducttime; this.popularity = data.Popularity; this.economic = data.Economic; }
public static bool Load(MasterDataFacilityLevelParameter target) { var client = new DatabaseClient("", ""); var error = string.Empty; var db = client.GetDatabase(SpreadSheetName, ref error); var table = db.GetTable <FacilityLevelParameterData>(WorkSheetName) ?? db.CreateTable <FacilityLevelParameterData>(WorkSheetName); var myDataList = new List <MasterDataFacilityLevelParameter.Record>(); var all = table.FindAll(); foreach (var element in all) { var data = new FacilityLevelParameterData(); data = Cloner.DeepCopy <FacilityLevelParameterData>(element.Element); myDataList.Add(new MasterDataFacilityLevelParameter.Record(data)); } target.Records = myDataList.ToArray(); EditorUtility.SetDirty(target); AssetDatabase.SaveAssets(); return(true); }