コード例 #1
0
        private void RefreshAssetStoreCachePathConfig(CachePathConfig config)
        {
            m_CurrentAssetStoreConfig = config;
            assetsCachePath.SetValueWithoutNotify(m_CurrentAssetStoreConfig.path.NormalizePath().EscapeBackslashes());
            UIUtils.SetElementDisplay(assetsCacheErrorBox, false);

            if (m_CurrentAssetStoreConfig.source == ConfigSource.Environment)
            {
                if (m_CurrentAssetStoreConfig.status == AssetStoreCachePathManager.ConfigStatus.ReadOnly)
                {
                    DisplayAssetsCacheErrorBox(HelpBoxMessageType.Warning, L10n.Tr("The Assets Cache location set by environment variable ASSETSTORE_CACHE_PATH is read only. Download or update of assets won't be possible."));
                }
                else if (m_CurrentAssetStoreConfig.status == AssetStoreCachePathManager.ConfigStatus.InvalidPath)
                {
                    assetsCacheDropdown.SetEnabled(false);
                    DisplayAssetsCacheErrorBox(HelpBoxMessageType.Error, L10n.Tr("The Assets Cache location set by environment variable ASSETSTORE_CACHE_PATH is invalid or inaccessible."));
                }
                else
                {
                    DisplayAssetsCacheErrorBox(HelpBoxMessageType.Info, L10n.Tr("The Assets Cache location is set by environment variable ASSETSTORE_CACHE_PATH, you cannot change it."));
                }
            }
            else
            {
                if (m_CurrentAssetStoreConfig.status == AssetStoreCachePathManager.ConfigStatus.ReadOnly)
                {
                    DisplayAssetsCacheErrorBox(HelpBoxMessageType.Warning, L10n.Tr("The Assets Cache location is read only. Download or update of assets won't be possible."));
                }
                else if (m_CurrentAssetStoreConfig.status != AssetStoreCachePathManager.ConfigStatus.Success)
                {
                    DisplayAssetsCacheErrorBox(HelpBoxMessageType.Error, L10n.Tr("The Assets Cache location is invalid or inaccessible. Change location or reset it to default location."));
                }
            }
        }
コード例 #2
0
        public virtual CachePathConfig GetConfig()
        {
            var config = AssetStoreCachePathManager.GetConfig();

            if (m_CurrentConfig == null ||
                string.Compare(config.path, m_CurrentConfig.path, StringComparison.Ordinal) != 0 ||
                config.source != m_CurrentConfig.source ||
                config.status != m_CurrentConfig.status)
            {
                m_CurrentConfig = config;
                onConfigChanged?.Invoke(m_CurrentConfig);
            }

            return(m_CurrentConfig);
        }