Exemplo n.º 1
0
    void OnGUI()
    {
        GUI.skin = skin;

        GUI.DrawTexture(UtilResize.ResizeGUI(new Rect(0, 0, 320, 480)), backgroundImg);

        GUI.enabled = (statusMsg == "");

        //Text area control
        GUI.Label(UtilResize.ResizeGUI(new Rect(80, 10, 220, 20)), "Console Log:", "LabelBold");
        GUI.Box(UtilResize.ResizeGUI(new Rect(80, 30, 220, 380)), console);

        //Server Push
        if (GUI.Button(UtilResize.ResizeGUI(new Rect(80, 420, 220, 50)), "Generate Push With Server Code"))
        {
            generatePushWithServerCode();
        }

        if (errorMsg != "")
        {
            GUI.Box(new Rect((Screen.width - (UtilResize.resMultiplier() * 260)), (Screen.height - (UtilResize.resMultiplier() * 50)), (UtilResize.resMultiplier() * 260), (UtilResize.resMultiplier() * 50)), errorMsg);
            if (GUI.Button(new Rect(Screen.width - 20, Screen.height - UtilResize.resMultiplier() * 45, 16, 16), "x", "ButtonSmall"))
            {
                errorMsg = "";
            }
        }

        GUI.enabled = true;
        if (statusMsg != "")
        {
            GUI.Box(UtilResize.ResizeGUI(new Rect(80, 240 - 40, 220, 40)), statusMsg);
        }
    }
Exemplo n.º 2
0
    void OnGUI()
    {
        GUI.skin = skin;

        GUI.DrawTexture(UtilResize.ResizeGUI(new Rect(0, 0, 320, 480)), backgroundImg);

        GUI.enabled = (statusMsg == "");
        //Login Controls
        GUI.Label(UtilResize.ResizeGUI(new Rect(80, 10, 220, 20)), "eMail", "LabelBold");
        email = GUI.TextField(UtilResize.ResizeGUI(new Rect(80, 30, 220, 40)), email, 100);

        GUI.Label(UtilResize.ResizeGUI(new Rect(80, 75, 220, 20)), "Password", "LabelBold");
        password = GUI.PasswordField(UtilResize.ResizeGUI(new Rect(80, 100, 220, 40)), password, '*');


        if (GUI.Button(UtilResize.ResizeGUI(new Rect(80, 150, 220, 50)), "Login"))
        {
            GamedoniaUsers.LoginUserWithEmail(email.ToLower(), password, OnLogin);
        }

        GUIStyle fbButton = GUI.skin.GetStyle("ButtonFacebook");

        if (GUI.Button(UtilResize.ResizeGUI(new Rect(80, 205, 220, 50)), "Facebook", fbButton))
        {
            statusMsg = "Initiating Facebook session...";
            FacebookBinding.OpenSessionWithReadPermissions(READ_PERMISSIONS, OnFacebookOpenSession);
        }

        GUIStyle separator = GUI.skin.GetStyle("separator");

        GUI.Box(UtilResize.ResizeGUI(new Rect(80, 277, 220, 1)), "", separator);

        //Sign Up
        if (GUI.Button(UtilResize.ResizeGUI(new Rect(80, 300, 220, 50)), "Sign Up"))
        {
            //print ("you clicked the text button");
            Application.LoadLevel("CreateAccountScene");
        }

        //Password Recovery
        if (GUI.Button(UtilResize.ResizeGUI(new Rect(80, 355, 220, 50)), "Remember Password"))
        {
            Application.LoadLevel("ResetPasswordScene");
        }

        if (errorMsg != "")
        {
            GUI.Box(new Rect((Screen.width - (UtilResize.resMultiplier() * 260)), (Screen.height - (UtilResize.resMultiplier() * 50)), (UtilResize.resMultiplier() * 260), (UtilResize.resMultiplier() * 50)), errorMsg);
            if (GUI.Button(new Rect(Screen.width - 20, Screen.height - UtilResize.resMultiplier() * 45, 16, 16), "x", "ButtonSmall"))
            {
                errorMsg = "";
            }
        }

        GUI.enabled = true;
        if (statusMsg != "")
        {
            GUI.Box(UtilResize.ResizeGUI(new Rect(80, 240 - 40, 220, 40)), statusMsg);
        }
    }
