- Изменено
Change color over time at runtime
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
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.
Thank you I appreciate it!
Glad to help.