public class DicData : MonoBehaviour {
Dictionary<string, string> dic = new Dictionary<string, string>();
private void Start()
{
dic.Add("1", "a");
dic.Add("2", "b");
dic.Add("3", "c");
dic.Add("4", "d");
string value = "";
dic.TryGetValue("1", out value);
Debug.Log(value);
//根据下标
value = dic.ElementAt(0).Value;
Debug.Log(value);
}
}
获取字典内数据
于 2022-08-26 16:08:55 首次发布