From 893f645dafa46b818a2edb9fa40337af0c3598d6 Mon Sep 17 00:00:00 2001
From: chenxin <chenxin6991@163.com>
Date: Fri, 06 Nov 2020 19:57:10 +0800
Subject: [PATCH] 修改买塔规则 爱心破碎特效 基地血条不掉问题

---
 Assets/Scripts/TowerDefense/UI/EndlessHomeBaseHPManager.cs |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/Assets/Scripts/TowerDefense/UI/EndlessHomeBaseHPManager.cs b/Assets/Scripts/TowerDefense/UI/EndlessHomeBaseHPManager.cs
index 5856b0f..96b418d 100644
--- a/Assets/Scripts/TowerDefense/UI/EndlessHomeBaseHPManager.cs
+++ b/Assets/Scripts/TowerDefense/UI/EndlessHomeBaseHPManager.cs
@@ -3,6 +3,8 @@
 using UnityEngine;
 using UnityEngine.UI;
 using Core.Utilities;
+using DG.Tweening;
+using MoreMountains.NiceVibrations;
 
 /**
  * 无尽模式玩家基地血量管理器
@@ -26,7 +28,7 @@
         /// <summary>
         /// 爱心列表
         /// </summary>
-        public List<Image> HeartList;
+        public List<GameObject> HeartList;
 
         // Start is called before the first frame update
         private void Start()
@@ -57,12 +59,20 @@
 
             while (i < end)
             {
-                Color c = HeartList[i].color;
-                c.a = 0.27f;
-                HeartList[i].color = c;
+                Image img = HeartList[i].GetComponent<Image>();
+                Color c = img.color;
+                c.a = 0.17f;
+                img.color = c;
+
+                GameObject psObj = HeartList[i].transform.GetChild(0).gameObject;
+                ParticleSystem ps = psObj.transform.GetChild(0).GetComponent<ParticleSystem>();
+                ps.Play();
                 ++i;
             }
 
+            ViewPortAdj.instance.cachedCamera.DOShakePosition(0.25f, 1.5f, 4);
+            MMVibrationManager.Haptic(HapticTypes.HeavyImpact);
+
             if (CurrentHP == 0)
                 EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessHeartAllLose);
         }

--
Gitblit v1.9.1