Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class GuiManager : MonoBehaviour {
- //Manager
- public MysqlManager _MysqlManager;
- public bool _GuiIsOn;
- public string _NameOfMenu;
- public string _IpFUsernameLogin;
- public string _IpFPasswordLogin;
- public string _IpFUsernameRegister;
- public string _IpFPasswordRegister;
- public string _IpFCPasswordRegister;
- public string _IpFMailRegister;
- private int buttonWidth;
- private int buttonHeight;
- private int ipFWidth;
- private int ipFHeight;
- void Awake(){
- buttonWidth = 150;
- buttonHeight = 80;
- ipFWidth = 200;
- ipFHeight = 40;
- _GuiIsOn = true;
- _NameOfMenu = "Main Menu";
- }
- void OnGUI(){
- if (_GuiIsOn == true) {
- GUI.Box (new Rect (Screen.width / 2 - 300, Screen.height / 2 -300, 600, 600), _NameOfMenu);
- if (_NameOfMenu == "Main Menu") {
- if (GUI.Button (new Rect (Screen.width / 2 - 150, Screen.height / 2, buttonWidth, buttonHeight), "Login")) {
- _NameOfMenu = "Login Menu";
- }
- if (GUI.Button (new Rect (Screen.width / 2 + 50, Screen.height / 2, buttonWidth, buttonHeight), "Register")) {
- _NameOfMenu = "Register Menu";
- }
- }
- if (_NameOfMenu == "Login Menu") {
- GUI.Label (new Rect (Screen.width /2 -100, Screen.height / 2 - 200, 100, 20), "Username : ");
- _IpFUsernameLogin = GUI.TextArea (new Rect (Screen.width/ 2 , Screen.height/2 - 200, 200, 20), _IpFUsernameLogin, 25);
- GUI.Label (new Rect (Screen.width /2 -100, Screen.height / 2 - 170, 100, 20), "Password : ");
- _IpFPasswordLogin = GUI.TextArea (new Rect (Screen.width/ 2 , Screen.height/2 - 170, 200, 20), _IpFPasswordLogin, 25);
- if (GUI.Button (new Rect (Screen.width / 2 - 150, Screen.height / 2, buttonWidth, buttonHeight), "Login")) {
- }
- if (GUI.Button (new Rect (Screen.width / 2 + 50, Screen.height / 2, buttonWidth, buttonHeight), "Back Main Menu")) {
- _NameOfMenu = "Main Menu";
- }
- }
- if (_NameOfMenu == "Register Menu") {
- GUI.Label (new Rect (Screen.width /2 -100, Screen.height / 2 - 200, 100, 20), "Username : ");
- _IpFUsernameRegister = GUI.TextArea (new Rect (Screen.width/ 2 , Screen.height/2 - 200, 200, 20), _IpFUsernameRegister, 25);
- GUI.Label (new Rect (Screen.width /2 -100, Screen.height / 2 - 170, 100, 20), "Password : ");
- _IpFPasswordRegister = GUI.TextArea (new Rect (Screen.width/ 2 , Screen.height/2 - 170, 200, 20), _IpFPasswordRegister, 25);
- GUI.Label (new Rect (Screen.width /2 -100, Screen.height / 2 - 140, 100, 20), "Confirme Password : ");
- _IpFCPasswordRegister = GUI.TextArea (new Rect (Screen.width/ 2 , Screen.height/2 - 140, 200, 20), _IpFCPasswordRegister, 25);
- GUI.Label (new Rect (Screen.width /2 -100, Screen.height / 2 - 110, 100, 20), "E-Mail : ");
- _IpFMailRegister = GUI.TextArea (new Rect (Screen.width/ 2 , Screen.height/2 - 110, 200, 20), _IpFMailRegister, 25);
- if (GUI.Button (new Rect (Screen.width / 2 - 150, Screen.height / 2, buttonWidth, buttonHeight), "Creat account")) {
- _MysqlManager._AccountCreat (_IpFUsernameRegister, _IpFPasswordRegister, _IpFMailRegister);
- }
- if (GUI.Button (new Rect (Screen.width / 2 + 50, Screen.height / 2, buttonWidth, buttonHeight), "Back Main Menu")) {
- _NameOfMenu = "Main Menu";
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment