难度传值修改

This commit is contained in:
lq 2024-12-23 14:28:02 +08:00
parent e7920a7662
commit ec305be7cb
7 changed files with 141 additions and 50 deletions

View File

@ -25,18 +25,18 @@ RectTransform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4498060909466071809}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5900002970331946163}
m_RootOrder: 1
m_Father: {fileID: 7531194149634478661}
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_SizeDelta: {x: 513.89, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 779.9408, y: 21}
m_SizeDelta: {x: 467.2219, y: 42}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7577960020006578146
CanvasRenderer:
@ -76,10 +76,10 @@ MonoBehaviour:
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_HorizontalOverflow: 1
m_VerticalOverflow: 1
m_LineSpacing: 1
m_Text: "\u8FD8\u7F3A\u81F3\u5C111\u540D\u4EC0\u4E48\u4EC0\u4E48\u804C\u4E1A"
m_Text: "\u8FD8\u7F3A\u81F3\u5C111\u540D\u533B\u7597\u6551\u62A4"
--- !u!1 &5900002969924403205
GameObject:
m_ObjectHideFlags: 0
@ -268,7 +268,7 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 5900002970044280994}
- {fileID: 8838300892937481870}
- {fileID: 7531194149634478661}
- {fileID: 5900002970821547561}
m_Father: {fileID: 5900002971020626570}
m_RootOrder: 1
@ -604,6 +604,7 @@ MonoBehaviour:
personelPanelText: {fileID: 5900002971283911308}
personelNumText: {fileID: 5900002969924403207}
lockText: {fileID: 5757504950814517587}
lockBg: {fileID: 8597188645527605400}
personelContent: {fileID: 5900002971599260874}
personelItem: {fileID: 6026028542083999128, guid: 93710d87e1c578748b4ef94ce0d38198, type: 3}
firstLablePrefab: {fileID: 0}
@ -723,7 +724,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 560.5, y: -109}
m_AnchoredPosition: {x: 560.5, y: -44}
m_SizeDelta: {x: 1121, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &5900002971599260725
@ -784,3 +785,80 @@ MonoBehaviour:
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!1 &8597188645527605400
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7531194149634478661}
- component: {fileID: 6555106214558057608}
- component: {fileID: 7932220027260091179}
m_Layer: 5
m_Name: lackBg
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7531194149634478661
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8597188645527605400}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8838300892937481870}
m_Father: {fileID: 5900002970331946163}
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_SizeDelta: {x: 520.5148, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6555106214558057608
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8597188645527605400}
m_CullTransparentMesh: 1
--- !u!114 &7932220027260091179
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8597188645527605400}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 4536eccb5b41d62469e251412db57216, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1

View File