Exemplo n.º 3
0
    void OnGUI()
    {
        GUI.skin = skin;
        // Make a text field that modifies stringToEdit.
        //GUI.backgroundColor = Color.black;
        GUI.DrawTexture(UtilResize.ResizeGUI(new Rect(0, 0, 320, 480)), backgroundImg);

        GUI.Label(UtilResize.ResizeGUI(new Rect(80, 10, 220, 20)), "eMail*", "LabelBold");
        email = GUI.TextField(UtilResize.ResizeGUI(new Rect(80, 30, 220, 40)), email, 100);

        GUI.Label(UtilResize.ResizeGUI(new Rect(80, 75, 220, 20)), "Password*", "LabelBold");
        password = GUI.PasswordField(UtilResize.ResizeGUI(new Rect(80, 100, 220, 40)), password, '*');

        GUI.Label(UtilResize.ResizeGUI(new Rect(80, 145, 200, 20)), "Repeat Password*", "LabelBold");
        repassword = GUI.PasswordField(UtilResize.ResizeGUI(new Rect(80, 170, 220, 40)), repassword, '*');

        GUI.Label(UtilResize.ResizeGUI(new Rect(80, 215, 200, 20)), "Nickname*", "LabelBold");
        nickname = GUI.TextField(UtilResize.ResizeGUI(new Rect(80, 240, 220, 40)), nickname, 25);


        if (GUI.Button(UtilResize.ResizeGUI(new Rect(80, 290, 220, 50)), "Create"))
        {
            if ((email != "") &&
                (password != "") &&
                (repassword != "") &&
                (password == repassword))
            {
                Credentials credentials = new Credentials();
                credentials.email    = email.ToLower();
                credentials.password = password;
                GDUser user = new GDUser();
                user.credentials = credentials;
                user.profile.Add("nickname", nickname);
                user.profile.Add("registerDate", DateTime.Now);

                GamedoniaUsers.CreateUser(user, OnCreateUser);
            }
            else
            {
                errorMsg = "Fill all the fields with (*) correctly";
                Debug.Log(errorMsg);
            }
        }

        if (GUI.Button(UtilResize.ResizeGUI(new Rect(80, 345, 220, 50)), "Cancel"))
        {
            Application.LoadLevel("LoginScene");
        }

        if (errorMsg != "")
        {
            GUI.Box(new Rect((Screen.width - (UtilResize.resMultiplier() * 260)), (Screen.height - (UtilResize.resMultiplier() * 50)), (UtilResize.resMultiplier() * 260), (UtilResize.resMultiplier() * 50)), errorMsg);
            if (GUI.Button(new Rect(Screen.width - 20, Screen.height - UtilResize.resMultiplier() * 45, 16, 16), "x", "ButtonSmall"))
            {
                errorMsg = "";
            }
        }
    }
Exemplo n.º 4
0
    void OnGUI()
    {
        GUI.skin = skin;

        GUI.DrawTexture(UtilResize.ResizeGUI(new Rect(0, 0, 320, 480)), backgroundImg);

        GUI.enabled = (statusMsg == "");

        //Text area control
        GUI.Label(UtilResize.ResizeGUI(new Rect(80, 10, 220, 20)), "Console Log:", "LabelBold");
        GUI.Box(UtilResize.ResizeGUI(new Rect(80, 30, 220, 380)), console);


        //Create an entity
        if (GUI.Button(UtilResize.ResizeGUI(new Rect(80, 420, 60, 50)), "Create an Entity"))
        {
            createEntity();
        }


        //Show all entities
        if (GUI.Button(UtilResize.ResizeGUI(new Rect(160, 420, 60, 50)), "Show all entities"))
        {
            showAllEntities();
        }


        //Remove an entity
        if (GUI.Button(UtilResize.ResizeGUI(new Rect(240, 420, 60, 50)), "Remove entity"))
        {
            removeEntity();
        }


        /*
         * //Server Push
         * if (GUI.Button (UtilResize.ResizeGUI(new Rect (80,420, 220, 50)), "Generate Push With Server Code")) {
         *      generatePushWithServerCode();
         * }
         *
         * if (errorMsg != "") {
         *      GUI.Box (new Rect ((Screen.width - (UtilResize.resMultiplier() * 260)),(Screen.height - (UtilResize.resMultiplier() * 50)),(UtilResize.resMultiplier() * 260),(UtilResize.resMultiplier() * 50)), errorMsg);
         *      if(GUI.Button(new Rect (Screen.width - 20,Screen.height - UtilResize.resMultiplier() * 45,16,16), "x","ButtonSmall")) {
         *              errorMsg = "";
         *      }
         * }
         *
         */

        GUI.enabled = true;
        if (statusMsg != "")
        {
            GUI.Box(UtilResize.ResizeGUI(new Rect(80, 240 - 40, 220, 40)), statusMsg);
        }
    }
