Selaa lähdekoodia

Merge pull request #396 from pharan/moreextensions

Added skeleton.SetColor to Unity SkeletonExtensions.
Fenrisul 10 vuotta sitten
vanhempi
commit
4d8e00919d
1 muutettua tiedostoa jossa 14 lisäystä ja 0 poistoa
  1. 14 0
      spine-unity/Assets/spine-unity/SkeletonExtensions.cs

+ 14 - 0
spine-unity/Assets/spine-unity/SkeletonExtensions.cs

@@ -39,6 +39,20 @@ using Spine;
 
 public static class SkeletonExtensions {
 
+	public static void SetColor (this Skeleton skeleton, Color color) {
+		skeleton.A = color.a;
+		skeleton.R = color.r;
+		skeleton.G = color.g;
+		skeleton.B = color.b;
+	}
+	
+	public static void SetColor (this Skeleton skeleton, Color32 color) {
+		skeleton.A = color.a / 255f;
+		skeleton.R = color.r / 255f;
+		skeleton.G = color.g / 255f;
+		skeleton.B = color.b / 255f;
+	}
+
 	public static void SetColor (this Slot slot, Color color) {
 		slot.A = color.a;
 		slot.R = color.r;