Esempio n. 1
0
        private bool RefreshSizeInfo()
        {
            var showSizes = m_Version.sizes.Any();

            UIUtils.SetElementDisplay(detailSizesContainer, showSizes);
            detailSizes.Clear();

            var sizeInfo = m_Version.sizes.FirstOrDefault(info => info.supportedUnityVersion == m_Version.supportedVersion);

            if (sizeInfo == null)
            {
                sizeInfo = m_Version.sizes.LastOrDefault();
            }

            if (sizeInfo != null)
            {
                var label = new SelectableLabel();
                label.style.whiteSpace = WhiteSpace.Normal;
                label.SetValueWithoutNotify(string.Format(L10n.Tr("Size: {0} (Number of files: {1})"), UIUtils.ConvertToHumanReadableSize(sizeInfo.downloadSize), sizeInfo.assetCount));
                detailSizes.Add(label);
            }

            return(showSizes);
        }
        private void RefreshSizeInfo(IPackageVersion version)
        {
            var showSizes = version.sizes.Any();

            if (showSizes)
            {
                var sizeInfo = version.sizes.FirstOrDefault(info => info.supportedUnityVersion == version.supportedVersion) ?? version.sizes.Last();
                detailSizes.SetValueWithoutNotify(string.Format(L10n.Tr("Size: {0} (Number of files: {1})"), UIUtils.ConvertToHumanReadableSize(sizeInfo.downloadSize), sizeInfo.assetCount));
            }
            UIUtils.SetElementDisplay(detailSizesContainer, showSizes);
        }