using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// 对Dictionary扩展
/// </summary>
public static class DictionaryExtension
{
//尝试根据Key得到Value,得到的话直接返回Value,没得到返回Null
//this Dictionary<TKey, TValue> dic代表要获取值的字典
public static TValue TryGet<TKey, TValue>(this Dictionary<TKey, TValue> dic, TKey key)
{
TValue value;
dic.TryGetValue(key, out value);
return value;
}
}