Hello,
I Need change value in an variable and access this in the new Scene Load. I try access the variable, or the method, but anyway don’t work.
I need change and get the musicChoose value in other Class/Scene.
//Song Menu
public class SongMenu : MonoBehaviour {
public Canvas songButton;
public int musicChoose = 1;
voidStart ()
{
songButton = songButton.GetComponent ();
}
void SongButton()
{
musicChoose = 3;
Application.LoadLevel (2);
}
public int GetMusic()
{
return musicChoose;
}
//GamePlay Class/Scene
public class Gameplay : MonoBehaviour
{
private SongMenu MusicChoose;
public int Music;
void Start()
{
MusicChoose = GetComponent ();
Music = MusicChoose.GetMusic ();
//MusicIndex = GetComponent().musicChoose; //Fail
//Music = MusicIndex; // Fail
NowPlaying (Music); // int method
}