public void UpdateStudy()
    {
        Destroy(studyCell);
        studyCell = Instantiate(Resources.Load("studyCell")) as GameObject;
        studyCell.SetActive(false);

        ClearContents();
        int i = 0;

        Technique[] tList = LoadTxt.GetTechList();
        for (int key = 0; key < tList.Length; key++)
        {
            int lv = tList [key].lv;
//			int maxlv = tList [key].maxLv;
            int learntLv = GameData._playerData.techLevels [tList[key].type];
            if (lv != (learntLv + 1))
            {
                continue;
            }
            GameObject o;
            if (i >= studyCells.Count)
            {
                o = Instantiate(studyCell) as GameObject;
                o.SetActive(true);
                o.transform.SetParent(contentS.transform);
                o.transform.localPosition = Vector3.zero;
                o.transform.localScale    = Vector3.one;
                studyCells.Add(o);
            }
            else
            {
                o = studyCells [i] as GameObject;
                o.SetActive(true);
            }
            o.name = tList[key].id.ToString();
            Text[] t = o.GetComponentsInChildren <Text> ();
            t [0].text = tList[key].name;
            i++;
        }

        if (i < studyCells.Count)
        {
            for (int j = i; j < studyCells.Count; j++)
            {
                GameObject o = studyCells [j] as GameObject;
                o.SetActive(false);
            }
        }
        contentS.GetComponent <RectTransform> ().sizeDelta = new Vector2(800, 120 * i);
    }
Пример #2
0
    public void TechUpgrade()
    {
        foreach (int key in GameData._playerData.techLevels.Keys)
        {
            Technique[] techs = LoadTxt.GetTechList();
            for (int k = 0; k < techs.Length; k++)
            {
                if ((key == techs[k].type) && (GameData._playerData.techLevels [key] < techs[k].maxLv))
                {
                    return;
                }
            }
        }
        Achievement a = LoadTxt.GetAchievement(35);

        StoreAchievement(35);
        _floating.CallInFloating("Achievement:" + a.name, 0);
        _log.AddLog("Achievement:" + a.name, true);
    }