wangguan
2020-11-06 fc40dea934140005aeb62ac1e4ec1e613cc44a0c
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);
        }