wangguan
2020-11-19 436001a2c54a226f9ff45284aeeed680d6a38d25
增加震动相机
2 files modified
12 ■■■■■ changed files
Assets/Scripts/Core/Camera/ViewPortAdj.cs 9 ●●●●● patch | view | raw | blame | history
Assets/Scripts/TowerDefense/UI/EndlessHomeBaseHPManager.cs 3 ●●●● patch | view | raw | blame | history
Assets/Scripts/Core/Camera/ViewPortAdj.cs
@@ -1,4 +1,5 @@
using Core.Utilities;
using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@@ -10,7 +11,14 @@
    /// </summary>
    public UnityEngine.Camera cachedCamera { get; private set; }
    public UnityEngine.Camera backGroundCamera { get; private set; }
    public bool bAdjViewPort = false;
    public void DOShakePosition(){
        cachedCamera.DOShakePosition(0.25f, 1.5f, 4);
        backGroundCamera.DOShakePosition(0.25f, 1.5f, 4);
    }
    public void adjViewportRect()
    {
@@ -31,6 +39,7 @@
    {
        base.Awake();
        cachedCamera = GetComponent<UnityEngine.Camera>();
        backGroundCamera = GameObject.Find("BackCamera").GetComponent<UnityEngine.Camera>();
    }
    // Start is called before the first frame update
Assets/Scripts/TowerDefense/UI/EndlessHomeBaseHPManager.cs
@@ -77,7 +77,8 @@
            hpTxt.text = "x" + CurrentHP.ToString();
            //ps.Play();
            ViewPortAdj.instance.cachedCamera.DOShakePosition(0.25f, 1.5f, 4);//这里只可以震动3D场景中的东西
            //ViewPortAdj.instance.cachedCamera.DOShakePosition(0.25f, 1.5f, 4);//这里只可以震动3D场景中的东西
            ViewPortAdj.instance.DOShakePosition();
            MMVibrationManager.Haptic(HapticTypes.HeavyImpact);
            if (CurrentHP == 0)