public CardMetadata.Data GetMetadata() { if (!item.GetMetadataJson().IsNullOrEmpty()) { var existing = JsonUtility.FromJson <CardMetadata>(item.GetMetadataJson()); if (existing.cardSystemCardData.isCard) { return(existing.cardSystemCardData); } } // Create MD structure using the legacy fields Consider them custom cards. // NOTE: This will only happen for user embedded legacy behaviors, since // builtin legacy ones get filtered out before hand. var md = new CardMetadata.Data(); md.categories = BehaviorCards.CUSTOM_CATEGORIES; md.description = item.GetDescription(); md.imageResourcePath = placeHolderImageResPath; md.isCard = false; md.listPriority = 0; md.title = item.GetName(); return(md); }
PanelMetadata.Data GetMetadata() { return(JsonUtility.FromJson <PanelMetadata>(item.GetMetadataJson()).cardSystemPanelData); }