From ab8e0acd0523a8a193f96ad2b82fe2cb765da186 Mon Sep 17 00:00:00 2001 From: lujiajian <204551278@qq.com> Date: Sat, 7 Feb 2026 15:54:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=BA=E6=99=AF=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIPanel/UI_ExperimentChooesPanel.prefab | 11 +++++ Assets/Scripts/SubjectToggle.cs | 43 +++++++++---------- Assets/Scripts/UI/UIPanel/UI_TopTitlePanel.cs | 4 +- 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/Assets/Resources/UI/UIPanel/UI_ExperimentChooesPanel.prefab b/Assets/Resources/UI/UIPanel/UI_ExperimentChooesPanel.prefab index 1bf865b..e688c95 100644 --- a/Assets/Resources/UI/UIPanel/UI_ExperimentChooesPanel.prefab +++ b/Assets/Resources/UI/UIPanel/UI_ExperimentChooesPanel.prefab @@ -5587,6 +5587,17 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 96343c47fe8d35a44a5244521831890f, type: 3} m_Name: m_EditorClassIdentifier: + SubjectTog: + - {fileID: 8259052942713030222} + - {fileID: 5678060293557198011} + - {fileID: 8089084432970626067} + - {fileID: 8811260483391861293} + - {fileID: 6655939487465875950} + - {fileID: 657600881843389557} + - {fileID: 7027064101671987027} + - {fileID: 6672875250636715790} + - {fileID: 9149981731159942754} + - {fileID: 6296556775557808310} --- !u!1 &6325379169560023408 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/SubjectToggle.cs b/Assets/Scripts/SubjectToggle.cs index 1a69a86..b9d7ecb 100644 --- a/Assets/Scripts/SubjectToggle.cs +++ b/Assets/Scripts/SubjectToggle.cs @@ -8,7 +8,7 @@ using UnityEngine.UI; public class SubjectToggle : BaseItem, IPointerEnterHandler, IPointerExitHandler { public Toggle Toggle_Subject; - public UI_ChooesPanel ChooesPanel; + //public UI_ChooesPanel ChooesPanel; public UI_TopTitlePanel TopTitlePanel; public Sprite[] subjectSprites; //科目选择图片 public TextMeshProUGUI SubjectNameText; //科目 @@ -29,7 +29,9 @@ public class SubjectToggle : BaseItem, IPointerEnterHandler, IPointerExitHandler { case "Subject1": //Bootstrap.Instance.uiManager.HidePanel(); - Bootstrap.Instance.uiManager.ShowPanel(this, E_UI_Layer.System, (panel) => + Bootstrap.Instance.uiManager.ShowPanel(this, E_UI_Layer.System, (panel) => + { + Bootstrap.Instance.uiManager.ShowPanel(this, E_UI_Layer.System, (panel) => { Bootstrap.Instance.eventCenter.EventTrigger(Enum_EventType.UpdateProgress, 0.5f); Bootstrap.Instance.scenesManager.LoadSceneAsyn(this, "xianchang", () => @@ -38,17 +40,14 @@ public class SubjectToggle : BaseItem, IPointerEnterHandler, IPointerExitHandler { Bootstrap.Instance.uiManager.ShowPanel(this, E_UI_Layer.Top, (panel) => { - Bootstrap.Instance.uiManager.ShowPanel(this, E_UI_Layer.System, (panel) => - { - Bootstrap.Instance.uiManager.HidePanel(); - Debug.Log("加载场景成功"); - Bootstrap.Instance.eventCenter.EventTrigger(Enum_EventType.UpdateProgress, 2f); - }); + Debug.Log("加载场景成功"); + Bootstrap.Instance.eventCenter.EventTrigger(Enum_EventType.UpdateProgress, 2f); + Bootstrap.Instance.uiManager.HidePanel(); }); }); }); }); - + }); break; case "Subject2": @@ -134,19 +133,19 @@ public class SubjectToggle : BaseItem, IPointerEnterHandler, IPointerExitHandler /// 加载文件夹中图片 /// /// - public void LoadImage(string path) - { - Sprite sprite = Resources.Load(path); - if (sprite != null) - { - ChooesPanel.targetimage.sprite = sprite; - Debug.Log("sprite加载成功"); - } - else - { - Debug.Log("sprite加载失败,当前文件夹未找到"); - } - } + //public void LoadImage(string path) + //{ + // Sprite sprite = Resources.Load(path); + // if (sprite != null) + // { + // ChooesPanel.targetimage.sprite = sprite; + // Debug.Log("sprite加载成功"); + // } + // else + // { + // Debug.Log("sprite加载失败,当前文件夹未找到"); + // } + //} /// /// toggle变大 diff --git a/Assets/Scripts/UI/UIPanel/UI_TopTitlePanel.cs b/Assets/Scripts/UI/UIPanel/UI_TopTitlePanel.cs index 3679aac..94a39d7 100644 --- a/Assets/Scripts/UI/UIPanel/UI_TopTitlePanel.cs +++ b/Assets/Scripts/UI/UIPanel/UI_TopTitlePanel.cs @@ -123,8 +123,8 @@ public class UI_TopTitlePanel : BasePanel Bootstrap.Instance.uiManager.ShowPanel(this, E_UI_Layer.Top, (panel) => { Bootstrap.Instance.uiManager.HidePanel(); - Bootstrap.Instance.uiManager.HidePanel< UI_TopTipPanel>(); - Bootstrap.Instance.uiManager.HidePanel< UI_ExperimentChooesPanel>(); + Bootstrap.Instance.uiManager.HidePanel(); + Bootstrap.Instance.uiManager.HidePanel(); Debug.Log("场景加载成功"); }); });