Exemplo n.º 5
0
    void OnGUI()
    {
        GUI.skin = skin;

        // Make a text field that modifies stringToEdit.
        GUI.DrawTexture(UtilResize.ResizeGUI(new Rect(0, 0, 320, 480)), backgroundImg);

        GUI.Label(UtilResize.ResizeGUI(new Rect(80, 10, 220, 20)), "Name*", "LabelBold");
        name = GUI.TextField(UtilResize.ResizeGUI(new Rect(80, 30, 220, 40)), name, 100);

        GUI.Label(UtilResize.ResizeGUI(new Rect(80, 75, 220, 20)), "Director*", "LabelBold");
        director = GUI.TextField(UtilResize.ResizeGUI(new Rect(80, 100, 220, 40)), director, 100);

        GUI.Label(UtilResize.ResizeGUI(new Rect(80, 145, 200, 20)), "Duration*", "LabelBold");
        duration = GUI.TextField(UtilResize.ResizeGUI(new Rect(80, 170, 220, 40)), duration, 100);

        GUI.Label(UtilResize.ResizeGUI(new Rect(80, 215, 200, 20)), "Music*", "LabelBold");
        music = GUI.TextField(UtilResize.ResizeGUI(new Rect(80, 240, 220, 40)), music, 25);


        if (GUI.Button(UtilResize.ResizeGUI(new Rect(80, 290, 220, 50)), "Create"))
        {
            if ((name != "") &&
                (director != "") &&
                (director != "") &&
                (duration != "") &&
                (music != ""))
            {
                createEntity();
            }
            else
            {
                errorMsg = "Fill all the fields with (*) correctly";
                Debug.Log(errorMsg);
            }
        }

        if (GUI.Button(UtilResize.ResizeGUI(new Rect(80, 345, 220, 50)), "Cancel"))
        {
            Application.LoadLevel("DataScene");
        }

        if (errorMsg != "")
        {
            GUI.Box(new Rect((Screen.width - (UtilResize.resMultiplier() * 260)), (Screen.height - (UtilResize.resMultiplier() * 50)), (UtilResize.resMultiplier() * 260), (UtilResize.resMultiplier() * 50)), errorMsg);
            if (GUI.Button(new Rect(Screen.width - 20, Screen.height - UtilResize.resMultiplier() * 45, 16, 16), "x", "ButtonSmall"))
            {
                errorMsg = "";
            }
        }
    }
Exemplo n.º 6
0
    void OnGUI()
    {
        GUI.skin = skin;

        GUI.enabled = (statusMsg == "");

        GUI.DrawTexture(UtilResize.ResizeGUI(new Rect(0, 0, 320, 480)), backgroundImg);

        //Draw the car image
        GUI.DrawTexture(UtilResize.ResizeGUI(new Rect(120, 10, 128, 128)), carImg);

        //Debug.Log (Screen.width - (UtilResize.resMultiplier() * 50));
        GUI.Label(UtilResize.ResizeGUI(new Rect((320 - 50 + 80) / 2, 120, 50, 20)), "GAS", "LabelBold");
        GUI.Box(UtilResize.ResizeGUI(new Rect(118, 138, 132, 18)), "");
        GUI.Box(UtilResize.ResizeGUI(new Rect(120, 140, (float)(128 * gasProgress), 14)), "", "ProgressForeground");



        //Drive Btn
        if (GUI.Button(UtilResize.ResizeGUI(new Rect(80, 180, 220, 50)), "Drive"))
        {
            drive();
        }

        if (GUI.Button(UtilResize.ResizeGUI(new Rect(80, 240, 220, 50)), "Buy Gas"))
        {
            purchaseGas();
        }


        //Text area control
        GUI.Label(UtilResize.ResizeGUI(new Rect(80, 300, 220, 20)), "Console Log:", "LabelBold");
        GUI.Box(UtilResize.ResizeGUI(new Rect(80, 320, 220, 150)), console);


        if (errorMsg != "")
        {
            GUI.Box(new Rect((Screen.width - (UtilResize.resMultiplier() * 260)), (Screen.height - (UtilResize.resMultiplier() * 50)), (UtilResize.resMultiplier() * 260), (UtilResize.resMultiplier() * 50)), errorMsg);
            if (GUI.Button(new Rect(Screen.width - 20, Screen.height - UtilResize.resMultiplier() * 45, 16, 16), "x", "ButtonSmall"))
            {
                errorMsg = "";
            }
        }

        GUI.enabled = true;
        if (statusMsg != "")
        {
            GUI.Box(UtilResize.ResizeGUI(new Rect(80, 240 - 40, 220, 40)), statusMsg, "BoxBlack");
        }
    }
