Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.SceneManagement;
- using UnityEngine.UI;
- public class LoginHandler : MonoBehaviour {
- public void Login() {
- InputField Username = GameObject.FindWithTag("Login_username").GetComponent<InputField>();
- InputField Password = GameObject.FindWithTag("Login_password").GetComponent<InputField>();
- Text LoginInfo = GameObject.FindWithTag("Login_info").GetComponent<Text>();
- if(User.Login(Username.text, Password.text)) {
- LoginInfo.enabled = true;
- LoginInfo.color = Color.green;
- LoginInfo.text = "Uspješan login! Učitavanje...";
- SceneManager.LoadScene("glavna");
- } else {
- // NEKI ERROR
- LoginInfo.enabled = true;
- LoginInfo.color = Color.red;
- LoginInfo.text = "Greška: Pogrešan username/password";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement