From 4bfaf190a4e16ecfc945bc26525b21dcaacc0417 Mon Sep 17 00:00:00 2001 From: wangguan <wangguan@kt007.com> Date: Fri, 27 Nov 2020 13:59:43 +0800 Subject: [PATCH] 新手引导买完木塔隐藏按钮,结束引导后恢复 调整按钮位置 --- Assets/Scripts/TowerDefense/UI/EndlessUIStart.cs | 15 +++++++++------ Assets/Scripts/Guide/GuidePanel.cs | 6 ++++++ Assets/Scripts/Guide/GuideCtrl.cs | 1 + Assets/Prefabs/UI/Endless/BottomCanvas.prefab | 2 +- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/Assets/Prefabs/UI/Endless/BottomCanvas.prefab b/Assets/Prefabs/UI/Endless/BottomCanvas.prefab index 8acd079..48498ac 100644 --- a/Assets/Prefabs/UI/Endless/BottomCanvas.prefab +++ b/Assets/Prefabs/UI/Endless/BottomCanvas.prefab @@ -1678,7 +1678,7 @@ m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 0, y: 0.5} - m_AnchoredPosition: {x: 96.01, y: 620} + m_AnchoredPosition: {x: 96.01, y: 388.12} m_SizeDelta: {x: 95, y: 106} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &4623057511951820394 diff --git a/Assets/Scripts/Guide/GuideCtrl.cs b/Assets/Scripts/Guide/GuideCtrl.cs index 5bf1720..b741da1 100644 --- a/Assets/Scripts/Guide/GuideCtrl.cs +++ b/Assets/Scripts/Guide/GuideCtrl.cs @@ -629,6 +629,7 @@ GameConfig.CanOpenNewTower = true; GameConfig.CanBuyNewTower = true; + panel.FinishGuide(); EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.GuideFinish); PlayerPrefs.SetInt("GemBattleGuide", 1); diff --git a/Assets/Scripts/Guide/GuidePanel.cs b/Assets/Scripts/Guide/GuidePanel.cs index 61982db..a7be2e5 100644 --- a/Assets/Scripts/Guide/GuidePanel.cs +++ b/Assets/Scripts/Guide/GuidePanel.cs @@ -401,6 +401,7 @@ woodPS2.Play(); towerPos2.enabled = true; DestoryButtonListener(towerBuyBtn); + towerBuyBtn.gameObject.SetActive(false); } @@ -557,6 +558,11 @@ RemoveButtonListener(skillBtn.gameObject); } + public void FinishGuide(){ + towerBuyBtn.gameObject.SetActive(true); + + } + #region 按钮以及提示 diff --git a/Assets/Scripts/TowerDefense/UI/EndlessUIStart.cs b/Assets/Scripts/TowerDefense/UI/EndlessUIStart.cs index bca872f..4ef0a26 100644 --- a/Assets/Scripts/TowerDefense/UI/EndlessUIStart.cs +++ b/Assets/Scripts/TowerDefense/UI/EndlessUIStart.cs @@ -106,6 +106,7 @@ transform.Find("Panel/Bottom").GetComponent<RectTransform>().anchoredPosition += tmpOffect; transform.Find("Panel/TowerBuyBtn").GetComponent<RectTransform>().anchoredPosition += tmpOffect; transform.Find("Panel/SwitchSpeed").GetComponent<RectTransform>().anchoredPosition += tmpOffect; + transform.Find("Panel/BuffPreviewButton").GetComponent<RectTransform>().anchoredPosition += tmpOffect; transform.Find("Panel/BossHPBar").GetComponent<RectTransform>().anchoredPosition -= tmpOffect * 0.5f; transform.Find("Panel/Score").GetComponent<RectTransform>().anchoredPosition -= tmpOffect * 0.5f; @@ -139,6 +140,7 @@ skillPS2 = transform.Find("Panel/Energy/FireSkillBg/Effect_UI_JiNengTuBiao_02/03 (16)").GetComponent<ParticleSystem>(); transform.Find("Panel/BuffPreviewButton").gameObject.SetActive(false); + transform.Find("Panel/SwitchSpeed").gameObject.SetActive(false); GameConfig.EnergyCount = 0; GameConfig.SkillLevel = 1; @@ -166,8 +168,6 @@ GameObject guideObj = Instantiate(Resources.Load<GameObject>("UI/Guide/GuidePanel"), transform.Find("Panel")); guideObj.GetComponent<RectTransform>().offsetMin += tmpOffect; AddGuideEvent(); - - transform.Find("Panel/SwitchSpeed").gameObject.SetActive(false); } } @@ -179,7 +179,12 @@ Debug.Log("设置激活"); transform.Find("Panel/Energy").gameObject.SetActive(true); - transform.Find("Panel/BuffPreviewButton").gameObject.SetActive(true); + if (!GameConfig.IsNewbie) + { + transform.Find("Panel/BuffPreviewButton").gameObject.SetActive(true); + transform.Find("Panel/SwitchSpeed").gameObject.SetActive(true); + } + fireSkillCost = JsonDataCenter.GetSkillLevelInfo(fireSkillID, GameConfig.SkillLevel).cost; bombSkillCost = JsonDataCenter.GetSkillLevelInfo(bombSkillID, GameConfig.SkillLevel).cost; @@ -378,7 +383,7 @@ EndlessLevelManager.instance.RestartWave(); GameConfig.IsNewbie = false; transform.Find("Panel/SwitchSpeed").gameObject.SetActive(true); - + transform.Find("Panel/BuffPreviewButton").gameObject.SetActive(true); } /// <summary> @@ -462,8 +467,6 @@ /// </summary> private void EnergyUp(int upCount) { - Debug.Log("开始检查"); - GameConfig.EnergyCount += upCount; if (GameConfig.EnergyCount > energyMax) { -- Gitblit v1.9.1