Script To Use Button OnClick Function

i Need a Script That can Handle OnClick function of button when game starts The script add a game Object in which a script is attached the game assign that object to button OnClick section and Select the functionality of nextScene and previous scene

previousButton.GetComponent<Button>().onClick.AddListener(PreviousScene);
nextButton.GetComponent<Button>().onClick.AddListener(NextScene);

1 Answer

1

In unity, there is session and onload - don’t destroy gameobject to transform needed data. please consider.
yukiamano221@gmail.com