Skip to content

Commit

Permalink
Add listener to submit button if available.
Browse files Browse the repository at this point in the history
  • Loading branch information
neogeek committed Jul 12, 2020
1 parent 43a562c commit 12fc625
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Scripts/Form.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ public class Form : MonoBehaviour

public SubmitEvent FormSubmitted;

[SerializeField]
public Button _submitButton;

private EventSystem _eventSystem;

private Form _parentForm;
Expand All @@ -29,6 +32,13 @@ private void Awake()

_parentForm = gameObject.GetComponentsInParent<Form>().FirstOrDefault(form => !form.Equals(this));

if (_submitButton)
{

_submitButton.onClick.AddListener(HandleReturnPress);

}

}

private void Update()
Expand Down

0 comments on commit 12fc625

Please sign in to comment.