少年修仙传客户端代码仓库
hch
2019-10-22 14bb760c2802cd11702d362c4e4847ce97b95b39
System/OpenServerActivity/BossFirstBloodWin.cs
@@ -19,6 +19,9 @@
        [SerializeField] Text m_NPCNameLV;
        [SerializeField] Text m_PlayerName;
        [SerializeField] Text m_KillTime;
        [SerializeField] UIEffect m_Effect;
        [SerializeField] Button m_RedPack;
        [SerializeField] RedpointBehaviour redPonint;
        BossFirstBloodModel model
        {
@@ -152,7 +155,33 @@
            m_NPCNameLV.text = npcConfig.charName + " LV." + npcConfig.NPCLV;
            //首杀 未击杀红包正常亮,已击杀未领取显示特效红点,已领取置灰
            redPonint.redpointId = model.GetNPCRedPackPointID(npcID);
            model.UpdateRedPackPoint(npcID);
            ShowKillInfo(npcID);
            m_RedPack.RemoveAllListeners();
            m_RedPack.AddListener(() =>
            {
                ClickRedPack(npcID);
            });
        }
        private void ClickRedPack(int npcID)
        {
            var state = model.GetBossKillAwardState(npcID);
            if (state == 1)
            {
                SendGetAward(npcID, 0);
                return;
            }
            var npcConfig = NPCConfig.Get(npcID);
            if (state == 0)
                SysNotifyMgr.Instance.ShowTip("NoBossFirstKill", npcConfig.charName);
            else if (state == 2)
                SysNotifyMgr.Instance.ShowTip("GetBossFirstKillAwardYet", npcConfig.charName);
        }
        public void ShowKillInfo(int npcID)
@@ -255,6 +284,24 @@
                    });
                }
            }
            // 红包状态
            var state = model.GetBossKillAwardState(npcID);
            if (state == 0)
            {
                m_RedPack.SetColorful(null, true);
                m_Effect.Stop();
            }
            else if (state == 1)
            {
                m_RedPack.SetColorful(null, true);
                m_Effect.Play();
            }
            else if (state == 2)
            {
                m_RedPack.SetColorful(null, false);
                m_Effect.Stop();
            }
        }
        protected override void BindController()
        {