Example #1
0
    void Update()
    {
        if (existingProperties != null)                           //Checks if the data has been downloaded
        {
            PropertiesHandler.SaveProperties(existingProperties); //Saves the downloaded data
        }
        if (existingCards != null)
        {
            PropertiesHandler.SaveCards(existingCards);             //Saves the downloaded data
        }

        if (PropertiesHandler.CheckPropertyExists() && PropertiesHandler.CheckCardExists())
        {
            PlayButton.interactable = true; //Enables the play button
            enabled = false;                //Stops the update loop
        }
    }
Example #2
0
 void Start()
 {
     PlayButton.onClick.AddListener(OpenPlayMenu);
     Debug.Log("User ID: " + UserManager.userID);
     Debug.Log("Username: " + UserManager.username);
     if (!PropertiesHandler.CheckPropertyExists())    //Checks if the properties file doesn't exist.
     {
         StartCoroutine(GetProperties());             //Downloads the properties json.
     }
     else if (!PropertiesHandler.CheckCardExists())
     {
         StartCoroutine(GetCards());             //Downloads the cards json.
     }
     else
     {
         enabled = false;                //Stops the update function.
         PlayButton.interactable = true; //Enables the play button
     }
 }