LoginScreen
A class in Root.Township, the global namespace.
Client desktop login screen: username and password fields, remember me toggle and error text, shown when the app starts without a login.
- Listed in Global namespace: I to L
- Inherits or implements
MonoBehaviour
Constructors
| Member | What it is |
|---|---|
LoginScreen() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
10 private and internal fields
| Member | What it is |
|---|---|
private GameObject allLoginUI | Parent of the login fields, hidden while logging in. |
private GameObject attemptLoginText | Object shown while a login is in progress. |
private Text errorText | Text showing the last login error. |
private Text loadingGameText | Text shown until the app has started. |
private static Logger logger | NLog logger for this class. |
private GameObject loginCanvas | The whole login canvas. |
private ILoginPreferences loginPreferences | Injected login settings. |
private InputField passwordInput | Password field. |
private Toggle rememberMeToggle | Remember me toggle. |
private InputField usernameInput | Username or email field. |
Methods
| Member | What it is |
|---|---|
async void LoginAsync() | Logs in with the entered name or email and hashed password, shows API errors, then passes success to LoginManager. |
void OpenForgotPasswordLink() | Opens the Township Tale reset password page. |
protected void Inject(ILoginPreferences loginPreferences) | Receives the login preferences. |
8 private and internal methods
| Member | What it is |
|---|---|
private void ApplicationStarted() | Hides the loading text and shows the login canvas if not logged in. |
private void DisableCanvas() | Hides the login canvas. |
private void EnableCanvas() | Shows the login canvas. |
private void LoggedIn() | Hides the canvas and clears the error text. |
private void LoggedOut() | Shows the login canvas again. |
private void ShowAttemptingLoginText(bool isShowing) | Swaps the login fields for the attempting login text, or back. |
private void Start() | Hides the canvas and hooks the toggle and LoginManager events. |
private void UpdateRememberMe(bool value) | Saves the remember me choice. |