Skip to content

Commit

Permalink
Added new event for getting JSON on submit.
Browse files Browse the repository at this point in the history
  • Loading branch information
neogeek committed Jan 9, 2021
1 parent 3218e98 commit 218bc44
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Assets/Plugins/CandyCoded.Forms/Scripts/Form.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ namespace CandyCoded.Forms
public class Form : MonoBehaviour
{

public SubmitEvent FormSubmitted;
public SubmitEventObject FormSubmittedObject;

public SubmitEventJSON FormSubmittedJSON;

public Button submitButton;

Expand Down Expand Up @@ -81,7 +83,9 @@ private void HandleTabPress(Selectable selectable, Selectable[] allSelectable)
private void HandleReturnPress()
{

FormSubmitted?.Invoke(GetFormRawValues());
FormSubmittedObject?.Invoke(GetFormRawValues());

FormSubmittedJSON?.Invoke(ToJSON());

}

Expand Down Expand Up @@ -241,7 +245,13 @@ private void OnDisable()
}

[Serializable]
public class SubmitEvent : UnityEvent<Dictionary<string, object>>
public class SubmitEventObject : UnityEvent<Dictionary<string, object>>
{

}

[Serializable]
public class SubmitEventJSON : UnityEvent<string>
{

}
Expand Down

0 comments on commit 218bc44

Please sign in to comment.