示例#1
0
 void Awake()
 {
     if (clavierGameObj != null)
     {
         clavier = clavierGameObj.GetComponent<ClavierHandler>();
     }
     myButton = GetComponent<Button>(); // <-- you get access to the button component here
     myButton.onClick.AddListener(ChangeClavier);  // <-- you assign a method to the button OnClick event here
 }
示例#2
0
 void Awake()
 {
     if (clavierGameObj != null)
     {
         clavier = clavierGameObj.GetComponent <ClavierHandler>();
     }
     myButton = GetComponent <Button>();          // <-- you get access to the button component here
     myButton.onClick.AddListener(ChangeClavier); // <-- you assign a method to the button OnClick event here
 }