Press the button play music in the next scene.
Hi. I want to make the following mechanism to for ios.
1.Title There are two taps selectable buttons to the scene.(example A and B button) 2.Press any button to transition to next scene. 3.Play music in the transition scene. Music A When you press the A button, the music B When you press the B button flowing.
I was just able to play music in the scene. However, I do not know what should make doing what the above mechanism in C#.
I have a low coding ability. I want to know in detail. Thank you for reading!!
Answer by JigneshKoradiya · Apr 08, 2016 at 09:44 AM
take one static integer in first scene in one script and when click on button A make that integer 1 when click on B make that integer 2 and on both button you have to load next scene with Scenemanager.LoadScene(1);
than in next scene youhave to check this in start
if(integeryoudefine==1) { audiosource.clip = audioclip1; audiosource.play(); } else if(integeryoudefine==2) { audiosource.clip = audioclip2; audiosource.play(); }
same thing for other clips
Problem thanks to you has been resolved! thank you very much!!