金铉Unity插件库 Unity版本2018.4.32f 目前包含本地化存储功能(根据类名存储读写),TCP客户端监听类型功能
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
589 B

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class MultiKeyDictionary<T1, T2, T3> : Dictionary<T1, Dictionary<T2, T3>>
{
new public Dictionary<T2, T3> this[T1 key]
{
get
{
if (!ContainsKey(key))
Add(key, new Dictionary<T2, T3>());
Dictionary<T2, T3> returnObj;
TryGetValue(key, out returnObj);
return returnObj;
}
}
public bool ContainsKey(T1 key1, T2 key2)
{
Dictionary<T2, T3> returnObj;
TryGetValue(key1, out returnObj);
if (returnObj == null)
return false;
return returnObj.ContainsKey(key2);
}
}