2024-12-19 21:36:02 +08:00
|
|
|
|
using Newtonsoft.Json.Schema;
|
|
|
|
|
using System;
|
2024-12-19 14:11:11 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
2024-12-19 21:36:02 +08:00
|
|
|
|
using UnityEditor.Search.Providers;
|
2024-12-19 14:11:11 +08:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
public class DistributionPanel : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public GameObject personnelLable;
|
|
|
|
|
public Transform personnelContent;
|
|
|
|
|
public Panel panel;
|
2024-12-19 21:36:02 +08:00
|
|
|
|
public SelectScenePanel selectScenePanel;
|
|
|
|
|
public JSONReader jsonReader;
|
2024-12-19 14:11:11 +08:00
|
|
|
|
// Start is called before the first frame update
|
|
|
|
|
void Start()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
|
void Update()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
public void OnClickPeopleWindows()
|
|
|
|
|
{
|
|
|
|
|
foreach(Transform child in personnelContent)
|
|
|
|
|
{
|
|
|
|
|
Destroy(child.gameObject);
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-19 21:36:02 +08:00
|
|
|
|
public void CreateAllLable()
|
|
|
|
|
{
|
|
|
|
|
foreach (Transform child in personnelContent)
|
|
|
|
|
{
|
|
|
|
|
Destroy(child.gameObject);
|
|
|
|
|
}
|
|
|
|
|
//CreateFirstLable();
|
|
|
|
|
foreach (var sceneEntry in panel.sceneDataDictionary)
|
|
|
|
|
{
|
|
|
|
|
Debug.Log("sceneEntry" +sceneEntry.Key);
|
|
|
|
|
GameObject managerPanelInstance = Instantiate(personnelLable, personnelContent);
|
|
|
|
|
PersonnelPanel scenetext = managerPanelInstance.GetComponent<PersonnelPanel>();
|
|
|
|
|
scenetext.personelPanelText.text = sceneEntry.Key;
|
|
|
|
|
scenetext.personelNumText.text = sceneEntry.Value.Count.ToString();
|
|
|
|
|
scenetext.CreatePeopleItem(sceneEntry.Value);
|
|
|
|
|
foreach(var scene in sceneEntry.Value)
|
|
|
|
|
{
|
|
|
|
|
IsMeet(scene.sceneId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-19 14:11:11 +08:00
|
|
|
|
public void CreateFirstLable()
|
|
|
|
|
{
|
|
|
|
|
GameObject fistLable = Instantiate<GameObject>(personnelLable, personnelContent);
|
|
|
|
|
PersonnelInfo personnelItem = fistLable.GetComponent<PersonnelInfo>();
|
2024-12-19 21:36:02 +08:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//<2F>ж<EFBFBD><D0B6><EFBFBD>Ա<EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
public void IsMeet(string sceneID)
|
|
|
|
|
{
|
|
|
|
|
List<SelectedInfo> info = null;
|
|
|
|
|
panel.sceneDataDictionary.TryGetValue(sceneID, out info);
|
|
|
|
|
// <20><><EFBFBD>Դ<EFBFBD><D4B4>ֵ<EFBFBD><D6B5>л<EFBFBD>ȡsceneID<49><44>Ӧ<EFBFBD><D3A6><EFBFBD>б<EFBFBD>
|
|
|
|
|
if (panel.sceneDataDictionary.TryGetValue(sceneID, out info))
|
|
|
|
|
{Debug.LogError(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
|
|
|
|
string roleLimit = jsonReader.GetAreaDateById(int.Parse(sceneID)).RoleLimit;
|
|
|
|
|
string[] sceneLimit = roleLimit.Split('|');
|
|
|
|
|
foreach (string limitStr in sceneLimit)
|
|
|
|
|
{
|
|
|
|
|
string[] limit = limitStr.Split(",");
|
|
|
|
|
if (limit.Length == 4)
|
|
|
|
|
{
|
|
|
|
|
if (limit[0] == selectScenePanel.idcidentId.ToString() &&limit[1] == selectScenePanel.difficultyId.ToString())
|
|
|
|
|
{
|
|
|
|
|
foreach (var selectedInfo in info)
|
|
|
|
|
{
|
|
|
|
|
if (limit[2] == selectedInfo.dutyId.ToString())
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("û<><C3BB><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>Ӧ<EFBFBD>ij<EFBFBD><C4B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>");
|
|
|
|
|
}
|
2024-12-19 14:11:11 +08:00
|
|
|
|
}
|
2024-12-19 21:36:02 +08:00
|
|
|
|
|
2024-12-19 14:11:11 +08:00
|
|
|
|
}
|