修改实训点不了toggle的原因

This commit is contained in:
taosuqi 2025-04-14 09:22:53 +08:00
parent 16db68cb6a
commit 04642aaf71
5 changed files with 14 additions and 41 deletions

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 75ae750f8fa5293489e7f67efce226d7
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -183,7 +183,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 2fafe2cfe61f6974895a912c3755e8f1, type: 3} m_Script: {fileID: 11500000, guid: 2fafe2cfe61f6974895a912c3755e8f1, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_AllowSwitchOff: 1 m_AllowSwitchOff: 0
--- !u!1 &1274212127849608913 --- !u!1 &1274212127849608913
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -57,7 +57,7 @@ public class BasePanel : MonoBehaviour
/// 查找子控件并添加到字典中,同时添加事件监听器 /// 查找子控件并添加到字典中,同时添加事件监听器
/// </summary> /// </summary>
/// <typeparam name="T">控件类型</typeparam> /// <typeparam name="T">控件类型</typeparam>
private void FindChildrenControl<T>() where T : UIBehaviour public void FindChildrenControl<T>() where T : UIBehaviour
{ {
T[] controls = GetComponentsInChildren<T>(true); T[] controls = GetComponentsInChildren<T>(true);

View File

@ -30,7 +30,6 @@ public class UI_StepsPanel : BasePanel
public string jsonFileName = "StepsConfig"; // JSON文件名 public string jsonFileName = "StepsConfig"; // JSON文件名
protected override void Awake() protected override void Awake()
{ {
base.Awake();
canvasGroup.alpha = 0f; canvasGroup.alpha = 0f;
data = JsonManager.LoadData<PptFilesData>(jsonFileName); data = JsonManager.LoadData<PptFilesData>(jsonFileName);
foreach (var pptFile in data.pptFiles) foreach (var pptFile in data.pptFiles)
@ -52,6 +51,8 @@ public class UI_StepsPanel : BasePanel
buttonText.text = $"{pptFile.fileName}"; buttonText.text = $"{pptFile.fileName}";
} }
} }
base.Awake();
//FindChildrenControl<Toggle>();
} }
public override async void ShowMe(int time = 0) public override async void ShowMe(int time = 0)
@ -107,43 +108,22 @@ public class UI_StepsPanel : BasePanel
await ToolManager.RefreshScrollView(StepsContent, scrollRect); await ToolManager.RefreshScrollView(StepsContent, scrollRect);
switch (togglePath) switch (togglePath)
{ {
case "retrun_Btn": case "育苗前种子处理":
if (isOn) if (isOn)
{ {
Bootstrap.Instance.scenesManager.LoadSceneAsyn("MenuScene", () => Debug.Log("育苗前种子处理");
{
Bootstrap.Instance.uiManager.ShowPanel<UI_SelectModePanel>(this, E_UI_Layer.Top, (panel) =>
{
Bootstrap.Instance.uiManager.ShowPanel<UI_BGPanel>(this, E_UI_Layer.Bot, (panel) =>
{
Debug.Log("加载场景成功");
Bootstrap.Instance.uiManager.HidePanel<UI_TipsForPracticePanel>();
Bootstrap.Instance.uiManager.HidePanel<UI_StepsPanel>();
Bootstrap.Instance.uiManager.HidePanel<UI_MainTitlePanel>();
Bootstrap.Instance.uiManager.HidePanel<UI_FineSoilPreparationPanel>();
Bootstrap.Instance.uiManager.HidePanel<UI_ContentPanel>();
Bootstrap.Instance.eventCenter.EventTrigger(Enum_EventType.UpdateProgress, 0.9f);
Debug.Log("UI_StepsPanel已经显示在" + E_UI_Layer.System);
Bootstrap.Instance.eventCenter.EventTrigger(Enum_EventType., false); UI_ContentPanel.instance.Tips = "1.选种是为了淘汰瘦小、损伤、虫蛀和霉变的种子选出粒大饱满、外观光滑且有光泽的籽粒。选种方法包括风选和筛选风选可用风车或簸箕将枇子、虫蛀等籽粒扇掉筛选则使用3.5毫米-4毫米孔径的筛子筛去小粒种子。选种后种子发芽率更高出苗整齐一致有利于培育壮苗。(在簸箕中选择完整种子并进行泡发)\r\n" +
}); "\n2.再用%广枯宁水剂浸泡1012小时待种子吸胀后捞起滤干备用。这种方法既能有效防治病害又能保证高粱产品的有机品质"
}); ;
UI_ContentPanel.instance.fizhi();
Bootstrap.Instance.uiManager.HidePanel<UI_FineSoilPreparationPanel>();
CameraManager.instance.Camera.transform.SetPositionAndRotation
(CameraManager.instance.StepTrans[0].transform.position, CameraManager.instance.StepTrans[0].transform.rotation);
}); UI_ContentPanel.instance.Tips = "";
} }
break;
case "育苗前种子处理":
Debug.Log("育苗前种子处理");
UI_ContentPanel.instance.Tips = "1.选种是为了淘汰瘦小、损伤、虫蛀和霉变的种子选出粒大饱满、外观光滑且有光泽的籽粒。选种方法包括风选和筛选风选可用风车或簸箕将枇子、虫蛀等籽粒扇掉筛选则使用3.5毫米-4毫米孔径的筛子筛去小粒种子。选种后种子发芽率更高出苗整齐一致有利于培育壮苗。(在簸箕中选择完整种子并进行泡发)\r\n" +
"\n2.再用%广枯宁水剂浸泡1012小时待种子吸胀后捞起滤干备用。这种方法既能有效防治病害又能保证高粱产品的有机品质"
;
UI_ContentPanel.instance.fizhi();
Bootstrap.Instance.uiManager.HidePanel<UI_FineSoilPreparationPanel>();
CameraManager.instance.Camera.transform.SetPositionAndRotation
(CameraManager.instance.StepTrans[0].transform.position, CameraManager.instance.StepTrans[0].transform.rotation);
UI_ContentPanel.instance.Tips = "";
break; break;
case "播撒育苗技术流程": case "播撒育苗技术流程":
Debug.Log("播撒育苗技术流程"); Debug.Log("播撒育苗技术流程");