using System; using System.Net.Mail; using UnityEngine; using UnityEngine.Assertions; using UnityEngine.UIElements; /// /// class to handle the account view ui /// public class AccountUI : MonoBehaviour { /// /// state of the account view /// private enum State { UnassociatedState, // (start) NotSignedIn, // initial AfterContinue, // after SignedIn // post } /// /// current state of the account view /// [SerializeField] private State state = State.UnassociatedState; /// /// account view header text /// private Label _header; /// /// username text field /// private TextField _usernameField; /// /// email text field /// private TextField _emailField; /// /// password text field /// private TextField _passwordField; /// /// button to update the username /// private Button _usernameUpdateButton; /// /// button to update the email /// private Button _emailUpdateButton; /// /// button to update the password /// private Button _passwordUpdateButton; /// /// accompanying text for the account input fields, used when an error/notice is needed /// private Label _accompanyingText; /// /// either 'continue', 'log in', or 'sign out' button /// (in order of 'initial', 'after', and 'post' states) /// private Button _primaryActionButton; /// /// either 'forgot password' or 'create an account' /// (in order of 'initial' and 'after' states, is hidden in 'post' state) /// private Button _secondaryActionButton; /// /// function to subscribe button events to their respective functions /// public void OnEnable() { var ui = GetComponent().rootVisualElement; _header = ui.Q