Changeset 803 for 2010/23/sijoseha/alpha/Effects/ParticleSystem.cs
- Timestamp:
- 2010-06-14 14:18:35 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/23/sijoseha/alpha/Effects/ParticleSystem.cs
r802 r803 23 23 protected Vector2 position; 24 24 25 protected Texture2D texture;25 protected String textureName; 26 26 27 protected Texture2D innerTexture;28 protected Texture2D outTexture;27 protected String innerTextureName; 28 protected String outerTextureName; 29 29 30 30 protected float minScale; … … 43 43 #endregion 44 44 45 private enum TextureType 46 { 47 Single, 48 Dual 49 }; 50 51 private TextureType textureType; 52 53 private Texture2D texture, innerTexture, outerTexture; 54 45 55 private int maxAmountOfParticles; 46 56 public int MaxAmountOfParticles … … 50 60 } 51 61 52 public ParticleSystem(Game game, Vector2 position )62 public ParticleSystem(Game game, Vector2 position, String textureName) 53 63 : base(game) 54 64 { 65 textureType = TextureType.Single; 66 this.game = game; 67 } 68 69 public ParticleSystem(Game game, Vector2 position, String innerTextureName, String outerTextureName) 70 : base(game) 71 { 72 textureType = TextureType.Dual; 55 73 this.game = game; 56 74 } … … 60 78 protected override void LoadContent() 61 79 { 80 if (textureType == TextureType.Single) 81 { 82 texture = game.Content.Load<Texture2D>(textureName.ToString()); 83 } 84 if (textureType == TextureType.Dual) 85 { 86 innerTexture = game.Content.Load<Texture2D>(innerTextureName.ToString()); 87 outerTexture = game.Content.Load<Texture2D>(outerTextureName.ToString()); 88 } 62 89 base.LoadContent(); 63 90 }
Note: See TracChangeset
for help on using the changeset viewer.