From 14bb760c2802cd11702d362c4e4847ce97b95b39 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期二, 22 十月 2019 01:28:04 +0800
Subject: [PATCH] 0312 首杀表现优化 红点 和红包

---
 System/OpenServerActivity/BossFirstBloodWin.cs |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/System/OpenServerActivity/BossFirstBloodWin.cs b/System/OpenServerActivity/BossFirstBloodWin.cs
index 4a962b5..c85ac77 100644
--- a/System/OpenServerActivity/BossFirstBloodWin.cs
+++ b/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;
 
+            //棣栨潃 鏈嚮鏉�绾㈠寘姝e父浜紝宸插嚮鏉�鏈鍙栨樉绀虹壒鏁堢孩鐐癸紝宸查鍙栫疆鐏�
+            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()
         {

--
Gitblit v1.8.0