Ejemplo n.º 1
0
    //checks the manifest for whether the user is valid or not
    public IEnumerator Check()
    {
        string input = nameText.GetComponent <Text>().text;

        Debug.Log(input);
        //The user cannot continue without entering something for their name
        if (input == "")
        {
            Debug.Log("You have to enter a name");
            errorText.SetActive(true);
            yield return(null);
        }
        else
        {
            Variables.Name = input;
            yield return(StartCoroutine(ValidateUser.CheckName(Variables.Name)));

            if (!Variables.ValidUser)
            {
                dispError();
            }
            else
            {
                PlayerPrefs.SetString("Name", Variables.Name);
                SceneManager.LoadScene("Home");
            }
        }
    }
Ejemplo n.º 2
0
    private void Awake()
    {
        //Makes the nav bar show up on android
        Screen.fullScreen = false;
        //Initialise variables for use in the rest of the app
        Debug.Log("Reading variables from file...");
        //colour things
        Variables.ColorIndex    = PlayerPrefs.GetInt("ColourIndex", 0);
        Variables.ColourProfile = PlayerPrefs.GetString("ColourProfile");
        Variables.ColourValues  = PlayerPrefs.GetString("ColourValues", "66, 116, 255");
        if (Variables.ColourValues == "")
        {
            Variables.ColourValues = "66, 116, 255";
        }
        //name
        Variables.Name = PlayerPrefs.GetString("Name", "NULL");
        //settings
        Variables.HomeScreenMode = PlayerPrefs.GetInt("HomeScreenMode", 0);
        Variables.Vibration      = PlayerPrefs.GetInt("Vibration", 1);
        //keys
        Variables.KeySetNumber = PlayerPrefs.GetInt("KeySetNumber", 0);
        Variables.InOut        = PlayerPrefs.GetString("InOut", "out");
        //headcounts
        Variables.FloorCount = new int[5];
        for (int floor = 0; floor < 5; floor++)
        {
            Variables.FloorCount[floor] = PlayerPrefs.GetInt("m_Floor" + (floor + 1), 0);
        }
        //setting up the colour codes
        Variables.ColourCodes = new byte[3];
        string colourCode = Variables.ColourValues;

        string[] rgb = colourCode.Split(',');
        for (int i = 0; i < 3; i++)
        {
            byte.TryParse(rgb[i], out Variables.ColourCodes[i]);
        }
        //hourly assignments
        Variables.HourlyAssignment = PlayerPrefs.GetString("HourlyAssignment", "None");
        Variables.OnRounds         = PlayerPrefs.GetInt("OnRounds", 0);
        //Bathrooms
        Variables.IssueArray     = new System.Collections.Generic.List <string>();
        Variables.ScannedQRCodes = new System.Collections.Generic.List <string>();
        //DONE
        Debug.Log("Variables Initialised!");
        Debug.Log("Checking user status...");
        //checks the users status
        StartCoroutine(ValidateUser.CheckName(Variables.Name));
    }