From 17c6e8b6f2aee4ed9a15c886f54a73f0cb61b125 Mon Sep 17 00:00:00 2001
From: weixudong <weixudong4700@ktgame.com>
Date: Wed, 09 Dec 2020 17:14:59 +0800
Subject: [PATCH] Merge branch 'master' of ssh://172.16.1.52:8091/GemBattle into master

---
 Assets/Scripts/Core/Camera/ViewPortAdj.cs |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/Assets/Scripts/Core/Camera/ViewPortAdj.cs b/Assets/Scripts/Core/Camera/ViewPortAdj.cs
index 539abf8..8c94784 100644
--- a/Assets/Scripts/Core/Camera/ViewPortAdj.cs
+++ b/Assets/Scripts/Core/Camera/ViewPortAdj.cs
@@ -11,7 +11,10 @@
     /// </summary>
     public UnityEngine.Camera cachedCamera { get; private set; }
 
+    private Vector3 cachedCameraPos;
+
     public UnityEngine.Camera backGroundCamera { get; private set; }
+    private Vector3 backGroundCameraPos;
 
     public bool bAdjViewPort = false;
 
@@ -21,8 +24,13 @@
         cachedCamera.DOShakePosition(0.25f, 1.5f, 4).OnComplete(() =>
         {
             KTGMGemClient.GameConfig.IsShaking = false;
+            cachedCamera.transform.position = cachedCameraPos;
+
         });
-        backGroundCamera.DOShakePosition(0.25f, 1.5f, 4);
+        backGroundCamera.DOShakePosition(0.25f, 1.5f, 4).OnComplete(() =>
+        {
+            backGroundCamera.transform.position = backGroundCameraPos;
+        });
     }
 
 
@@ -47,6 +55,9 @@
         base.Awake();
         cachedCamera = GetComponent<UnityEngine.Camera>();
         backGroundCamera = GameObject.Find("BackCamera").GetComponent<UnityEngine.Camera>();
+
+        cachedCameraPos = cachedCamera.transform.position;
+        backGroundCameraPos = backGroundCamera.transform.position;
     }
 
     // Start is called before the first frame update

--
Gitblit v1.9.1