From 53f6f2eea62bc4481f929ce477240a0eb6d06ac9 Mon Sep 17 00:00:00 2001 From: lq <3298408835@qq.com> Date: Mon, 2 Dec 2024 19:40:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E9=85=8D=E7=BD=AE=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Prefabs/itemPrefabs/btSceneChoose.prefab | 8 +- .../Prefabs/itemPrefabs/btnDutyChoose.prefab | 10 +- .../itemPrefabs/btnPlayerChoose.prefab | 8 +- xiaofang/Assets/Scenes/Schedule_03.unity | 207 +++++++++--------- xiaofang/Assets/Script/Scheduled_03/Panel.cs | 44 ++-- .../Script/UI/PanelUI/SelectScenePanel.cs | 2 +- 6 files changed, 142 insertions(+), 137 deletions(-) diff --git a/xiaofang/Assets/Prefabs/itemPrefabs/btSceneChoose.prefab b/xiaofang/Assets/Prefabs/itemPrefabs/btSceneChoose.prefab index 0d0114dc..7a234712 100644 --- a/xiaofang/Assets/Prefabs/itemPrefabs/btSceneChoose.prefab +++ b/xiaofang/Assets/Prefabs/itemPrefabs/btSceneChoose.prefab @@ -112,9 +112,15 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 888f2cd11d6d3ea4c9383ac4808687dc, type: 3} m_Name: m_EditorClassIdentifier: + sceneId: 0 + sceneType: 0 sceneName: {fileID: 5207661254087907526} sceneImage: {fileID: 0} maskImage: {fileID: 0} + roleLimit: + limitNum: 0 + dutyId: 0 + jsonReader: {fileID: 0} --- !u!1 &5207661254004645194 GameObject: m_ObjectHideFlags: 0 @@ -204,7 +210,7 @@ GameObject: - component: {fileID: 5207661254087907526} - component: {fileID: 5207661254087907527} m_Layer: 5 - m_Name: Text (Legacy) + m_Name: TextBtn m_TagString: Scene m_Icon: {fileID: 0} m_NavMeshLayer: 0 diff --git a/xiaofang/Assets/Prefabs/itemPrefabs/btnDutyChoose.prefab b/xiaofang/Assets/Prefabs/itemPrefabs/btnDutyChoose.prefab index a7b77ad0..67f8ee0f 100644 --- a/xiaofang/Assets/Prefabs/itemPrefabs/btnDutyChoose.prefab +++ b/xiaofang/Assets/Prefabs/itemPrefabs/btnDutyChoose.prefab @@ -89,7 +89,7 @@ GameObject: - component: {fileID: 3344224971532102837} - component: {fileID: 3344224971532102794} m_Layer: 5 - m_Name: Text (Legacy) + m_Name: TextBtn m_TagString: Duty m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -202,12 +202,12 @@ MonoBehaviour: m_PersistentCalls: m_Calls: - m_Target: {fileID: 0} - m_TargetAssemblyTypeName: - m_MethodName: - m_Mode: 1 + m_TargetAssemblyTypeName: Panel, Assembly-CSharp + m_MethodName: OnPeopleItemClicked + m_Mode: 2 m_Arguments: m_ObjectArgument: {fileID: 0} - m_ObjectArgumentAssemblyTypeName: + m_ObjectArgumentAssemblyTypeName: UnityEngine.GameObject, UnityEngine m_IntArgument: 0 m_FloatArgument: 0 m_StringArgument: diff --git a/xiaofang/Assets/Prefabs/itemPrefabs/btnPlayerChoose.prefab b/xiaofang/Assets/Prefabs/itemPrefabs/btnPlayerChoose.prefab index fc270f27..788628dd 100644 --- a/xiaofang/Assets/Prefabs/itemPrefabs/btnPlayerChoose.prefab +++ b/xiaofang/Assets/Prefabs/itemPrefabs/btnPlayerChoose.prefab @@ -33,9 +33,9 @@ RectTransform: m_Father: {fileID: 0} 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: 194.0772, y: -29.2995} m_SizeDelta: {x: 388.1544, y: 58.599} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &3854006045193366972 @@ -68,7 +68,7 @@ GameObject: - component: {fileID: 4204671801752310761} - component: {fileID: 4204671801752310760} m_Layer: 5 - m_Name: Text (Legacy) + m_Name: TextBtn m_TagString: People m_Icon: {fileID: 0} m_NavMeshLayer: 0 diff --git a/xiaofang/Assets/Scenes/Schedule_03.unity b/xiaofang/Assets/Scenes/Schedule_03.unity index 1e57f1d2..38e64527 100644 --- a/xiaofang/Assets/Scenes/Schedule_03.unity +++ b/xiaofang/Assets/Scenes/Schedule_03.unity @@ -2240,7 +2240,7 @@ MonoBehaviour: eventSystem: {fileID: 1579865912} ManagerPanel: {fileID: 617308871} peopleCountent: {fileID: 667280287} - peoplePrefab: {fileID: 1921476198} + peoplePrefab: {fileID: 4204671800070690484, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} panelContent: {fileID: 1145997501} dutyPrefab: {fileID: 3344224972021141760, guid: 4f774e025e4a15442aedb0588ab62396, type: 3} dutyCount: {fileID: 1034927193} @@ -2516,8 +2516,7 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 1921476199} + m_Children: [] m_Father: {fileID: 1432888497} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -6520,7 +6519,8 @@ RectTransform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: [] + m_Children: + - {fileID: 3900195428984076543} m_Father: {fileID: 1324221058} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -11405,16 +11405,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1910307861} m_CullTransparentMesh: 1 ---- !u!1 &1921476198 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 4204671800070690484, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - m_PrefabInstance: {fileID: 4204671801455259858} - m_PrefabAsset: {fileID: 0} ---- !u!224 &1921476199 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 4204671800070690485, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - m_PrefabInstance: {fileID: 4204671801455259858} - m_PrefabAsset: {fileID: 0} --- !u!1 &1933500136 GameObject: m_ObjectHideFlags: 0 @@ -12829,107 +12819,112 @@ MonoBehaviour: m_EditorClassIdentifier: m_HorizontalFit: 0 m_VerticalFit: 2 ---- !u!1001 &4204671801455259858 +--- !u!1001 &3900195428984076542 PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: - m_TransformParent: {fileID: 667280287} + m_TransformParent: {fileID: 1034927193} m_Modifications: - - target: {fileID: 4204671800070690484, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - propertyPath: m_Name - value: btnPlayerChoose - objectReference: {fileID: 0} - - target: {fileID: 4204671800070690485, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - propertyPath: m_Pivot.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 4204671800070690485, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - propertyPath: m_Pivot.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 4204671800070690485, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - propertyPath: m_RootOrder - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4204671800070690485, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - propertyPath: m_AnchorMax.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4204671800070690485, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4204671800070690485, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - propertyPath: m_AnchorMin.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4204671800070690485, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - propertyPath: m_AnchorMin.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4204671800070690485, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - propertyPath: m_SizeDelta.x - value: 388.1544 - objectReference: {fileID: 0} - - target: {fileID: 4204671800070690485, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - propertyPath: m_SizeDelta.y - value: 58.599 - objectReference: {fileID: 0} - - target: {fileID: 4204671800070690485, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4204671800070690485, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4204671800070690485, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4204671800070690485, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4204671800070690485, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4204671800070690485, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4204671800070690485, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4204671800070690485, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - propertyPath: m_AnchoredPosition.x - value: 194.0772 - objectReference: {fileID: 0} - - target: {fileID: 4204671800070690485, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - propertyPath: m_AnchoredPosition.y - value: -29.2995 - objectReference: {fileID: 0} - - target: {fileID: 4204671800070690485, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4204671800070690485, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4204671800070690485, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4204671801752310760, guid: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} + - 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: 5e14c4abba3cf1a4099ba76ddf50a689, type: 3} + 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 &5745561351200648224 GameObject: m_ObjectHideFlags: 0 diff --git a/xiaofang/Assets/Script/Scheduled_03/Panel.cs b/xiaofang/Assets/Script/Scheduled_03/Panel.cs index 6ce19ece..50666757 100644 --- a/xiaofang/Assets/Script/Scheduled_03/Panel.cs +++ b/xiaofang/Assets/Script/Scheduled_03/Panel.cs @@ -55,6 +55,8 @@ public class Panel : MonoBehaviour public List peopleList = new List(); // 存储所有已加载的人员预制体 private List filteredPeopleList = new List(); // 存储筛选后的人员列表 private GameObject selectedPerson = null; // 当前选中的角色 + private GameObject selectedDuty = null;//当前选中职责 + private GameObject selectedScene = null;//当前选中场景 public SelectedInfo selectedInfo; public Dictionary> sceneDataDictionary = new Dictionary>();//不同的场景存取不同的人员数据 public ManagerPanel managerPanel1; @@ -81,6 +83,8 @@ public class Panel : MonoBehaviour SetText(); //SetInputFile(); } + + //==================================================================动态加载======================================================= //动态加载人员 public void DynamicLoadingPeople() { @@ -88,7 +92,8 @@ public class Panel : MonoBehaviour { GameObject item = GameObject.Instantiate(peoplePrefab, peopleCountent); PeopleItem peopleItem = item.GetComponent(); - + Button peoplebutton = item.transform.Find("TextBtn").GetComponent