From 51e5211590b58df92c4bbdb8974b14f96276690a Mon Sep 17 00:00:00 2001
From: wangguan <wangguan@kt007.com>
Date: Thu, 19 Nov 2020 12:02:06 +0800
Subject: [PATCH] 全新适配

---
 Assets/Scripts/TowerDefense/UI/EndlessUIStart.cs |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/Assets/Scripts/TowerDefense/UI/EndlessUIStart.cs b/Assets/Scripts/TowerDefense/UI/EndlessUIStart.cs
index 5df7cac..f6f5e7f 100644
--- a/Assets/Scripts/TowerDefense/UI/EndlessUIStart.cs
+++ b/Assets/Scripts/TowerDefense/UI/EndlessUIStart.cs
@@ -71,6 +71,17 @@
         EndlessBossHPManager.instance.HideHP();
         EndlessScoreManager.instance.HideScore();
 
+
+        float ratio = 0.06666667f;
+        RectTransform ts = GetComponent<RectTransform>();
+        float tmpScale = ratio / ts.localScale.x - 1.0f;
+        float offect = tmpScale * (ts.sizeDelta.y * 0.5f);
+        //Debug.Log($"tmpScale:{tmpScale}  offect:{offect}");
+        Vector2 tmpOffect = new Vector2(0, offect);
+        transform.Find("Panel/Bottom").GetComponent<RectTransform>().anchoredPosition += tmpOffect;
+        transform.Find("Panel/TowerBuyBtn").GetComponent<RectTransform>().anchoredPosition += tmpOffect;
+
+
         //查询是否已经做过了新手引导
         int guide = PlayerPrefs.GetInt("GemBattleGuide");
         GameConfig.IsNewbie = guide == 0;
@@ -83,7 +94,8 @@
             countDownTextNew.text = "";
             countDownTextNew.gameObject.SetActive(false);
 
-            Instantiate(Resources.Load<GameObject>("UI/Guide/GuidePanel"), transform.Find("Panel"));
+            GameObject guideObj = Instantiate(Resources.Load<GameObject>("UI/Guide/GuidePanel"), transform.Find("Panel"));
+            guideObj.GetComponent<RectTransform>().offsetMin += tmpOffect;
             AddGuideEvent();
         }
 
@@ -92,6 +104,8 @@
         GameConfig.EndlessPortUseSkillTowerCount = 0;
 
         AudioSourceManager.Ins.Play(AudioEnum.BGM2);
+
+
     }
 
     /// <summary>

--
Gitblit v1.9.1