//添加客服端浮动提示 public void AddFloatTip(MsgRefData mess, bool isEquInfo = false) { if (temFloatObject == null) { Debug.LogWarning("MessageDialogManager temFloatObject is null!"); return; } StartCoroutine(FloatTip(mess)); }
IEnumerator FloatTip(MsgRefData mess) { bool isEquInfo = false; // float timeValue = 0; if (mess.sort == 12) { //第一物品提示不用等待 isEquInfo = true; if (values == 0) { values++; } else { time += mess.holdTime; values++; yield return(new WaitForSeconds(time)); } } FloatTipObject tem = null; if (mess.sort == 13 || mess.sort == 14) { int a = floatTipParent.transform.childCount; if (a > 0) { for (int i = 0; i < a; i++) { floatTipParent.transform.GetChild(i).DestroyChildren(); } } if (floatTipParent != null && temFloatObject != null) { tem = NGUITools.AddChild(floatTipParent, temFloatObject.gameObject).GetComponent <FloatTipObject>(); } } else { if (otherTipParent != null && temFloatObject != null) { tem = NGUITools.AddChild(otherTipParent, temFloatObject.gameObject).GetComponent <FloatTipObject>(); } } tem.transform.localPosition = mess.flowStartV3; if (mess.item != null) { tem.equInfoItem = new EquipmentInfo(mess.item.eid, mess.item.count, EquipmentBelongTo.PREVIEW); } tem.Data = mess; tem.gameObject.SetActive(true); ShowFloatTip(tem, mess.messStr, mess.showBg, isEquInfo); }