您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
37 行
1.1 KiB
37 行
1.1 KiB
using UnityEngine;
|
|
|
|
namespace UniVRM10
|
|
{
|
|
public static class Vrm10FirstPersonLayerSettings
|
|
{
|
|
public const int DEFAULT_FIRSTPERSON_ONLY_LAYER = 9;
|
|
public const string FIRSTPERSON_ONLY_LAYER_NAME = "VRMFirstPersonOnly";
|
|
|
|
public const int DEFAULT_THIRDPERSON_ONLY_LAYER = 10;
|
|
public const string THIRDPERSON_ONLY_LAYER_NAME = "VRMThirdPersonOnly";
|
|
|
|
public static int GetLayer(int? arg, string name, int fallback)
|
|
{
|
|
if (arg.HasValue)
|
|
{
|
|
return arg.Value;
|
|
}
|
|
var layer = LayerMask.NameToLayer(name);
|
|
if (layer != -1)
|
|
{
|
|
return layer;
|
|
}
|
|
return fallback;
|
|
}
|
|
|
|
public static int GetFirstPersonOnlyLayer(int? arg)
|
|
{
|
|
return GetLayer(arg, FIRSTPERSON_ONLY_LAYER_NAME, DEFAULT_FIRSTPERSON_ONLY_LAYER);
|
|
}
|
|
|
|
public static int GetThirdPersonOnlyLayer(int? arg)
|
|
{
|
|
return GetLayer(arg, THIRDPERSON_ONLY_LAYER_NAME, DEFAULT_THIRDPERSON_ONLY_LAYER);
|
|
}
|
|
}
|
|
}
|