public void SetData(GuildDonateRef _guildDonateRef) { guildDonateRef = _guildDonateRef; if (_guildDonateRef != null) { if (nameLab != null) { nameLab.text = _guildDonateRef.donationName; } if (rewardDes != null) { rewardDes.text = _guildDonateRef.des.Replace("\\n", "\n"); } if (_guildDonateRef.cost.Count > 0) { if (costSp != null) { //EquipmentInfo eqinfo = new EquipmentInfo(_guildDonateRef.cost[0].eid, EquipmentBelongTo.PREVIEW); costSp.spriteName = GameHelper.GetCoinIconByType(_guildDonateRef.cost[0].eid); if (_guildDonateRef.cost[0].eid == 18) { itemCost = _guildDonateRef.cost[0]; } costSp.MakePixelPerfect(); } if (costLab != null) { costLab.text = _guildDonateRef.cost[0].count.ToString(); } } } }
/// <summary> /// 获取捐赠信息 /// </summary> /// <param name="_pt">Point.</param> protected void S2C_DonateLimitData(Pt _pt) { pt_guild_contribute_result_d50a info = _pt as pt_guild_contribute_result_d50a; if (info != null) { restDonateTimes = maxDonateTime - info.times; //Debug.Log("S2C_DonateLimitData: time:" + info.times + ",type:" + info.type); //#0#捐献了 #1# 个 #2# GuildDonateRef guildDonateRef = ConfigMng.Instance.GetGuildDonateRef(info.type); if (guildDonateRef != null) { if (guildDonateRef.cost.Count > 0) { EquipmentInfo eqinfo = new EquipmentInfo(guildDonateRef.cost[0].eid, EquipmentBelongTo.PREVIEW); string msg = ConfigMng.Instance.GetUItext(45, new string[3] { GameCenter.mainPlayerMng.MainPlayerInfo.Name, guildDonateRef.cost[0].count.ToString(), eqinfo.ItemName }); GameCenter.chatMng.SendMsgByType(ChatInfo.Type.Guild, msg); } } GameCenter.mainPlayerMng.SetFunctionRed(FunctionType.GUILDDONATE, restDonateTimes > 0); if (OnGuildDonateTimeEvent != null) { OnGuildDonateTimeEvent(); } } }