62 lines
1.5 KiB
C#
62 lines
1.5 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Player : MonoBehaviour
|
|
{
|
|
|
|
public static Player CSZS;
|
|
|
|
public Dictionary<string, List<string>> PlayerID = new Dictionary<string, List<string>>()
|
|
{
|
|
{ "主持人", new List<string>() },
|
|
{ "总指挥", new List<string>() },
|
|
{ "抢险救援组", new List<string>() },
|
|
{ "(组长)抢险救援组", new List<string>() },
|
|
{ "医疗救护组", new List<string>() },
|
|
{ "(组长)医疗救护", new List<string>() },
|
|
{ "疏散引导组1", new List<string>() },
|
|
{ "疏散引导组2", new List<string>() },
|
|
{ "后勤保障组", new List<string>() },
|
|
{ "(组长)后期保障", new List<string>() },
|
|
{ "搜寻组", new List<string>() },
|
|
{ "学生寝室长", new List<string>() }
|
|
};
|
|
|
|
private void Awake()
|
|
{
|
|
CSZS = this;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 接收玩家接受的任务
|
|
/// </summary>
|
|
public void SetPlayerID(string ID, string Task)
|
|
{
|
|
if (PlayerID.ContainsKey(ID))
|
|
{
|
|
PlayerID[ID].Add(Task); // 添加任务
|
|
}
|
|
else
|
|
{
|
|
Debug.Log("颠仔没有这个职业");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 返回一个职业接取的任务
|
|
/// </summary>
|
|
public List<string> GetPlayerID(string ID)
|
|
{
|
|
if (PlayerID.TryGetValue(ID, out List<string> value))
|
|
{
|
|
return value; // 返回对应的 List<string>
|
|
}
|
|
else
|
|
{
|
|
Debug.Log("颠仔找不到");
|
|
return new List<string>(); // 返回空列表
|
|
}
|
|
}
|
|
}
|