void LoadParticleSystem() { System.Windows.Forms.OpenFileDialog fileDialog = new System.Windows.Forms.OpenFileDialog(); // Default to the directory which contains our content files. string assemblyLocation = System.Reflection.Assembly.GetExecutingAssembly().Location; string relativePath = System.IO.Path.Combine(assemblyLocation, "../../../../../../Client/Driver/Content"); string contentPath = System.IO.Path.GetFullPath(relativePath); fileDialog.InitialDirectory = contentPath; fileDialog.Title = "Load Particle System"; fileDialog.Filter = "VTank Particle System (*.vtpss)|*.vtpss"; if (fileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Renderer.SceneTools.Entities.Particles.ParticleSystemSettings newPSS = new Renderer.SceneTools.Entities.Particles.ParticleSystemSettings(); StreamReader read = new StreamReader(fileDialog.FileName); newPSS.Load(read); read.Close(); Renderer.RendererAssetPool.ParticleSystemSettings.Remove(Path.GetFileNameWithoutExtension(fileDialog.FileName)); Renderer.RendererAssetPool.ParticleSystemSettings.Add(Path.GetFileNameWithoutExtension(fileDialog.FileName), newPSS); } }
void LoadSampleEmitter() { Renderer.SceneTools.Entities.Particles.ParticleSystemSettings newPSS = new Renderer.SceneTools.Entities.Particles.ParticleSystemSettings(); StreamReader reads = new StreamReader(Path.Combine(Content.RootDirectory, "Sample.vtpss")); newPSS.Load(reads); reads.Close(); Renderer.RendererAssetPool.ParticleSystemSettings.Add("Sample", newPSS); Renderer.SceneTools.Entities.Particles.ParticleEmitterSettings newPES = new Renderer.SceneTools.Entities.Particles.ParticleEmitterSettings(); StreamReader reade = new StreamReader(Path.Combine(Content.RootDirectory, "Sample.vtpes")); newPES.Load(reade); reade.Close(); Renderer.RendererAssetPool.ParticleEmitterSettings.Clear(); Renderer.RendererAssetPool.ParticleEmitterSettings.Add("Sample", newPES); }
void LoadSampleEmitter() { Renderer.SceneTools.Entities.Particles.ParticleSystemSettings newPSS = new Renderer.SceneTools.Entities.Particles.ParticleSystemSettings(); StreamReader reads = new StreamReader(Path.Combine(Content.RootDirectory, "Sample.vtpss")); newPSS.Load(reads); reads.Close(); Renderer.RendererAssetPool.ParticleSystemSettings.Add("Sample", newPSS); Renderer.SceneTools.Entities.Particles.ParticleEmitterSettings newPES = new Renderer.SceneTools.Entities.Particles.ParticleEmitterSettings(); StreamReader reade = new StreamReader(Path.Combine(Content.RootDirectory, "Sample.vtpes")); newPES.Load(reade); reade.Close(); Renderer.RendererAssetPool.ParticleEmitterSettings.Clear(); Renderer.RendererAssetPool.ParticleEmitterSettings.Add("Sample", newPES); }
void LoadParticleSystem() { System.Windows.Forms.OpenFileDialog fileDialog = new System.Windows.Forms.OpenFileDialog(); // Default to the directory which contains our content files. string assemblyLocation = System.Reflection.Assembly.GetExecutingAssembly().Location; string relativePath = System.IO.Path.Combine(assemblyLocation, "../../../../../../Client/Driver/Content"); string contentPath = System.IO.Path.GetFullPath(relativePath); fileDialog.InitialDirectory = contentPath; fileDialog.Title = "Load Particle System"; fileDialog.Filter = "VTank Particle System (*.vtpss)|*.vtpss"; if (fileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Renderer.SceneTools.Entities.Particles.ParticleSystemSettings newPSS = new Renderer.SceneTools.Entities.Particles.ParticleSystemSettings(); StreamReader read = new StreamReader(fileDialog.FileName); newPSS.Load(read); read.Close(); Renderer.RendererAssetPool.ParticleSystemSettings.Remove(Path.GetFileNameWithoutExtension(fileDialog.FileName)); Renderer.RendererAssetPool.ParticleSystemSettings.Add(Path.GetFileNameWithoutExtension(fileDialog.FileName), newPSS); } }