protected void InitTalkWaitDic() { foreach (EntourageTalkType item in Enum.GetValues(typeof(EntourageTalkType))) { PoPoPetRef refData = ConfigMng.Instance.GetPoPoPetRef(actorInfo.PetId, item); if (refData != null) { //Debug.Log("actorInfo.PetId:" + actorInfo.PetId + "item:" + item + ",popID:" + refData.poPoId); curTalkWaitDic[item] = new EntourageTalkCheck(refData); } else { // Debug.LogError(item + "随从泡泡说话初始化失败!"); } } }
/// <summary> /// 尝试冒泡说话 /// </summary> /// <param name="_type"></param> public void TryTalk(EntourageTalkType _type) { if (thisPlayer.headTextCtrl == null) { return; } if (curTalkWaitDic.ContainsKey(_type)) { EntourageTalkCheck check = curTalkWaitDic[_type]; if (check.CanTalk) { check.Reset(); PoPoRef bub = check.CurTalkRefData; if (bub != null) { thisPlayer.headTextCtrl.SetBubble(bub.content, bub.time); } } } }