.


:




:

































 

 

 

 





Unity3D, , (), . , C#, . PHP , WWW. , Unity3D WWWForm [1].

, 7. POST , form , :

WWWForm form = new WWWForm ();

form.AddField ("login", _login);

form.AddField ("password", _password);

WWW www = new WWW (ConnectScriptsPath, form);

yield return www;

ConnectScriptsPath login.php . POST , :

$login = $_POST["login"];

$password = $_POST["password"];

$res = $mysqli->query("SELECT COUNT(*) FROM `users` WHERE `login` = '$login' AND `password` = '$password'");

echo $res->fetch_array()['COUNT(*)'];

C# Unity3D, , , .

7

 

. , . , . getRight.php , admins:

$admins = $mysqli->query("SELECT `admins` FROM `users` WHERE `login` = '$user'")-> fetch_array()['admins'];

8

 

, , . . , set.php. :

copy($_FILES['uploadfile']['tmp_name'], $uploadfile)

:

$res = $mysqli->query("INSERT INTO `EnterCars` (`images`, `Date`, `user`) VALUES ('$uploadfile', '$dateTime', '$user')");

, :

$numberCar = Exec($path);

$result = $mysqli->query("UPDATE `EnterCars` SET `numberCar`='$numberCar' WHERE `Date`='$dateTime'");

, , , :

$enterCar = $mysqli->query("SELECT COUNT(*) FROM `HaveAccess` WHERE `numberCar` = '$numberCar'");

if ($enterCar->fetch_array()['COUNT(*)'] == 1)

{

$mysqli->query("UPDATE `EnterCars` SET `Status`=' ' WHERE `Date`='$dateTime'"); $get = "1";

}

else

{

$mysqli->query("UPDATE `EnterCars` SET `Status`=' ' WHERE `Date`='$dateTime'"); $get = "2"; }

PHP C# [9].

9

 

, Unity3D . : 1 , 2 , 3 , , 100 .

10

, , , . :

, , , , ;

public void onClickClosePanelError()

{

PanelError.SetActive (false);

}

, ;

, , . , , , , , .

;

. , , , , , .

$user = $_POST["user"];

$dateTime = $_POST["dateTime"];

$add = $_POST["AddOrNot"];

$get = "";

if($add == 1) {

if($numberCar = $mysqli->query("SELECT `numberCar` FROM `EnterCars` WHERE `Date` = '$dateTime'")->fetch_array()['numberCar'])

if($mysqli->query("INSERT INTO `HaveAccess` (`numberCar`, `user`) VALUES ('$numberCar', '$user')")) $get = "1";

echo $get; }

$mysqli->query("UPDATE `EnterCars` SET `Status`=' ' WHERE `Date`='$dateTime'");

11

 

, . , ().

, UnityEngine.SceneManagement, . , , .

private void onClickOpenTableEnterCars()

{

SceneManager.LoadScene ("TableEnterCars");

}

, SceneManager.LoadScene ("TableEnterCars") , TableEnterCars.

12

 

. . , , , .

, , .

, .

WWW www = new WWW (ScriptPathView);

yield return www;

ScriptPathView EnterCarTableView.php, .

$result = $mysqli->query("SELECT * FROM `EnterCars`");

while($row = $result->fetch_assoc())

{

$rows[] = $row;

}

echo json_encode($rows, JSON_UNESCAPED_UNICODE);

EnterCars, . , JSONobject:

json_encode($rows, JSON_UNESCAPED_UNICODE);

Unity3D JSONobject. .. , JSON_UNESCAPED_UNICODE. Unicode ( \uXXXX).

Unity3D JSON , . JSONObject :

var js = new JSONObject (www.text);

, , , :

if (js.IsNull)

{

TextPanelMessage.text = " ";

PanelMessage.SetActive (true);

}

, JSON (js.list). , (item.ToDictionary ();) .

Unity3D, , :

TextRowsPrefab [0].text = data ["id"].

, , . buttonURL .

foreach (var item in js.list) {

var data = item.ToDictionary ();

GameObject Row = (GameObject)Instantiate (RowsPrefab, Table);

buttonURL = Row.gameObject.GetComponentInChildren<ButtonURL> ();

TextRowsPrefab = Row.gameObject.GetComponentsInChildren<Text> ();

TextRowsPrefab [0].text = data ["id"];

TextRowsPrefab [1].text = data ["numberCar"];

TextRowsPrefab [2].text = data ["Date"];

TextRowsPrefab [3].text = data ["Status"];

TextRowsPrefab [4].text = data ["user"];

buttonURL.Path = PathServer + data ["images"];

buttonURL.img = img;

buttonURL.PanelImageView = PanelImageView;

buttonURL.PanelMessage = PanelMessage;

}

, Unity3D.

, , , . PHP , - [2].

13

14 ,

15


. , .

, . Tesseract OCR. . , , , . , , , , . , , .






:


: 2017-04-15; !; : 601 |


:

:

.
==> ...

1450 - | 1428 -


© 2015-2024 lektsii.org - -

: 0.022 .