Esempio n. 1
0
    public void AddSetToPattern(List <string> setJewels)
    {
        jewelSet = new string[3] {
            setJewels[0], setJewels[1], setJewels[2]
        };

        GameObject set = Instantiate(setTemplate, contentArea);

        set.name = setIndex.ToString();

        JewelSet js = set.GetComponent <JewelSet>();

        pattern.Add(js);
        js.Create(jewelSet, setIndex, this);

        RectTransform rt = set.GetComponent <RectTransform>();

        rt.sizeDelta = offset;

        contentArea.sizeDelta = new Vector2(offset.x, offset.y * pattern.Count);

        setIndex++;
        if (pattern.Count > 0)
        {
            AdvanceOne.SetActive(true);
            SaveListButton.SetActive(true);

            if (pattern.Count > 1)
            {
                AdvanceTwo.SetActive(true);
            }
        }
    }
Esempio n. 2
0
    public void SaveList()
    {
        PlayerPrefs.SetInt("sets", pattern.Count);

        for (int i = 0; i < pattern.Count; i++)
        {
            JewelSet js = pattern[i];

            for (int j = 0; j < 3; j++)
            {
                PlayerPrefs.SetString("set" + i + j, js.text[j].text);
            }
        }
    }