Beispiel #1
0
    void OnSelectItem(RideFeeditem item)
    {
        m_preRideFeeditem = m_currRideFeeditem;
        if (m_preRideFeeditem != null)
        {
            m_preRideFeeditem.SetState(false);
        }

        m_currRideFeeditem = item;
        m_currRideFeeditem.SetState(true);

        m_rideid = m_currRideFeeditem.ItemId;
    }
Beispiel #2
0
    private RideFeeditem AddFeedItem()
    {
        GameObject go = NGUITools.AddChild(m_trans_root.gameObject, m_widget_item01.gameObject);

        if (go != null)
        {
            go.SetActive(true);
            RideFeeditem item = go.AddComponent <RideFeeditem>();
            m_lstRideFeeditem.Add(item);
            return(item);
        }
        return(null);
    }
Beispiel #3
0
    protected override void OnShow(object data)
    {
        base.OnShow(data);

        if (data != null && data is uint)
        {
            m_rideid = (uint)data;
        }

        m_trans_root.transform.parent.GetComponent <UIScrollView>().ResetPosition();
        Client.IGameOption option = Client.ClientGlobal.Instance().gameOption;
        if (option == null)
        {
            return;
        }
        uint feedItemId = (uint)option.GetInt("MedicalSetting", "RideFeedId", 0);
        //
        List <string> keys = GameTableManager.Instance.GetGlobalConfigKeyList("FeedItemRide");

        keys.Sort();
        RideFeeditem feeditem = null;
        int          i        = 0;

        for (; i < keys.Count; i++)
        {
            if (i >= m_lstRideFeeditem.Count)
            {
                feeditem = AddFeedItem();
            }
            else
            {
                feeditem = m_lstRideFeeditem[i];
            }
            uint itemid = uint.Parse(keys[i]);
            feeditem.gameObject.SetActive(true);
            feeditem.transform.localPosition = new UnityEngine.Vector3(0, -i * 105, 0);
            feeditem.InitUI(itemid, OnSelectItem);
            if (itemid == feedItemId)
            {
                OnSelectItem(feeditem);
            }
        }

        for (int k = i; k < m_lstRideFeeditem.Count; k++)
        {
            m_lstRideFeeditem[k].gameObject.SetActive(false);
        }
    }