From 13c929b4a9c5477cc3d18f5d06b9bbcdc405045e Mon Sep 17 00:00:00 2001
From: wangguan <wangguan@kt007.com>
Date: Wed, 25 Nov 2020 10:54:18 +0800
Subject: [PATCH] 新手引导适配 判断是否新手放在JsonData中 注释新手引导首次塔受伤的事件广播

---
 Assets/Scripts/Core/Camera/ViewPortAdj.cs |   29 +++++++++++++++++++----------
 1 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/Assets/Scripts/Core/Camera/ViewPortAdj.cs b/Assets/Scripts/Core/Camera/ViewPortAdj.cs
index dc51868..662b802 100644
--- a/Assets/Scripts/Core/Camera/ViewPortAdj.cs
+++ b/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,20 +11,27 @@
     /// </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()
     {
-        float wscale = 1080f/Screen.width;
-        // River: 动态的处理ViewPortRect.
-        float vpscale = (1920f / wscale / Screen.height);
-        Rect vpRect = new Rect();
-        vpRect.x = 0.0f;
-        vpRect.y = (1.0f - vpscale) / 2.0f;
-        vpRect.width = 1f;
-        vpRect.height = vpscale;
-        cachedCamera.rect = vpRect;
-        bAdjViewPort = true;
+        //float wscale = 1080f/Screen.width;
+        //// River: 动态的处理ViewPortRect.
+        //float vpscale = (1920f / wscale / Screen.height);
+        //Rect vpRect = new Rect();
+        //vpRect.x = 0.0f;
+        //vpRect.y = (1.0f - vpscale) / 2.0f;
+        //vpRect.width = 1f;
+        //vpRect.height = vpscale;
+        //cachedCamera.rect = vpRect;
+        //bAdjViewPort = true;
     }
 
     
@@ -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

--
Gitblit v1.9.1