So basically I want to change the submit and cancel button by script.
But I can’t seem to get those variables out of this component.
Is this even possible? Or do I have to make an input module my self? How do I do that?
Thanks for reading!
So basically I want to change the submit and cancel button by script.
But I can’t seem to get those variables out of this component.
Is this even possible? Or do I have to make an input module my self? How do I do that?
Thanks for reading!
so I was able to fix it myself with a small workaround.
I made a small script that I put on every button:
Button = button;
bool selected;
void start()
{
button = GetComponent();
}
void Update()
{
if (Input.GetKeyDown(“Action”) && selected)
{
button.onClick.Invoke();
}
}
public void OnSelect(BaseEventData eventData)
{
selected = true;
}
public void OnDeselect((BaseEventData eventData)
{
selected = false;
}