I want to make a button onclick to fade out the music and call the media player to stop?
I want this to be over 5 sec
I have tried to make a timer like code, but i dont get how to make it work - can you guys help me?
float volume = 1;
float speed = 0.05f;
public void FadeOut(float deltaTime);
{
mpMain.setVolume(1, 1);
volume -= speed* deltaTime; }
public void FadeIn(float deltaTime1);
{
mpMain.setVolume(0, 0);
volume += speed* deltaTime1; }
}}