private void ParticleInitJsonString() { TextReader reader = null; string fileContents = ""; try { reader = new StreamReader(Content.RootDirectory + "/testParticle2.ptc"); fileContents = reader.ReadToEnd(); Console.WriteLine(fileContents); } catch (Exception e) { Console.WriteLine(e.Message); } finally { if (reader != null) { reader.Close(); } } if (fileContents != null) { _particleEffectJsonString = ParticleEffect.ReadFromJson( Content.RootDirectory + "\\", fileContents, GraphicsDevice, Content); foreach (var item in _particleEffectJsonString.Emitters) { if (string.IsNullOrEmpty(item.Value.TexturePath)) { item.Value.Texture = new Texture2D(GraphicsDevice, 1, 1); item.Value.Texture.SetData(new[] { Color.White }); } } } }