コード例 #1
0
        /// <summary>
        /// Creates an instance of <see cref="ThumbnailListCompiler"/>.
        /// </summary>
        public ThumbnailListCompiler(ThumbnailGenerator generator, EventHandler <ThumbnailBuiltEventArgs> builtAction, AssetCompilerRegistry thumbnailCompilerRegistry)
            : base(thumbnailCompilerRegistry, typeof(ThumbnailCompilationContext))
        {
            if (generator == null)
            {
                throw new ArgumentNullException(nameof(generator));
            }
            if (thumbnailCompilerRegistry == null)
            {
                throw new ArgumentNullException(nameof(thumbnailCompilerRegistry));
            }

            this.generator   = generator;
            this.builtAction = builtAction;
        }
コード例 #2
0
        protected StrideThumbnailCommand(ThumbnailCompilerContext context, AssetItem assetItem, IAssetFinder assetFinder, string url, ThumbnailCommandParameters parameters)
            : base(url, assetItem, parameters, assetFinder)
        {
            CompilerContext = context ?? throw new ArgumentNullException(nameof(context));
            this.assetItem  = assetItem;

            // Copy GameSettings ColorSpace/RenderingMode to the parameters
            var gameSettings = context.GetGameSettingsAsset();

            var renderingSettings = gameSettings.GetOrCreate <RenderingSettings>();

            parameters.ColorSpace    = renderingSettings.ColorSpace;
            parameters.RenderingMode = gameSettings.GetOrCreate <EditorSettings>().RenderingMode;

            Generator = context.Properties.Get(ThumbnailGenerator.Key) ?? throw new ArgumentException("The provided context does not contain required stride information needed to build the thumbnails.");
        }
コード例 #3
0
        public GameStudioThumbnailService(SessionViewModel session, GameSettingsProviderService settingsProvider, GameStudioBuilderService assetBuilderService)
        {
            this.session             = session;
            this.assetBuilderService = assetBuilderService;

            generator        = new ThumbnailGenerator((EffectCompilerBase)assetBuilderService.EffectCompiler);
            compilerRegistry = new AssetCompilerRegistry {
                DefaultCompiler = new CustomAssetThumbnailCompiler()
            };
            thumbnailCompiler = new ThumbnailListCompiler(generator, ThumbnailBuilt, compilerRegistry);

            gameSettingsProviderService = settingsProvider;
            gameSettingsProviderService.GameSettingsChanged += GameSettingsChanged;
            UpdateGameSettings(settingsProvider.CurrentGameSettings);
            StartPushNotificationsTask();
        }