#pragma strict Var s:string;
var username:string;
var pw:string;
var pw2:string;
var info:string;
var Success:boolean;
var Skin:guiskin;
var Logostyle:guistyle;
var Describtionstyle:guistyle;
var obj:gameobject[];
var Login:boolean;
function getting (extension:string) {var url:string = "http://www.yourlink.org/" + extension;
var www:www = new www (URL);
Yield www;
s = www.text;
function Write (uname:string, pw:string, pw2:string) {if (pw = = pw2) { if (uname. Contains ("^") | | Uname. Contains ("°") | | Uname. Contains ("'") | | Uname. Contains ("§") | | Uname. Contains ("$") | | Uname. Contains ("%") | | Uname. Contains ("&") | | Uname. Contains ("/") | | Uname. Contains ("=") | | Uname. Contains ("?") | | Uname. Contains ("*") | | Uname. Contains ("~") | | Uname.
Contains ("@")) {s = "Username isn ' t formal right"; }else{if (uname. Length > 6) {if (PW). Length > 6 {var www:www = new www ("http://www.yourlinkorg/write_new.php?username=" +username+ "
;p w= "+PW);
Yield www;
s = www.text;
}else s= "Password is too Short (min. 7 Chars)";
}else s= "Username is too Short (min. 7 Chars)";
}}else{s = "Passwords do not match";
}} function Ongui () {
Gui.skin = skin; Username = GUI. TextField (Rect (obj[2].transform.position.x, OBJ[2].TRANSFORM.POSITION.Y, 348, username, 25); PW = GUI.
Passwordfield (obj[4].transform.position.x, OBJ[4].TRANSFORM.POSITION.Y, 348, Rect), PW, "*" [0], 25); PW2 = GUI.
Passwordfield (obj[6].transform.position.x, OBJ[6].TRANSFORM.POSITION.Y, 348, Rect), PW2, "*" [0], 25); Gui. Label (Rect (obj[0].transform.position.x, Obj[0].transform.position.y,screen.width, Screen.width), "Loginnation",
Logostyle); Gui. Label (Rect (obj[1].transform.position.x, OBJ[1].TRANSFORM.POSITION.Y, Screen.width, Screen.width), "Username:",
Describtionstyle); Gui. Label (Rect (obj[3].transform.position.x, OBJ[3].TRANSFORM.POSITION.Y, Screen.width, Screen.width), "Password:",
Describtionstyle); Gui. Label (Rect (obj[7].transform.position.x, OBJ[7].TRANSFORM.POSITION.Y, Screen.width, screen.width), Repeat password:
", Describtionstyle);
if (GUI.
Button (Rect (obj[5].transform.position.x, OBJ[5].TRANSFORM.POSITION.Y, 166,) ("Enter")) {if (login) {
Getting ("Process.php?username=" +username+ "&passwort=" +pw+ "&info=success");
Username = "";
PW = "";
PW2 = "";
}else{Write (username, pw, pw2); } if (GUI.
Button (Rect (obj[9].transform.position.x, OBJ[9].TRANSFORM.POSITION.Y, 166,), "New") {login = false; } if (GUI. Button (Rect (obj[10].transform.position.x, OBJ[10].TRANSFORM.POSITION.Y, 166, "login")) {login = True
; } if (S!= "true") {GUI. Label (Rect (obj[8].transform.position.x, OBJ[8].TRANSFORM.POSITION.Y, Screen.width, Screen.width), S,
Describtionstyle);
}else{GUI. Label (Rect (obj[8].transform.position.x, OBJ[8].TRANSFORM.POSITION.Y, Screen.width, Screen.width), "Successfully
Logged in ", Describtionstyle); } function Update () {if (s = = "true") {success =
True
} if (success) {playerprefs.setstring ("username", username);
Playerprefs.setstring ("Passwort", PW);
Application.loadlevel ("MainPage");
}else{Playerprefs.deletekey ("username");
Playerprefs.deletekey ("Passwort"); } if (login) {Itween.moveto (obj[5], Itween.hash ("x", Screen.width/2 +, "y", screen . HEIGHT/2 + 100)); Button Itween.moveto (obj[6], Itween.hash ("Y", 600)); pw2f Itween.moveto (obJ[7], Itween.hash ("x", Screen.width +));//pw2d Itween.moveto (Obj[8), Itween.hash ("x", Screen.width/
2 165, "Y", SCREEN.HEIGHT/2 + 173)); Itween.moveto (Obj[9], Itween.hash ("x", SCREEN.WIDTH/2 165, "Y", SCREEN.HEIGHT/2 + 100)); Registrier Button Itween.moveto (obj[10], Itween.hash ("x", SCREEN.WIDTH/2 165, "Y", Screen.height + 100)); Login Button}else{Itween.moveto (obj[5], Itween.hash ("x", Screen.width/2 +, "y ", SCREEN.HEIGHT/2 + 187));
Button Itween.moveto (obj[6], Itween.hash ("x", SCREEN.WIDTH/2 165, "Y", SCREEN.HEIGHT/2 + 131));
Itween.moveto (Obj[7], Itween.hash ("x", SCREEN.WIDTH/2 165, "Y", SCREEN.HEIGHT/2 + 109));
Itween.moveto (Obj[8], Itween.hash ("x", SCREEN.WIDTH/2 245, "Y", SCREEN.HEIGHT/2 + 240)); Itween.moveto (Obj[9], Itween.hash ("X", "n", "Y", SCREEN.HEIGHT/2 + 100)); RegiStrier Button Itween.moveto (obj[10], Itween.hash ("x", SCREEN.WIDTH/2 165, "Y", SCREEN.HEIGHT/2 + 18 7));
Login Button}} function Start () {
obj = new GAMEOBJECT[11]; Obj[0] = new Gameobject ();
LOGO obj[0].transform.position.x = SCREEN.WIDTH/2 165;
OBJ[0].TRANSFORM.POSITION.Y = SCREEN.HEIGHT/2 198; OBJ[1] = new Gameobject ();
Username describtion obj[1].transform.position.x = SCREEN.WIDTH/2 165;
OBJ[1].TRANSFORM.POSITION.Y = SCREEN.HEIGHT/2 96; OBJ[2] = new Gameobject ();
Username Text_field obj[2].transform.position.x = SCREEN.WIDTH/2 165;
OBJ[2].TRANSFORM.POSITION.Y = SCREEN.HEIGHT/2 77; OBJ[3] = new Gameobject ();
Password describtion
obj[3].transform.position.x = SCREEN.WIDTH/2 165;
OBJ[3].TRANSFORM.POSITION.Y = SCREEN.HEIGHT/2 + 5; See this column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/programming/extra/obj[4] = new Gameobject ();
password field obj[4].transform.position.x = SCREEN.WIDTH/2 165;
OBJ[4].TRANSFORM.POSITION.Y = Screen.height/2 + 26; OBJ[5] = new Gameobject ();
Login button obj[5].transform.position.x = SCREEN.WIDTH/2 165;
OBJ[5].TRANSFORM.POSITION.Y = SCREEN.HEIGHT/2 + 100; OBJ[6] = new Gameobject ();
Password 2 field obj[6].transform.position.x = SCREEN.WIDTH/2 165;
OBJ[6].TRANSFORM.POSITION.Y = 600; OBJ[7] = new Gameobject ();
Password 2 text obj[7].transform.position.x = Screen.width + 20; OBJ[7].TRANSFORM.POSITION.Y = SCREEN.HEIGHT/2 + 109; OBJ[8] = new Gameobject ();
Info text obj[8].transform.position.x = SCREEN.WIDTH/2 165;
OBJ[8].TRANSFORM.POSITION.Y = SCREEN.HEIGHT/2 + 173; OBJ[9] = new Gameobject ();
Registrier button obj[9].transform.position.x = Screen.width/2 + 10;
OBJ[9].TRANSFORM.POSITION.Y = SCREEN.HEIGHT/2 + 100; OBJ[10] = new Gameobject ();
Login Button obj[10].transform.position.x = screen.width/2 + 10;
OBJ[10].TRANSFORM.POSITION.Y = SCREEN.HEIGHT/2 + 100;
The PHP script called connect.php (in the The file "mysql_inc_32"): PHP Code: 01.<?php 02.function Connection () {$verbindung = mysql_connect ("localhost", "Userna
Me "," Andpassword ") 04.or die (" couldn ' t connect "); $con = mysql_select_db ("Your_databAse_name ") or Die (" wrong databse ");
07.return $con;
08.09.} 10.?> so now the script called Process.php:PHP code:01.<?ph
P 02.include ("mysql_inc_32/connect.php");
$con = connection (); $s _1 = "select * from USERTB WHERE username = '". $_get[' username ']. "' and Passwort = '". MD5 ($_get[' Passwort ')).
"'";
$sql = mysql_query ($s _1); 08.if (mysql_num_rows ($sql) > 0) {09. while ($ds = Mysql_fetch_object ($sql)) {10.
$img = $ds > img;
$birth = $ds > birthday;
$sex = $ds > sex;
$genre = $ds > genre; 14.} 15.
if ($_get[' info '] = = "img") {16.
Echo ($IMG); 18.19. }else if ($_get[' info '] = = "Birth") {20.
Echo ($birth); 22.23.
}else if ($_get[' info '] = = "Sex") {24.
Echo ($sex); 26.27.
}else if ($_get[' info '] = = "Genre") {28.
Echo ($genre); 30.31. }else{32.
Echo ("true"); 33.} 34.}
else{35.echo ("Passwort or username is wrong"); 36.} 37.? > Copy Code the script called write_new.php php code:01.<?php 02.include ("mysql_inc_32/c
Onnect.php ");
//unity3dhttp://www.unitymanual.com $con = connection (); 05.if (isset ($_get[' username ')) and isset ($_get[' PW '])) {$s _1 = "select * from USERTB WHERE username = '". $_get[' username '].
"'";
$sql = mysql_query ($s _1); 08.if (mysql_num_rows ($sql) > 0) {09. Echo ("username sChon Vergeben "); 10.}else{$s _2 = INSERT into USERTB (username, passwort) VALUES (' ". $_get[' username ']. "', '" . MD5 ($_get[' PW ')).
"')";
$sql _2 = mysql_query ($s _2);
13.if ($sql _2 = = True) {14.echo ("successfully registered");
15.}else{16.echo ("Error while registrating");
17.} 18.}
19.}else{Echo ("Username and/or Password Empty");} 20.?>
Author: csdn Blog Unity3d Learner