using System; using System.Net.Mail; using UnityEngine; using UnityEngine.Assertions; using UnityEngine.UIElements; using Button = UnityEngine.UIElements.Button; /// /// class to handle the account view ui /// public class AccountUI : MonoBehaviour { /// /// current state of the account view /// [SerializeField] private State state = State.UnassociatedState; /// /// default text colour /// private readonly Color _defaultInputFieldValueTextColour = new(5.88f, 5.1f, 10.59f); /// /// error text colour /// private readonly Color _errorInputFieldValueTextColour = new(1f, 50.59f, 50.2f); /// /// accompanying text for the account input fields, used when an error/notice is needed /// private Label _accompanyingText; /// /// email text field /// private TextField _emailField; /// /// button to update the email /// private Button _emailUpdateButton; /// /// account view header text /// private Label _header; /// /// password text field /// private TextField _passwordField; /// /// button to update the password /// private Button _passwordUpdateButton; /// /// 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; /// /// username text field /// private TextField _usernameField; /// /// button to update the username /// private Button _usernameUpdateButton; /// /// function called when the object is enabled, /// subscribes button events to their respective functions /// private void OnEnable() { var ui = GetComponent().rootVisualElement; _header = ui.Q