Esempio n. 1
0
        public ReloadingResource(ResourceReloader resourceReloader, string resourceName)
        {
#if DEBUG && !IOS
            this.resourceReloader = resourceReloader;
            this.resourceName     = resourceName;

            watcher   = new FileSystemWatcher();
            debugPath = $"../../../../Shared/Content/{resourceName}";

            watcher.Path     = Path.GetDirectoryName(debugPath);
            watcher.Filter   = Path.GetFileName(debugPath) + ".*";
            watcher.Changed += (_, __) => {
                resourceReloader.TriggerReload(resourceName);
            };
            watcher.EnableRaisingEvents = true;

            resourceReloader.Register(resourceName, this);
#endif
        }
Esempio n. 2
0
 public ReloadingTexture(GraphicsDevice graphicsDevice, ResourceReloader resourceReloader, string textureName, Action <Texture2D> loadAction = null)
     : base(resourceReloader, textureName)
 {
     this.graphicsDevice = graphicsDevice;
     this.loadAction     = loadAction;
 }