@ -4091,7 +4091,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 1031840000928267012, guid: f7e3ba3643cbe834083789575336030d, type: 3}
propertyPath: m_RootOrder
value: 3
value: 4
objectReference: {fileID: 0}
- target: {fileID: 1031840000928267012, guid: f7e3ba3643cbe834083789575336030d, type: 3}
propertyPath: m_AnchorMax.x
@ -4891,7 +4891,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 1031840001719723866, guid: f7e3ba3643cbe834083789575336030d, type: 3}
propertyPath: m_AnchoredPosition.x
value: 968.31604
value: 963.7986
objectReference: {fileID: 0}
- target: {fileID: 1031840001719723866, guid: f7e3ba3643cbe834083789575336030d, type: 3}
propertyPath: m_AnchoredPosition.y
@ -5519,7 +5519,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 1031840002484896209, guid: f7e3ba3643cbe834083789575336030d, type: 3}
propertyPath: m_AnchoredPosition.x
value: 407.8161
value: 137.80115
objectReference: {fileID: 0}
- target: {fileID: 1031840002484896209, guid: f7e3ba3643cbe834083789575336030d, type: 3}
propertyPath: m_AnchoredPosition.y
@ -5729,6 +5729,26 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: -17.5
objectReference: {fileID: 0}
- target: {fileID: 3978082958181212982, guid: f7e3ba3643cbe834083789575336030d, type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3978082958181212982, guid: f7e3ba3643cbe834083789575336030d, type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3978082958181212982, guid: f7e3ba3643cbe834083789575336030d, type: 3}
propertyPath: m_SizeDelta.y
value: 42
objectReference: {fileID: 0}
- target: {fileID: 3978082958181212982, guid: f7e3ba3643cbe834083789575336030d, type: 3}
propertyPath: m_AnchoredPosition.x
value: 546.3399
objectReference: {fileID: 0}
- target: {fileID: 3978082958181212982, guid: f7e3ba3643cbe834083789575336030d, type: 3}
propertyPath: m_AnchoredPosition.y
value: -21
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f7e3ba3643cbe834083789575336030d, type: 3}
--- !u!224 &856136727 stripped
@ -9176,8 +9196,8 @@ RectTransform:
- {fileID: 618256459}
- {fileID: 7468736064579811971}
- {fileID: 617308872}
- {fileID: 856136727}
- {fileID: 7318934474885050404}
- {fileID: 856136727}
- {fileID: 700683836}
m_Father: {fileID: 0}
m_RootOrder: 2
@ -13613,7 +13633,7 @@ RectTransform:
m_Children:
- {fileID: 7318934475829044879}
m_Father: {fileID: 1592869153}
m_RootOrder: 4
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}

View File

@ -115,27 +115,27 @@ public class Panel : Base
//动态加载人员
public async void DynamicLoadingPeople()
{
//for (int i = 0; i < 10; i++)
//{
// GameObject item = GameObject.Instantiate<GameObject>(peoplePrefab, peopleCountent);
// PeopleItem peopleItem = item.GetComponent<PeopleItem>();
// peopleItem.nameText.text = "角色1";
// peopleItem.peopleId = "0";
// Button peoplebutton = item.transform.Find("TextBtn").GetComponent<Button>();
// peoplebutton.onClick.AddListener(() => OnPeopleItemClicked(item, Color.yellow, selectedPerson));
// peopleList.Add(item);// 将每个实例化的角色添加到列表中
//}
PlayerListResponse playerListResponse = await userInfo.GetPlayerList();
foreach (PlayerListData player in playerListResponse.data)
for (int i = 0; i < 10; i++)
{
GameObject item = GameObject.Instantiate<GameObject>(peoplePrefab, peopleCountent);
PeopleItem peopleItem = item.GetComponent<PeopleItem>();
peopleItem.nameText.text = player.NickName;
peopleItem.peopleId = player.UserId;
peopleItem.nameText.text = "角色1";
peopleItem.peopleId = "0";
Button peoplebutton = item.transform.Find("TextBtn").GetComponent<Button>();
peoplebutton.onClick.AddListener(() => OnPeopleItemClicked(item, Color.yellow, selectedPerson));
peopleList.Add(item);// 将每个实例化的角色添加到列表中
}
//PlayerListResponse playerListResponse = await userInfo.GetPlayerList();
//foreach (PlayerListData player in playerListResponse.data)
//{
// GameObject item = GameObject.Instantiate<GameObject>(peoplePrefab, peopleCountent);
// PeopleItem peopleItem = item.GetComponent<PeopleItem>();
// peopleItem.nameText.text = player.NickName;
// peopleItem.peopleId = player.UserId;
// Button peoplebutton = item.transform.Find("TextBtn").GetComponent<Button>();
// peoplebutton.onClick.AddListener(() => OnPeopleItemClicked(item, Color.yellow, selectedPerson));
// peopleList.Add(item);// 将每个实例化的角色添加到列表中
//}
}
//动态加载职责

View File

