aaayejaaaye

Screenshot 2022-06-15 092838.png
Hello,
I am trying to find a way to fade the color/alpha of a slot over time. is there a built-in method in the runtime API for unity to do this? Currently, I am using the solution posted in the photo which achieves the result I want for the alpha. But the ultimate goal is to be able to do this with the color of a particular slot
var slot = skeletonAnimation.skeleton.FindSlot(slotName);
Color randomColor = Random.ColorHSV(0f, 1f, 0f, 1f, 1f, 1f, 1f, 1f);
slot.SetColor(randomColor);
This also works in changing the color but I want it to fade into the random color over about a 2 second time period.
Is there a method to control the time within the spine API?

Thank you in advance
Non hai i permessi necessari per visualizzare i file allegati in questo messaggio.
aaayejaaaye
  • Messaggi: 2

Harald

The spine-unity runtime does not provide any methods that provide such color transition over time. Please use normal Unity means to interpolate two values over time and assign the interpolated value.
Avatar utente
Harald

Harri
  • Messaggi: 4104

aaayejaaaye

Thank you I appreciate it!
aaayejaaaye
  • Messaggi: 2

Harald

Glad to help. :)
Avatar utente
Harald

Harri
  • Messaggi: 4104


Torna a Unity