Hi everyone !
I work on a script and I don’t understand why my button work like that
This is my code :
Public Button M4A1;
Button btnM4A1.GetComponent();
btnM4A1.onClick.AddListener(delegate {
Debug.Log(“M4A1”);
indexSlider = 0;
BtnOnClick(indexSlider);
});
So when I press the button for the first time the log write : M4A1 but when I press the butten twice the Debug.Log says : M4A1 three times and when I hit the button 3 times the Debug.Log writes me M4A1 FIVE Times
And I don’t know how to resolve this fuc***** problem
Any ideas ?
thx