@ -49,11 +49,17 @@ public class DistributionPanel : MonoBehaviour
{
string a=CheckMissingRoles(scene.sceneId);
scenetext.lockText.text = a;
if(a==null)
{
scenetext.lockBg.SetActive(false);
}
else
{
scenetext.lockBg.SetActive(true);
}
}
}
}
public void CreateFirstLable()
{
GameObject fistLable = Instantiate<GameObject>(personnelLable, personnelContent);
@ -62,7 +68,6 @@ public class DistributionPanel : MonoBehaviour
public string CheckMissingRoles(string sceneID)
{
List<SelectedInfo> info = null;
// 遍历字典中的每一个条目
foreach (var entry in panel.sceneDataDictionary)
{
@ -82,41 +87,34 @@ public class DistributionPanel : MonoBehaviour
break;
}
}
if (info != null)
{
string roleLimit = jsonReader.GetAreaDateById(int.Parse(sceneID)).RoleLimit;
string[] sceneLimits = roleLimit.Split('|');
// 存储已选择的职业ID集合
HashSet<string> selectedDutyIds = new HashSet<string>();
// 遍历所有已选择的角色提取职业ID
foreach (var selectedInfo in info)
{
selectedDutyIds.Add(selectedInfo.dutyId);
}
// 存储缺少的职业ID
List<string> missingDutyIds = new List<string>();
// 获取选中的场景和难度ID
string selectedSceneId = selectScenePanel.idcidentId.ToString();
string selectedDifficultyId = selectScenePanel.difficultyId.ToString();
// 遍历每个限制条件,检查是否缺少职业
foreach (var sceneLimit in sceneLimits)
{
string[] limit = sceneLimit.Split(',');
if (limit.Length == 4)
{
string sceneLimitId = limit[0];
string difficultyLimitId = limit[1];
string dutyId = limit[2];
string dutyNum = limit[3];
// 检查是否符合场景ID和难度ID的条件
if (sceneLimitId == selectedSceneId && difficultyLimitId == selectedDifficultyId)
if (sceneLimitId == selectedSceneId && difficultyLimitId == selectedDifficultyId&& dutyNum!="-1")
{
// 检查是否缺少职业
if (!selectedDutyIds.Contains(dutyId))

View File

@ -65,24 +65,18 @@ public class ManagerPanel : MonoBehaviour
// 点击项时调用
public void OnItemClicked(GameObject clickedItem)
{
// 如果有之前选中的项,恢复其原始大小
if (currentSelectedItem != null)
{
RectTransform rt = currentSelectedItem.GetComponent<RectTransform>();
rt.localScale = originalScale; // 恢复原始大小
}
// 记录当前选中项的原始大小
RectTransform clickedItemRT = clickedItem.GetComponent<RectTransform>();
if (originalScale == Vector3.zero)
{
originalScale = clickedItemRT.localScale; // 只记录一次原始大小
}
// 更新当前选中的项
currentSelectedItem = clickedItem;
// 放大当前选中的项
clickedItemRT.localScale = originalScale * 1.2f; // 放大1.2倍
// 使当前选中的项居中显示
//CenterOnItem(clickedItemRT);
}
// 使选中的项居中显示

View File

@ -9,6 +9,7 @@ public class PersonnelPanel : MonoBehaviour
public Text personelPanelText;
public Text personelNumText;
public Text lockText;
public GameObject lockBg;
public Transform personelContent;
public GameObject personelItem;
public GameObject firstLablePrefab;

View File

@ -413,7 +413,7 @@ public class SelectScenePanel : Base
DifficultyInfo difficultyInfo = item.GetComponent<DifficultyInfo>();
this.difficultyId = difficultyInfo.difficulty;
this.difficulty = item.transform.GetComponentInChildren<Text>().text;
createTemplateInfo.Instance.auth_CreateTemplate.mode = this.difficulty;
createTemplateInfo.Instance.auth_CreateTemplate.mode = this.difficultyId.ToString();
}
}
}