| | |
| | | return chatBubbles.TryGetValue(id, out bubble);
|
| | | }
|
| | |
|
| | | public bool IsBubbleGot(int id, out int reason)
|
| | | public bool IsBubbleGot(int id)
|
| | | {
|
| | | ChatBubble bubble;
|
| | | reason = 0;
|
| | | if (TryGetBubble(id, out bubble))
|
| | | {
|
| | | var config = Config.Instance.Get<ChatBubbleBoxConfig>(id);
|
| | | if (config.NeedLV != 0)
|
| | | {
|
| | | reason = 1;
|
| | | return PlayerDatas.Instance.baseData.LV >= config.NeedLV;
|
| | | }
|
| | | if (config.NeedVIPLVGift != 0)
|
| | | {
|
| | | reason = 2;
|
| | | var gift = vipModel.GetVipGift(config.NeedVIPLVGift);
|
| | | return gift != null && gift.hasBuy;
|
| | | }
|
| | | bool got = false;
|
| | | try
|
| | | {
|
| | | reason = 3;
|
| | | return MathUtility.GetBitValue(bubbleState, (ushort)id);
|
| | | got = MathUtility.GetBitValue(bubbleState, (ushort)id);
|
| | | }
|
| | | catch (ArgumentOutOfRangeException)
|
| | | {
|
| | | DebugEx.LogError("目前不支持id超过31的聊天框:" + id);
|
| | | }
|
| | | if (!got && config.NeedLV != 0)
|
| | | {
|
| | | return PlayerDatas.Instance.baseData.LV >= config.NeedLV;
|
| | | }
|
| | | return got;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
| | |
|
| | | public void SendUseBubble(int id)
|
| | | {
|
| | | var reason = 0;
|
| | | if (!IsBubbleGot(id, out reason))
|
| | | if (!IsBubbleGot(id))
|
| | | {
|
| | | return;
|
| | | }
|