/// <summary> /// 初始化消息动画 /// </summary> private void InitializeMessageAnimation() { switch (m_CurrentMessage.type) { case NotificationName.MSG_MISSION_ACCEPT: case NotificationName.MSG_MISSION_FAIL: break; case NotificationName.MSG_MISSION_COMMIT: { UIIconAndLabel label = m_CurrentAnimationEvent.GetComponent <UIIconAndLabel>(); if (label && label.Label) { label.Label.text = TableUtil.GetLanguageString("mission_title_1005"); } } break; case NotificationName.MSG_MISSION_STATE_CHANGE: { UIIconAndLabel label = m_CurrentAnimationEvent.GetComponent <UIIconAndLabel>(); if (label && label.Label) { label.Label.text = TableUtil.GetLanguageString("mission_title_1015"); } } break; case NotificationName.MSG_PLAYER_LEVEL_UP: { UIIconAndLabel label = m_CurrentAnimationEvent.GetComponent <UIIconAndLabel>(); if (label && label.Label) { label.Label.text = m_CurrentMessage.argument != null ? "Lv." + m_CurrentMessage.argument.ToString() : string.Empty; } } break; case NotificationName.MSG_PLAYER_SHIP_LEVEL_UP: { MsgShipLevelUp msg = (MsgShipLevelUp)m_CurrentMessage.argument; UIIconAndLabel shipLabel = m_CurrentAnimationEvent.GetComponent <UIIconAndLabel>(); if (shipLabel && shipLabel.Label) { shipLabel.Label.text = m_CurrentMessage.argument != null ? "Lv." + msg.m_level : string.Empty; } if (shipLabel && shipLabel.Icon) { UIUtil.SetIconImage(shipLabel.Icon, TableUtil.GetItemIconTid(msg.m_Tid)); } if (shipLabel && shipLabel.Info) { string name = TableUtil.GetItemName(msg.m_Tid); shipLabel.Info.text = string.Format(TableUtil.GetLanguageString("hud_text_id_1036"), name); } } break; } }
/// <summary> /// 打开确认面板 /// </summary> /// <param name="type">操作类型</param> public void OpenConfim(MsgProduceConfim confim)//消耗数据 { ProduceOrder type = confim.OrderType; m_SelectProduceTid = confim.Tid; switch (type) { case ProduceOrder.Produce: //生产 m_ReturnTitle.text = string.Format(TableUtil.GetLanguageString("production_text_1025"), TableUtil.GetItemName(m_FoundryProxy.GetItemByProduceKey(m_SelectProduceTid).Id)); m_HintLabel.text = ""; break; case ProduceOrder.Canel: //取消生产 m_ReturnTitle.text = TableUtil.GetLanguageString("production_text_1026"); m_HintLabel.text = TableUtil.GetLanguageString("production_text_1041"); m_IconList.Clear(); Item[] items = m_FoundryProxy.GetEffectItem(m_SelectProduceTid); EffectElement?[] effects = m_FoundryProxy.GetEffectElementsByProduceTid(m_SelectProduceTid); for (int i = 0; i < items.Length; i++) { IconManager.Instance.LoadItemIcon <IconCommon>(IconConstName.ICON_COMMON, m_ReturnItemRoot, (icon) => { m_IconList.Add(icon); icon.SetData(TableUtil.GetItemIconTid(items[i].Id), items[i].Quality, (int)effects[i].Value.Value); }); } break; case ProduceOrder.Recevie: //领取 不要图标 m_ReturnTitle.text = TableUtil.GetLanguageString("production_text_1028"); m_HintLabel.text = ""; break; case ProduceOrder.SpeedUp: //加速 m_ReturnTitle.text = TableUtil.GetLanguageString("production_text_1027"); m_HintLabel.text = TableUtil.GetLanguageString("production_text_1040"); m_IconList.Clear(); IconManager.Instance.LoadItemIcon <IconCommon>(IconConstName.ICON_COMMON, m_ReturnItemRoot, (icon) => { m_IconList.Add(icon); icon.SetData(TableUtil.GetItemIconTid(GameConstant.CurrencyConst.RECHARGE_CURRENCY_ITEM_TID), TableUtil.GetItemQuality(GameConstant.CurrencyConst.RECHARGE_CURRENCY_ITEM_TID), (int)confim.ExpendNum); }); break; default: break; } }