少年修仙传客户端代码仓库
client_Zxw
2018-08-18 98968558df87c7c5dd5b23e220ab72c1652bca63
System/FairyAu/PlayerRedPacketDatas.cs
@@ -58,6 +58,8 @@
    private const int Redpoint_key1 = 1070202;
    public  Redpoint redPointStre1 = new Redpoint(10702, Redpoint_key1);
    public int RedEnvelopeID = 0;//发红包的ID(用于默认弹出开)
    public override void Init()
    {
        PlayerDatas.Instance.fairyData.OnRefreshFairyMine += OnRefreshFairyMine;
@@ -71,6 +73,7 @@
    public void OnBeforePlayerDataInitialize()
    {
        UseLimit = 0;
        RedEnvelopeID = 0;
        IsRedBagGetBool = false;
        RedBagId = 0;
    }
@@ -161,7 +164,11 @@
                    _DicRedBag[(int)info.RedPacketInfo[i].RedPacketID].State = (int)info.RedPacketInfo[i].State;
                    _DicRedBag[(int)info.RedPacketInfo[i].RedPacketID].Wish = (string)info.RedPacketInfo[i].Wish;
                    if (Event_RedEnvelopeToRefresh != null)
                    {
                        Event_RedEnvelopeToRefresh(_DicRedBag[(int)info.RedPacketInfo[i].RedPacketID]);
                        RedBagPoppingOpen();
                    }
                }
            }
@@ -173,6 +180,22 @@
        RedPacketRedDot();
    }
    private void RedBagPoppingOpen()
    {
        if (_DicRedBag.ContainsKey(RedEnvelopeID) && WindowCenter.Instance.CheckOpen<RedBagTipsWin>())
        {
            var redBag = _DicRedBag[RedEnvelopeID];
            if (redBag.GetWay != 5 && redBag.GetWay != 0 && redBag.PlayerID == PlayerDatas.Instance.PlayerId && redBag.State == 1)
            {
                RedBagId = RedEnvelopeID;
                WindowCenter.Instance.Open<RedOPenBGMWin>();//打开领取界面
            }
        }
    }
    public void IsRedBagGet()
    {
        IsRedBagGetBool = false;