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

23 lines
465 B
C#

namespace UniVRM10
{
public static class IndexExtensions
{
public static bool TryGetValidIndex(this int value, int count, out int index)
{
if (value < 0)
{
index = -1;
return false;
}
if (value >= count)
{
index = -1;
return false;
}
index = value;
return true;
}
}
}