Ejemplo n.º 1
0
 public void RecreateSprites()
 {
     if (Sprite != null)
     {
         Sprite.Remove();
         var source = Sprite.SourceElement;
         Sprite = new Sprite(source, file: GetSpritePath(source, Params.normalSpriteParams));
     }
     if (_deformSprite != null)
     {
         _deformSprite.Remove();
         var source = _deformSprite.Sprite.SourceElement;
         _deformSprite = new DeformableSprite(source, filePath: GetSpritePath(source, Params.deformSpriteParams));
     }
     if (DamagedSprite != null)
     {
         DamagedSprite.Remove();
         var source = DamagedSprite.SourceElement;
         DamagedSprite = new Sprite(source, file: GetSpritePath(source, Params.damagedSpriteParams));
     }
     for (int i = 0; i < ConditionalSprites.Count; i++)
     {
         var conditionalSprite = ConditionalSprites[i];
         var source            = conditionalSprite.ActiveSprite.SourceElement;
         conditionalSprite.Remove();
         ConditionalSprites[i] = new ConditionalSprite(source, character, file: GetSpritePath(source, null));
     }
     for (int i = 0; i < DecorativeSprites.Count; i++)
     {
         var decorativeSprite = DecorativeSprites[i];
         decorativeSprite.Remove();
         var source = decorativeSprite.Sprite.SourceElement;
         DecorativeSprites[i] = new DecorativeSprite(source, file: GetSpritePath(source, Params.decorativeSpriteParams[i]));
     }
 }
Ejemplo n.º 2
0
 public void Remove()
 {
     Sprite?.Remove();
     Sprite = null;
     DeformableSprite?.Remove();
     DeformableSprite = null;
 }