mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-04 23:39:22 +00:00
[AvatarScaleMod] Implement actual avatar scaling as test.
fuckin 30 minutes proof of concept
This commit is contained in:
parent
3d8f392f1d
commit
44d5c7762b
3 changed files with 44 additions and 19 deletions
24
AvatarScale/Utils.cs
Normal file
24
AvatarScale/Utils.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
using ABI_RC.Core;
|
||||
|
||||
namespace NAK.AvatarScaleMod;
|
||||
|
||||
class Utils
|
||||
{
|
||||
public static bool IsSupportedAvatar(CVRAnimatorManager manager)
|
||||
{
|
||||
if (manager.animatorParameterFloatList.Contains(AvatarScaleMod.ParameterName) && manager._animator != null)
|
||||
{
|
||||
if (manager._advancedAvatarIndicesFloat.TryGetValue(AvatarScaleMod.ParameterName, out int index))
|
||||
{
|
||||
return index < manager._advancedAvatarCacheFloat.Count;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static float CalculateParameterValue(float lastAvatarHeight)
|
||||
{
|
||||
float t = (lastAvatarHeight - AvatarScaleMod.MinimumHeight) / (AvatarScaleMod.MaximumHeight - AvatarScaleMod.MinimumHeight);
|
||||
return t;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue