From e2f480b1ea2d8ae657ea48838e287fb3e56e2699 Mon Sep 17 00:00:00 2001 From: lq <3298408835@qq.com> Date: Sat, 7 Dec 2024 17:47:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaofang/Assets/Scenes/Schedule_03.unity | 157 +++--------------- .../Assets/Script/UI/PanelUI/DatePanel.cs | 2 +- .../Script/UI/PanelUI/SelectScenePanel.cs | 14 +- 3 files changed, 36 insertions(+), 137 deletions(-) diff --git a/xiaofang/Assets/Scenes/Schedule_03.unity b/xiaofang/Assets/Scenes/Schedule_03.unity index 8003c8c0..181f3449 100644 --- a/xiaofang/Assets/Scenes/Schedule_03.unity +++ b/xiaofang/Assets/Scenes/Schedule_03.unity @@ -2133,7 +2133,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &618256459 RectTransform: m_ObjectHideFlags: 0 @@ -2501,7 +2501,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -193.59004, y: 309.8263} - m_SizeDelta: {x: 388.1544, y: 58.599} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 1} --- !u!114 &667280288 MonoBehaviour: @@ -5997,8 +5997,7 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 3900195428984076543} + m_Children: [] m_Father: {fileID: 1324221058} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -9027,7 +9026,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &1600693806 RectTransform: m_ObjectHideFlags: 0 @@ -12238,112 +12237,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_ShowMaskGraphic: 0 ---- !u!1001 &3900195428984076542 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 1034927193} - m_Modifications: - - target: {fileID: 3344224971532102794, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target - value: - objectReference: {fileID: 618256462} - - target: {fileID: 3344224972021141760, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_Name - value: btnDutyChoose - objectReference: {fileID: 0} - - target: {fileID: 3344224972021141763, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_Pivot.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 3344224972021141763, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_Pivot.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 3344224972021141763, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_RootOrder - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3344224972021141763, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_AnchorMax.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3344224972021141763, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3344224972021141763, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_AnchorMin.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3344224972021141763, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3344224972021141763, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_SizeDelta.x - value: 388.1544 - objectReference: {fileID: 0} - - target: {fileID: 3344224972021141763, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_SizeDelta.y - value: 53.678 - objectReference: {fileID: 0} - - target: {fileID: 3344224972021141763, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3344224972021141763, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3344224972021141763, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3344224972021141763, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 3344224972021141763, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3344224972021141763, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3344224972021141763, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3344224972021141763, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3344224972021141763, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3344224972021141763, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3344224972021141763, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3344224972021141763, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} ---- !u!224 &3900195428984076543 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 3344224972021141763, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} - m_PrefabInstance: {fileID: 3900195428984076542} - m_PrefabAsset: {fileID: 0} --- !u!1 &3969360846526504285 GameObject: m_ObjectHideFlags: 0 @@ -12681,7 +12574,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!222 &5745561351907901231 CanvasRenderer: m_ObjectHideFlags: 0 @@ -14733,9 +14626,9 @@ RectTransform: m_Father: {fileID: 7468736063934366934} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 334.1322, y: -55} m_SizeDelta: {x: 187, y: 110} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &7468736064122132329 @@ -15016,9 +14909,9 @@ RectTransform: m_Father: {fileID: 7468736063934366934} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 753.3966, y: -55} m_SizeDelta: {x: 187, y: 110} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &7468736064198941274 @@ -15776,7 +15669,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 3.3229} - m_SizeDelta: {x: 0, y: 0} + m_SizeDelta: {x: 1834, y: 1070} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &7468736064579811972 GameObject: @@ -15798,7 +15691,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!114 &7468736064579811982 MonoBehaviour: m_ObjectHideFlags: 0 @@ -16263,9 +16156,9 @@ RectTransform: m_Father: {fileID: 7468736063934366934} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 543.7644, y: -55} m_SizeDelta: {x: 187, y: 110} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &7468736064659112359 @@ -16469,9 +16362,9 @@ RectTransform: m_Father: {fileID: 7468736064579811971} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 917, y: -53.335} m_SizeDelta: {x: 1834, y: 106.67} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &7468736064728012045 @@ -16631,9 +16524,9 @@ RectTransform: m_Father: {fileID: 7468736063934366934} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 124.5, y: -55} m_SizeDelta: {x: 187, y: 110} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &7468736064820222392 @@ -17044,9 +16937,9 @@ RectTransform: m_Father: {fileID: 7468736064579811971} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 917, y: -588.33496} m_SizeDelta: {x: 1834, y: 498.685} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &7468736064937661071 diff --git a/xiaofang/Assets/Script/UI/PanelUI/DatePanel.cs b/xiaofang/Assets/Script/UI/PanelUI/DatePanel.cs index b3b374cc..68fb1ace 100644 --- a/xiaofang/Assets/Script/UI/PanelUI/DatePanel.cs +++ b/xiaofang/Assets/Script/UI/PanelUI/DatePanel.cs @@ -43,7 +43,7 @@ public class DatePanel : MonoBehaviour //提交按钮 public void OnClickSubmitPanel() - { + { createTemplateInfo.Instance.auth_CreateTemplate.subjectId = PlaceText.text; if (preservationToggle.isOn==true) { diff --git a/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs b/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs index 3e299f55..c9fcec31 100644 --- a/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs +++ b/xiaofang/Assets/Script/UI/PanelUI/SelectScenePanel.cs @@ -167,6 +167,10 @@ public class SelectScenePanel : MonoBehaviour toggle.group = incidentGroup; toggle.isOn = false; incidentInfos.Add(item); + if (incidentInfos.Count > 1) + { + + } } else { @@ -246,6 +250,7 @@ public class SelectScenePanel : MonoBehaviour eventInfoList.Add(item); evnetsceneList.Add(toggle); } + //添加点击事件 toggle.onValueChanged.AddListener((isSelected) => { if (isSelected) // 只有当Toggle被选中时,才调用SelectEventBtn @@ -265,7 +270,6 @@ public class SelectScenePanel : MonoBehaviour InstantiateIncidentPrefab(int.Parse(disasterLocation)); OnRandomEventClick(); } - createTemplateInfo.Instance.auth_CreateTemplate.sceneId = item.eventId.ToString(); } }); @@ -341,7 +345,6 @@ public class SelectScenePanel : MonoBehaviour //随机事件 public void OnRandomEventClick() { - // 随机选择一个事件 if (eventInfoList.Count > 1) { @@ -415,7 +418,6 @@ public class SelectScenePanel : MonoBehaviour { SelectEvent(); SelsctDifficulty(); - //SelectEvnentBtn(); SetDataPanelInfo(); this.gameObject.SetActive(false); panel.gameObject.SetActive(true); @@ -480,6 +482,7 @@ public class SelectScenePanel : MonoBehaviour { bool anyToggleSelected = false; bool anyeventSelected = false; + bool isOk = false; Debug.Log("evnetsceneList>>>>"+ evnetsceneList.Count()); // 检查场景选择 foreach (Toggle toggle in evnetsceneList) @@ -495,16 +498,19 @@ public class SelectScenePanel : MonoBehaviour if (toggle.isOn) { anyeventSelected = true; + Debug.LogError("事件选择:" + anyeventSelected); break; // 如果有一个场景 Toggle 被选中,停止检查 } } // 根据是否有 Toggle 被选中,设置 ContinueBtn 是否可交互 if (submitBtn != null && anyToggleSelected == true&& anyeventSelected==true) { - submitBtn.interactable = anyToggleSelected; // 如果有选中的 Toggle,继续按钮可交互,否则不可交互 + isOk = true; + submitBtn.interactable = isOk; // 如果有选中的 Toggle,继续按钮可交互,否则不可交互 } else { + submitBtn.interactable = isOk; Debug.LogWarning("提交按钮组件未找到!"); } }