Compare commits
2 Commits
4f934c717b
...
e402949286
Author | SHA1 | Date | |
---|---|---|---|
e402949286 | |||
587ef1aec3 |
@ -10315,6 +10315,18 @@ PrefabInstance:
|
|||||||
propertyPath: jueseChoicePanel
|
propertyPath: jueseChoicePanel
|
||||||
value:
|
value:
|
||||||
objectReference: {fileID: 1799705462}
|
objectReference: {fileID: 1799705462}
|
||||||
|
- target: {fileID: 2102021661377337229, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||||
|
propertyPath: showImage.Array.size
|
||||||
|
value: 2
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 2102021661377337229, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||||
|
propertyPath: showImage.Array.data[0]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 21300000, guid: 586c4520a2c6c8d4e9bac48ed427f617, type: 3}
|
||||||
|
- target: {fileID: 2102021661377337229, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||||
|
propertyPath: showImage.Array.data[1]
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 21300000, guid: 0905bd7a17d75af4985c19c47bfe7fc7, type: 3}
|
||||||
- target: {fileID: 4764228630647718977, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
- target: {fileID: 4764228630647718977, guid: 86668fbe8407a8741bb903177bc93fdb, type: 3}
|
||||||
propertyPath: m_AnchorMax.y
|
propertyPath: m_AnchorMax.y
|
||||||
value: 0
|
value: 0
|
||||||
|
@ -10,6 +10,7 @@ using UnityEngine;
|
|||||||
using UnityEngine.Events;
|
using UnityEngine.Events;
|
||||||
using UnityEngine.EventSystems;
|
using UnityEngine.EventSystems;
|
||||||
using UnityEngine.SceneManagement;
|
using UnityEngine.SceneManagement;
|
||||||
|
using UnityEngine.SocialPlatforms;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
public class SelectedInfo
|
public class SelectedInfo
|
||||||
@ -96,6 +97,8 @@ public class Panel : MonoBehaviour
|
|||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
|
sureBtn.interactable = false;
|
||||||
|
ChangeImage(sureBtn.interactable);
|
||||||
selectedInfo = new SelectedInfo();
|
selectedInfo = new SelectedInfo();
|
||||||
InstantiateToggle();
|
InstantiateToggle();
|
||||||
}
|
}
|
||||||
@ -112,18 +115,29 @@ public class Panel : MonoBehaviour
|
|||||||
//动态加载人员
|
//动态加载人员
|
||||||
public async void DynamicLoadingPeople()
|
public async void DynamicLoadingPeople()
|
||||||
{
|
{
|
||||||
PlayerListResponse playerListResponse=await userInfo.GetPlayerList();
|
for(int i=0;i<10;i++)
|
||||||
foreach(PlayerListData player in playerListResponse.data)
|
|
||||||
{
|
{
|
||||||
GameObject item = GameObject.Instantiate<GameObject>(peoplePrefab, peopleCountent);
|
GameObject item = GameObject.Instantiate<GameObject>(peoplePrefab, peopleCountent);
|
||||||
PeopleItem peopleItem = item.GetComponent<PeopleItem>();
|
PeopleItem peopleItem = item.GetComponent<PeopleItem>();
|
||||||
peopleItem.nameText.text = player.NickName;
|
peopleItem.nameText.text = "角色1";
|
||||||
peopleItem.peopleId = player.UserId;
|
peopleItem.peopleId = "0";
|
||||||
Button peoplebutton = item.transform.Find("TextBtn").GetComponent<Button>();
|
Button peoplebutton = item.transform.Find("TextBtn").GetComponent<Button>();
|
||||||
peoplebutton.onClick.AddListener(() => OnPeopleItemClicked(item, Color.yellow, selectedPerson));
|
peoplebutton.onClick.AddListener(() => OnPeopleItemClicked(item, Color.yellow, selectedPerson));
|
||||||
peopleList.Add(item);// 将每个实例化的角色添加到列表中
|
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);// 将每个实例化的角色添加到列表中
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
//动态加载职责
|
//动态加载职责
|
||||||
public void DynamicLoadingDuty(int id,int idcidentId)
|
public void DynamicLoadingDuty(int id,int idcidentId)
|
||||||
{
|
{
|
||||||
@ -180,6 +194,7 @@ public class Panel : MonoBehaviour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//动态加载场景
|
//动态加载场景
|
||||||
public void DynamicLoadingScene()
|
public void DynamicLoadingScene()
|
||||||
{
|
{
|
||||||
@ -377,6 +392,66 @@ public class Panel : MonoBehaviour
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
//处理点击确认按钮
|
//处理点击确认按钮
|
||||||
|
//public void ClickSureBtn()
|
||||||
|
//{
|
||||||
|
// // 只有在选择了人员、职责和场景的情况下,才会执行后续操作
|
||||||
|
// if (isPersonSelected && isDutySelected && isSceneSelected)
|
||||||
|
// {
|
||||||
|
// // 保存选中的人员信息到场景数据字典中
|
||||||
|
// string sceneName = selectedInfo.scene;
|
||||||
|
// // 如果场景字典中没有这个场景,先创建一个空列表
|
||||||
|
// if (!sceneDataDictionary.ContainsKey(sceneName))
|
||||||
|
// {
|
||||||
|
// sceneDataDictionary[sceneName] = new List<SelectedInfo>();
|
||||||
|
// }
|
||||||
|
// // 需要判断是否达到了职责的人员上限
|
||||||
|
// bool isLimitReached = false;
|
||||||
|
// // 获取当前场景中的所有人员信息
|
||||||
|
// List<SelectedInfo> currentSceneInfo = sceneDataDictionary[sceneName];
|
||||||
|
// // 如果选中了“主持人”、“各组长”或“总指挥”,则限制数量为1
|
||||||
|
// if (selectedInfo.duty == "主持人" || selectedInfo.duty == "组长" || selectedInfo.duty == "总指挥")
|
||||||
|
// {
|
||||||
|
// int count = currentSceneInfo.Count(info => info.duty == selectedInfo.duty); // 统计当前职责人数
|
||||||
|
|
||||||
|
// if (count >= 1) // 如果已经有1个此职责的人选
|
||||||
|
// {
|
||||||
|
// isLimitReached = true; // 标记限制已达
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// // 如果没有达到上限,则可以添加人员信息
|
||||||
|
// if (!isLimitReached)
|
||||||
|
// {
|
||||||
|
// // 通过创建一个新的 SelectedInfo 实例来避免引用同一个对象
|
||||||
|
// SelectedInfo newSelectedInfo = new SelectedInfo
|
||||||
|
// {
|
||||||
|
// name = selectedInfo.name,
|
||||||
|
// duty = selectedInfo.duty,
|
||||||
|
// scene = selectedInfo.scene,
|
||||||
|
// dutyId = selectedInfo.dutyId,
|
||||||
|
// sceneId = selectedInfo.sceneId,
|
||||||
|
// peopleId=selectedInfo.peopleId
|
||||||
|
// };
|
||||||
|
|
||||||
|
// // 将当前选中的人员信息添加到对应场景的人员列表中
|
||||||
|
// currentSceneInfo.Add(newSelectedInfo);
|
||||||
|
|
||||||
|
// // 禁用确认按钮并清空选择标志
|
||||||
|
// sureBtn.interactable = false;
|
||||||
|
// ChangeImage(sureBtn.interactable);
|
||||||
|
// isPersonSelected = false;
|
||||||
|
// isDutySelected = false;
|
||||||
|
// isSceneSelected = false;
|
||||||
|
// UploadData(peopleId = selectedInfo.peopleId, selectedInfo.dutyId.ToString(), selectedInfo.sceneId.ToString());
|
||||||
|
// // 改变已添加人员的显示颜色
|
||||||
|
// UpdatePeopleListVisual();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// Debug.LogError("请确保选择了人员、职责和场景!");
|
||||||
|
// }
|
||||||
|
// datePanel.NumberText.text = "共" + (sceneDataDictionary.Keys.Count * sceneDataDictionary.Values.Count).ToString() + "人参与";
|
||||||
|
//}
|
||||||
public void ClickSureBtn()
|
public void ClickSureBtn()
|
||||||
{
|
{
|
||||||
// 只有在选择了人员、职责和场景的情况下,才会执行后续操作
|
// 只有在选择了人员、职责和场景的情况下,才会执行后续操作
|
||||||
@ -384,30 +459,59 @@ public class Panel : MonoBehaviour
|
|||||||
{
|
{
|
||||||
// 保存选中的人员信息到场景数据字典中
|
// 保存选中的人员信息到场景数据字典中
|
||||||
string sceneName = selectedInfo.scene;
|
string sceneName = selectedInfo.scene;
|
||||||
|
|
||||||
// 如果场景字典中没有这个场景,先创建一个空列表
|
// 如果场景字典中没有这个场景,先创建一个空列表
|
||||||
if (!sceneDataDictionary.ContainsKey(sceneName))
|
if (!sceneDataDictionary.ContainsKey(sceneName))
|
||||||
{
|
{
|
||||||
sceneDataDictionary[sceneName] = new List<SelectedInfo>();
|
sceneDataDictionary[sceneName] = new List<SelectedInfo>();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 需要判断是否达到了职责的人员上限
|
// 1. 判断整个 sceneDataDictionary 中是否存在相同的人名
|
||||||
|
SelectedInfo existingPerson = null;
|
||||||
|
string existingSceneName = null;
|
||||||
|
|
||||||
|
foreach (var sceneEntry in sceneDataDictionary)
|
||||||
|
{
|
||||||
|
existingPerson = sceneEntry.Value.FirstOrDefault(info => info.name == selectedInfo.name);
|
||||||
|
if (existingPerson != null)
|
||||||
|
{
|
||||||
|
existingSceneName = sceneEntry.Key;
|
||||||
|
break; // 找到后立即退出循环
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 如果找到了相同的人名,删除旧的记录
|
||||||
|
if (existingPerson != null)
|
||||||
|
{
|
||||||
|
sceneDataDictionary[existingSceneName].Remove(existingPerson);
|
||||||
|
Debug.Log($"Removed existing person: {existingPerson.name} from scene: {existingSceneName}");
|
||||||
|
|
||||||
|
// 判断该场景是否还有剩余的角色,如果没有,删除该场景
|
||||||
|
if (sceneDataDictionary[existingSceneName].Count == 0)
|
||||||
|
{
|
||||||
|
sceneDataDictionary.Remove(existingSceneName);
|
||||||
|
Debug.Log($"Removed empty scene: {existingSceneName} because it has no more roles.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 需要判断是否达到了职责的人员上限(当前场景)
|
||||||
bool isLimitReached = false;
|
bool isLimitReached = false;
|
||||||
// 获取当前场景中的所有人员信息
|
|
||||||
List<SelectedInfo> currentSceneInfo = sceneDataDictionary[sceneName];
|
List<SelectedInfo> currentSceneInfo = sceneDataDictionary[sceneName];
|
||||||
|
|
||||||
// 如果选中了“主持人”、“各组长”或“总指挥”,则限制数量为1
|
// 如果选中了“主持人”、“各组长”或“总指挥”,则限制数量为1
|
||||||
if (selectedInfo.duty == "主持人" || selectedInfo.duty == "组长" || selectedInfo.duty == "总指挥")
|
if (selectedInfo.duty == "主持人" || selectedInfo.duty == "组长" || selectedInfo.duty == "总指挥")
|
||||||
{
|
{
|
||||||
int count = currentSceneInfo.Count(info => info.duty == selectedInfo.duty); // 统计当前职责人数
|
int count = currentSceneInfo.Count(info => info.duty == selectedInfo.duty); // 统计当前职责人数
|
||||||
|
|
||||||
if (count >= 1) // 如果已经有1个此职责的人选
|
if (count >= 1) // 如果已经有1个此职责的人选
|
||||||
{
|
{
|
||||||
isLimitReached = true; // 标记限制已达
|
isLimitReached = true; // 标记限制已达
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 如果没有达到上限,则可以添加人员信息
|
|
||||||
|
// 4. 如果没有达到上限,则可以添加人员信息
|
||||||
if (!isLimitReached)
|
if (!isLimitReached)
|
||||||
{
|
{
|
||||||
// 通过创建一个新的 SelectedInfo 实例来避免引用同一个对象
|
// 创建一个新的 SelectedInfo 实例
|
||||||
SelectedInfo newSelectedInfo = new SelectedInfo
|
SelectedInfo newSelectedInfo = new SelectedInfo
|
||||||
{
|
{
|
||||||
name = selectedInfo.name,
|
name = selectedInfo.name,
|
||||||
@ -423,21 +527,34 @@ public class Panel : MonoBehaviour
|
|||||||
|
|
||||||
// 禁用确认按钮并清空选择标志
|
// 禁用确认按钮并清空选择标志
|
||||||
sureBtn.interactable = false;
|
sureBtn.interactable = false;
|
||||||
|
ChangeImage(sureBtn.interactable);
|
||||||
isPersonSelected = false;
|
isPersonSelected = false;
|
||||||
isDutySelected = false;
|
isDutySelected = false;
|
||||||
isSceneSelected = false;
|
isSceneSelected = false;
|
||||||
UploadData(peopleId = selectedInfo.peopleId, selectedInfo.dutyId.ToString(), selectedInfo.sceneId.ToString());
|
|
||||||
// 改变已添加人员的显示颜色
|
// 上传数据
|
||||||
|
UploadData(selectedInfo.peopleId, selectedInfo.dutyId.ToString(), selectedInfo.sceneId.ToString());
|
||||||
|
|
||||||
|
// 更新已添加人员的显示颜色
|
||||||
UpdatePeopleListVisual();
|
UpdatePeopleListVisual();
|
||||||
|
|
||||||
|
Debug.Log($"Added new person: {newSelectedInfo.name} to scene: {sceneName}");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogWarning("当前职责人数已达上限,无法添加新的人员!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.LogError("请确保选择了人员、职责和场景!");
|
Debug.LogError("请确保选择了人员、职责和场景!");
|
||||||
}
|
}
|
||||||
datePanel.NumberText.text = "共" + (sceneDataDictionary.Keys.Count * sceneDataDictionary.Values.Count).ToString() + "人参与";
|
|
||||||
|
// 更新统计人数的文本显示
|
||||||
|
datePanel.NumberText.text = "共" + sceneDataDictionary.Sum(kvp => kvp.Value.Count).ToString() + "人参与";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//处理界面关闭按钮
|
//处理界面关闭按钮
|
||||||
public void ClickCloseBtn()
|
public void ClickCloseBtn()
|
||||||
{
|
{
|
||||||
@ -514,7 +631,6 @@ public class Panel : MonoBehaviour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据选择情况,启用或禁用确认按钮
|
// 根据选择情况,启用或禁用确认按钮
|
||||||
UpdateConfirmButtonState();
|
UpdateConfirmButtonState();
|
||||||
}
|
}
|
||||||
@ -549,6 +665,7 @@ public class Panel : MonoBehaviour
|
|||||||
if(isDutySelected)
|
if(isDutySelected)
|
||||||
// 如果人员、职责和场景都已选择,则启用确认按钮,否则禁用
|
// 如果人员、职责和场景都已选择,则启用确认按钮,否则禁用
|
||||||
sureBtn.interactable = isPersonSelected && isDutySelected && isSceneSelected;
|
sureBtn.interactable = isPersonSelected && isDutySelected && isSceneSelected;
|
||||||
|
ChangeImage(sureBtn.interactable);
|
||||||
}
|
}
|
||||||
|
|
||||||
//设置安排文字
|
//设置安排文字
|
||||||
@ -671,13 +788,14 @@ public class Panel : MonoBehaviour
|
|||||||
Text personText = personItem.GetComponentInChildren<Text>();
|
Text personText = personItem.GetComponentInChildren<Text>();
|
||||||
|
|
||||||
if (personText != null)
|
if (personText != null)
|
||||||
{
|
{Debug.LogError("INININNIININININININININININININININININININI");
|
||||||
// 检查该人员是否已经添加到当前场景
|
// 检查该人员是否已经添加到当前场景
|
||||||
bool isPersonAdded = sceneDataDictionary[selectedInfo.scene].Any(info => info.name == personText.text);
|
bool isPersonAdded = sceneDataDictionary[selectedInfo.scene].Any(info => info.name == personText.text);
|
||||||
|
|
||||||
// 如果该人员已经被添加到场景,改变颜色为灰色
|
// 如果该人员已经被添加到场景,改变颜色为灰色
|
||||||
if (isPersonAdded)
|
if (isPersonAdded)
|
||||||
{
|
{
|
||||||
|
|
||||||
personText.color = Color.blue; // 已添加人员的颜色
|
personText.color = Color.blue; // 已添加人员的颜色
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -705,6 +823,19 @@ public class Panel : MonoBehaviour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//确定的按钮图片修改
|
||||||
|
public void ChangeImage(bool isSure)
|
||||||
|
{
|
||||||
|
if (isSure)
|
||||||
|
{
|
||||||
|
sureBtn.transform.GetComponent<Image>().sprite = toggleImage[1];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sureBtn.transform.GetComponent<Image>().sprite = toggleImage[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using Unity.VisualScripting;
|
using Unity.VisualScripting;
|
||||||
|
using UnityEditor.Experimental.GraphView;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Networking.Types;
|
using UnityEngine.Networking.Types;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
@ -12,7 +13,6 @@ using static UnityEditor.Progress;
|
|||||||
|
|
||||||
public class EvacuationPanel : MonoBehaviour
|
public class EvacuationPanel : MonoBehaviour
|
||||||
{
|
{
|
||||||
public Dictionary<string, int> distributePeople = new Dictionary<string, int>();// 分配给各个场景的人数
|
|
||||||
public List<PersonnelItem> personnelItems;//左侧区域
|
public List<PersonnelItem> personnelItems;//左侧区域
|
||||||
public Transform personnelContent;
|
public Transform personnelContent;
|
||||||
public Panel panel;
|
public Panel panel;
|
||||||
@ -25,6 +25,7 @@ public class EvacuationPanel : MonoBehaviour
|
|||||||
public Transform content;
|
public Transform content;
|
||||||
public Text topText;
|
public Text topText;
|
||||||
private GameObject selectedScene = null;//当前选中场景
|
private GameObject selectedScene = null;//当前选中场景
|
||||||
|
public Sprite[] showImage;
|
||||||
|
|
||||||
public List<ClassItem> classItemList = new List<ClassItem>();
|
public List<ClassItem> classItemList = new List<ClassItem>();
|
||||||
public List<ClassMate> classMateList = new List<ClassMate>();
|
public List<ClassMate> classMateList = new List<ClassMate>();
|
||||||
@ -53,16 +54,13 @@ public class EvacuationPanel : MonoBehaviour
|
|||||||
|
|
||||||
[Header("可分配列表")]
|
[Header("可分配列表")]
|
||||||
List<int> nonZeroAreas = new List<int>();
|
List<int> nonZeroAreas = new List<int>();
|
||||||
|
|
||||||
public SelectScenePanel selectScene;
|
public SelectScenePanel selectScene;
|
||||||
private HashSet<int> clearedAreas = new HashSet<int>();
|
[Header("被清除的区域")] public List<int> clearRegion=new List<int>();
|
||||||
public List<int> clearRegion=new List<int>();//被清除的区域
|
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
redistributeBtn.interactable = false;
|
redistributeBtn.interactable = false;
|
||||||
//SetNpcType();
|
ChangeImage(redistributeBtn.interactable);
|
||||||
//nonZeroAreas= GetNonZeroNpcRatioAreas();
|
|
||||||
jc = JuesechoicePop.GetComponent<JueseChoicePop>();
|
jc = JuesechoicePop.GetComponent<JueseChoicePop>();
|
||||||
CountsubmitBtn.onClick.AddListener(Submit);
|
CountsubmitBtn.onClick.AddListener(Submit);
|
||||||
submitBtn.onClick.AddListener(totalSubmit);
|
submitBtn.onClick.AddListener(totalSubmit);
|
||||||
@ -137,7 +135,7 @@ public class EvacuationPanel : MonoBehaviour
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
StuCountInputField.text = "";
|
//StuCountInputField.text = "";
|
||||||
|
|
||||||
// 调用分配方法
|
// 调用分配方法
|
||||||
var result = DistributeNpcByRatio(personnelItems, count);
|
var result = DistributeNpcByRatio(personnelItems, count);
|
||||||
@ -232,7 +230,6 @@ public class EvacuationPanel : MonoBehaviour
|
|||||||
foreach(var npcLimit in npcratio)
|
foreach(var npcLimit in npcratio)
|
||||||
{
|
{
|
||||||
string[] limit = npcLimit.Split(',');
|
string[] limit = npcLimit.Split(',');
|
||||||
|
|
||||||
if (limit[0] == selectScene.idcidentId.ToString()&& limit[1] == selectScene.difficultyId.ToString())
|
if (limit[0] == selectScene.idcidentId.ToString()&& limit[1] == selectScene.difficultyId.ToString())
|
||||||
{
|
{
|
||||||
GameObject sceneitem = GameObject.Instantiate(personnelPrefabs, personnelContent);
|
GameObject sceneitem = GameObject.Instantiate(personnelPrefabs, personnelContent);
|
||||||
@ -250,11 +247,14 @@ public class EvacuationPanel : MonoBehaviour
|
|||||||
if (personnelItem.NpcNum > 0)
|
if (personnelItem.NpcNum > 0)
|
||||||
{
|
{
|
||||||
redistributeBtn.interactable=true;
|
redistributeBtn.interactable=true;
|
||||||
|
ChangeImage(redistributeBtn.interactable);
|
||||||
|
redistributeBtn.transform.GetComponent<Image>().sprite = showImage[1];
|
||||||
redistributeBtn.onClick.AddListener(() =>
|
redistributeBtn.onClick.AddListener(() =>
|
||||||
{
|
{
|
||||||
// 清除选定区域的人员数据
|
// 清除选定区域的人员数据
|
||||||
RedistributeLogic(personnelItem.sceneId, personnelItem.NpcNum);
|
RedistributeLogic(personnelItem.sceneId, personnelItem.NpcNum);
|
||||||
redistributeBtn.interactable = false ;
|
redistributeBtn.interactable = false ;
|
||||||
|
ChangeImage(redistributeBtn.interactable);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 清空现有场景下的所有人员UI
|
// 清空现有场景下的所有人员UI
|
||||||
@ -446,4 +446,17 @@ public class EvacuationPanel : MonoBehaviour
|
|||||||
classCount.gameObject.SetActive(false);
|
classCount.gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//重新分配的按钮图片修改
|
||||||
|
public void ChangeImage(bool isSure)
|
||||||
|
{
|
||||||
|
if (isSure)
|
||||||
|
{
|
||||||
|
redistributeBtn.transform.GetComponent<Image>().sprite = showImage[1];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
redistributeBtn.transform.GetComponent<Image>().sprite = showImage[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,10 +47,8 @@ public class MaterialPanel : MonoBehaviour
|
|||||||
{
|
{
|
||||||
MaterialList materialList = new MaterialList();
|
MaterialList materialList = new MaterialList();
|
||||||
materialList.materialId = materialItem.materialId;
|
materialList.materialId = materialItem.materialId;
|
||||||
Debug.Log("materialList.materialId--------------------" + materialList.materialId);
|
|
||||||
materialList.num = materialItem.materialNum;
|
materialList.num = materialItem.materialNum;
|
||||||
createTemplateInfo.Instance.auth_CreateTemplate.materialList.Add(materialList);
|
createTemplateInfo.Instance.auth_CreateTemplate.materialList.Add(materialList);
|
||||||
Debug.Log(materialItem.materialName + " ÊýÁ¿: " + materialItem.GetMaterialNum());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user