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
У вас нет необходимых прав для просмотра вложений в этом сообщении.
aaayejaaaye
  • Сообщения: 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.
Аватара пользователя
Harald

Harri
  • Сообщения: 4107

aaayejaaaye

Thank you I appreciate it!
aaayejaaaye
  • Сообщения: 2

Harald

Glad to help. :)
Аватара пользователя
Harald

Harri
  • Сообщения: 4107


Вернуться в Unity