Example #1
0
 private void GetResult(Obj sender, Events.Vip.Add e)
 {
     if (e.Result == false)
     {
         FireEvent(new Events.UI.OpenUI("CommonTips", e.Reason));
     }
     FireEvent(new Events.UI.OpenUI("CommonTips", Localization.Format("ADD_WIN")));
     Close();
 }
Example #2
0
    /// <summary>
    /// 添加会员响应
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    void AddData(Obj sender, Events.Vip.Add e)
    {
        if (!e.Result)
        {
            FireEvent(new Events.UI.OpenUI("CommonTips", e.Reason));
            return;
        }
        VipItem new_item = Item.Clone <VipItem>();

        new_item.RefreshData(e.NewVip);
        new_item.ClickFunc = ClickFunc;
        for (int i = 0; i < VipList.Count; i++)
        {
            if (i + 1 < VipList.Count && string.CompareOrdinal(VipList[i].data.Id, e.NewVip.Id) > 0)
            {
                new_item.transform.SetSiblingIndex(i + 1);
                VipList.Insert(i, new_item);
                break;
            }
        }
    }