Exemplo n.º 1
0
 /// <summary>
 /// Applies the effect to a sprite
 /// </summary>
 /// <param name="sprite">Sprite to apply the effect to</param>
 public void Apply(Sprite sprite)
 {
     if (gameValueKey != null && modifier != null)
     {
         if(sprite.GetType().GetField(gameValueKey) != null)
         {
             modifier.Modify(sprite.GetType().GetField(gameValueKey).GetValue(sprite) as GameValue);
         }
     }
     if (gameValue != null)
     {
         modifier.Modify(gameValue);
     }
     if (gameAction != null)
     {
         gameAction.Invoke(sprite);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Applies the effect to a sprite
 /// </summary>
 /// <param name="sprite">Sprite to apply the effect to</param>
 public void Apply(Sprite sprite)
 {
     if (gameValueKey != null && modifier != null)
     {
         if(sprite.gameValueDictionary.ContainsKey(gameValueKey))
         {
             modifier.Modify(sprite.gameValueDictionary[gameValueKey]);
         }
     }
     if (gameValue != null)
     {
         modifier.Modify(gameValue);
     }
     if (gameAction != null)
     {
         gameAction.Invoke(sprite);
     }
 }