コード例 #1
0
 public void Clear()
 {
     UserName.text = UserName.defaultText;
     selectedToy = null;
     toySelected = false;
     //okayOriColor = okayButton.color;
     okayButton.color = Color.gray;
     gameObject.collider.enabled = false;
 }
コード例 #2
0
    /// <summary>
    /// Load toys from database
    /// </summary>
    public void LoadToys()
    {
        MainDatabase.Instance.ConnectDB();
        List<DBToyInfo> allToys = MainDatabase.Instance.getToyInfo();

        // Set toys from database
        for (int i = 0; i < allToys.Count; i++)
        {
            if (i < toys.Count)
                toys [i].LoadToy(allToys [i].ToyID, allToys [i].Filename, new Color(allToys [i].ToyColorR / 255.0f, (float)allToys [i].ToyColorG / 255.0f, (float)allToys [i].ToyColorB / 255.0f), this);
        }

        // Fill remaining slots
        for (int i = allToys.Count; i < toys.Count; i++)
        {
            toys [i].LoadToy(-1, "", Color.white, this);
        }

        selectedToy = null;
    }