Beispiel #1
0
 /// <summary>
 /// Sets the color palette of a sprite to a pre-defined value.
 /// </summary>
 /// <param name="entity">The entity to manipulate.</param>
 /// <param name="color">The pre-defined color to use.</param>
 public void SetColorPalette(Entity entity, ColorType color)
 {
     if (entity.HasComponent <Sprite>())
     {
         ColorTypeAttribute attr = color.GetAttributeOfType <ColorTypeAttribute>();
         entity.GetComponent <Sprite>().SetColorOverride(attr.Red, attr.Green, attr.Blue, attr.Alpha);
     }
 }
Beispiel #2
0
 public static void SetColorPalette(Entity entity, ColorType color)
 {
     if (entity.HasComponent<Sprite>())
     {
         ColorTypeAttribute attr = color.GetAttributeOfType<ColorTypeAttribute>();
         entity.GetComponent<Sprite>().SetColorOverride(attr.Red, attr.Green, attr.Blue, attr.Alpha);
     }
 }