Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EditorContentLoader"/> class
        /// </summary>
        /// <param name="gameDispatcher">The dispatcher to the game thread.</param>
        /// <param name="logger">The logger to use to log operations.</param>
        /// <param name="asset">The asset associated with this instance.</param>
        /// <param name="game">The editor game associated with this instance.</param>
        public EditorContentLoader(IDispatcherService gameDispatcher, ILogger logger, AssetViewModel asset, EditorServiceGame game)
        {
            if (asset == null)
            {
                throw new ArgumentNullException(nameof(asset));
            }

            GameDispatcher = gameDispatcher ?? throw new ArgumentNullException(nameof(gameDispatcher));
            Session        = asset.Session;
            Session.AssetPropertiesChanged += AssetPropertiesChanged;
            Game             = game ?? throw new ArgumentNullException(nameof(game));
            Asset            = asset;
            Manager          = new LoaderReferenceManager(GameDispatcher, this);
            this.logger      = logger;
            database         = asset.ServiceProvider.Get <GameStudioDatabase>();
            settingsProvider = asset.ServiceProvider.Get <GameSettingsProviderService>();
            settingsProvider.GameSettingsChanged += GameSettingsChanged;
            currentRenderingMode        = settingsProvider.CurrentGameSettings.GetOrCreate <EditorSettings>().RenderingMode;
            currentColorSpace           = settingsProvider.CurrentGameSettings.GetOrCreate <RenderingSettings>().ColorSpace;
            currentNavigationGroupsHash = settingsProvider.CurrentGameSettings.GetOrDefault <NavigationSettings>().ComputeGroupsHash();
        }
Ejemplo n.º 2
0
 public Task Clear([NotNull] LoaderReferenceManager manager, AbsoluteId referencerId, AssetId contentId)
 {
     return(manager.ClearContentReference(referencerId, contentId, contentNode, index));
 }