i am making a app for me and my group where we share our files and we need some help with our login scrip there is one MAIN account and it disappears when you put it in the right code but if someone could help me and sort of edit the script so it could have multiple accounts without a server and so it would load a different lvl
Thx!
-Looped Gaming Team
C# scrip
var btnColorOn : Color = Color(1.0f, 1.0f, 1.0f, 1.0f);
var btnColorOff : Color = Color(0.4f, 0.4f, 0.4f, 1.0f);
private var btnColor = btnColorOff;
private var username : String = String.Empty;
private var password : String = String.Empty;
private var correctLogin : boolean;
function Update()
{
correctLogin = (username == "LG" && password == "1234");
var speed = Time.deltaTime * 4;
var targetColor = correctLogin ? btnColorOn : btnColorOff;
btnColor.r = Mathf.MoveTowards(btnColor.r, targetColor.r, speed);
btnColor.g = Mathf.MoveTowards(btnColor.g, targetColor.g, speed);
btnColor.b = Mathf.MoveTowards(btnColor.b, targetColor.b, speed);
btnColor.a = Mathf.MoveTowards(btnColor.a, targetColor.a, speed);
}
function OnGUI()
{
var windowRect : Rect;
windowRect.x = Screen.width / 2 - 100;
windowRect.y = Screen.height / 2 - 50;
windowRect.width = 200;
windowRect.height = 100;
GUI.Window(0, windowRect, OnWindowGUI, "Authentication");
}
function OnWindowGUI()
{
username = GUILayout.TextField(username);
password = GUILayout.PasswordField(password, '*'[0]);
GUI.color = btnColor;
if (GUILayout.Button("Login") && correctLogin)
{
// Add your login code here...
enabled = false;
}
GUI.color = Color.white;
}