From 54181477c210344b037d88f17dbe2cddc5cbc930 Mon Sep 17 00:00:00 2001
From: chenxin <chenxin6991@163.com>
Date: Wed, 02 Dec 2020 17:54:32 +0800
Subject: [PATCH] Merge branch 'master' of http://172.16.1.52:8090/r/GemBattle into master

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

diff --git a/Assets/Scripts/Core/Camera/ViewPortAdj.cs b/Assets/Scripts/Core/Camera/ViewPortAdj.cs
index dc51868..539abf8 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,27 +11,42 @@
     /// </summary>
     public UnityEngine.Camera cachedCamera { get; private set; }
 
+    public UnityEngine.Camera backGroundCamera { get; private set; }
+
     public bool bAdjViewPort = false;
+
+    public void DOShakePosition()
+    {
+        KTGMGemClient.GameConfig.IsShaking = true;
+        cachedCamera.DOShakePosition(0.25f, 1.5f, 4).OnComplete(() =>
+        {
+            KTGMGemClient.GameConfig.IsShaking = false;
+        });
+        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;
     }
 
-    
+
     protected override void Awake()
     {
         base.Awake();
         cachedCamera = GetComponent<UnityEngine.Camera>();
+        backGroundCamera = GameObject.Find("BackCamera").GetComponent<UnityEngine.Camera>();
     }
 
     // Start is called before the first frame update
@@ -38,12 +54,13 @@
     {
         // 初始化的时候调整视口就OK了.
         this.adjViewportRect();
+        Application.targetFrameRate = 60;
     }
 
     // Update is called once per frame
     void Update()
     {
-        this.adjViewportRect();
-        Application.targetFrameRate = 60;
+        //this.adjViewportRect();
+        //Application.targetFrameRate = 60;
     }
 }

--
Gitblit v1.9.1