Exemplo n.º 1
0
 public UISaveGameProgress()
 {
     m_RecordList = SerializeUtil.GetDataWithPath <GameRecordList>(PathUtil.RecordListPath);
     if (null == m_RecordList)
     {
         m_RecordList = new GameRecordList();
     }
     // end if
 } // end UISaveGameProgress
Exemplo n.º 2
0
    public override void OnEnter()
    {
        GameObject prefab = Resources.Load <GameObject>(m_PrefabPath);

        m_GameObject = Object.Instantiate(prefab, UIManager.Instance.Canvas.transform);
        GameRecordList recordList = SerializeUtil.GetDataWithPath <GameRecordList>(PathUtil.RecordListPath);

        if (null == recordList)
        {
            recordList = new GameRecordList();
        }
        // end if
        for (int i = 0; i < 3; i++)
        {
            int index = i;
            m_GameObject.transform.Find("ProgressItem_" + i).GetComponent <Button>().onClick.AddListener(delegate() { OnSelect(index); });
            m_GameObject.transform.Find(string.Format("ProgressItem_{0}/Text", i)).GetComponent <Text>().text = recordList.GetRecordNameWithIndex(index);
        } // end for
        m_GameObject.transform.Find("BackBtn").GetComponent <Button>().onClick.AddListener(OnClickBackBtn);
    }     // end OnEnter