mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-06 13:15:45 -05:00
* MeshUtility を UniGLTF 下に移動 * Assets/VRM10 を追加 * JsonSchemaからのコード生成 UniGLTF/Editor/Generator を追加
25 lines
567 B
C#
25 lines
567 B
C#
namespace VrmLib
|
|
{
|
|
public static class IndexExtensions
|
|
{
|
|
public static bool TryGetValidIndex(this int? index, int count, out int outValue)
|
|
{
|
|
outValue = -1;
|
|
if (!index.HasValue)
|
|
{
|
|
return false;
|
|
}
|
|
var value = index.Value;
|
|
if (value < 0)
|
|
{
|
|
return false;
|
|
}
|
|
if (value >= count)
|
|
{
|
|
return false;
|
|
}
|
|
outValue = value;
|
|
return true;
|
|
}
|
|
}
|
|
} |