0

for the first time I'm working with Unity. In the canvas I have two buttons. The next en previous button.

How to handle those buttons, one button is only working?

public class SceneManager : MonoBehaviour {

public Button mNextButton;
public Button mPrevButton;
public GameObject stap1;
public GameObject stap2;

void Start()
 {
    mNextButton.onClick.AddListener(TaskOnClick);
    mPrevButton.onClick.AddListener(TaskOnClick);
 }

void TaskOnClick()
 {
    //Next button
    stap1.SetActive(false);
    stap2.SetActive(true);

    //Previous button
    stap1.SetActive(true);
    stap2.SetActive(false);
 }
}
Cœur
  • 37,241
  • 25
  • 195
  • 267
Haast
  • 19
  • 7

0 Answers0