Exemplo n.º 7
0
    void OnGUI()
    {
        GUI.skin = skin;

        GUI.DrawTexture(UtilResize.ResizeGUI(new Rect(0, 0, 320, 480)), backgroundImg);

        GUI.Label(UtilResize.ResizeGUI(new Rect(80, 10, 220, 20)), "eMail*", "LabelBold");
        email = GUI.TextField(UtilResize.ResizeGUI(new Rect(80, 30, 220, 40)), email, 50);

        if (GUI.Button(UtilResize.ResizeGUI(new Rect(80, 80, 220, 50)), "Reset Password"))
        {
            if (email != "")
            {
                GamedoniaUsers.ResetPassword(email, OnResetPassword);
            }
            else
            {
                errorMsg = "eMail field can't be empty";
                Debug.Log(errorMsg);
            }
        }


        if (GUI.Button(UtilResize.ResizeGUI(new Rect(80, 140, 220, 50)), "Back"))
        {
            Application.LoadLevel("LoginScene");
        }

        if (errorMsg != "")
        {
            GUI.Box(new Rect((Screen.width - (UtilResize.resMultiplier() * 260)), (Screen.height - (UtilResize.resMultiplier() * 50)), (UtilResize.resMultiplier() * 260), (UtilResize.resMultiplier() * 50)), errorMsg);
            if (GUI.Button(new Rect(Screen.width - 20, Screen.height - UtilResize.resMultiplier() * 45, 16, 16), "x", "ButtonSmall"))
            {
                errorMsg = "";
            }
        }
    }
Exemplo n.º 8
0
    void OnGUI()
    {
        GUI.skin = skin;

        GUI.DrawTexture(UtilResize.ResizeGUI(new Rect(0, 0, 320, 480)), backgroundImg);

        GUI.Label(UtilResize.ResizeGUI(new Rect(80, 10, 220, 25)), "Account Details:", "LabelBold");

        GUI.Label(UtilResize.ResizeGUI(new Rect(80, 35, 220, 25)), "Nickname: ", "LabelSmallBold");

        if (userProfile != null && userProfile.profile["nickname"] != null)
        {
            GUI.Label(UtilResize.ResizeGUI(new Rect(170, 35, 220, 25)), userProfile.profile["nickname"] as string, "LabelSmall");
        }

        GUI.Label(UtilResize.ResizeGUI(new Rect(80, 60, 220, 25)), "Regis. Date: ", "LabelSmallBold");

        if (userProfile != null && userProfile.profile["registerDate"] != null)
        {
            DateTime d = (DateTime)userProfile.profile["registerDate"];
            GUI.Label(UtilResize.ResizeGUI(new Rect(170, 60, 220, 25)), d.ToUniversalTime().ToString(), "LabelSmall");
        }

        if (GUI.Button(UtilResize.ResizeGUI(new Rect(80, 150, 220, 50)), "Logout"))
        {
            GamedoniaUsers.LogoutUser(OnLogout);
        }

        if (errorMsg != "")
        {
            GUI.Box(new Rect((Screen.width - (UtilResize.resMultiplier() * 260)), (Screen.height - (UtilResize.resMultiplier() * 50)), (UtilResize.resMultiplier() * 260), (UtilResize.resMultiplier() * 50)), errorMsg);
            if (GUI.Button(new Rect(Screen.width - 20, Screen.height - UtilResize.resMultiplier() * 45, 16, 16), "x", "ButtonSmall"))
            {
                errorMsg = "";
            }
        }
    }