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