UniVRM/Assets/VRM10/Runtime/UnityBuilder/DictionaryExtensions.cs
ousttrue d53942a7bd merge vrm10
* MeshUtility を UniGLTF 下に移動
* Assets/VRM10 を追加
* JsonSchemaからのコード生成 UniGLTF/Editor/Generator を追加
2021-01-07 13:37:24 +09:00

24 lines
470 B
C#

using System.Collections.Generic;
namespace UniVRM10
{
public static class DictionaryExtensions
{
public static U GetOrDefault<T, U>(this Dictionary<T, U> d, T key)
{
if(key == null)
{
return default;
}
if(d.TryGetValue(key, out U value))
{
return value;;
}
else{
return default;
}
}
}
}