mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 22:39:22 +00:00
Move many mods to Deprecated folder, fix spelling
This commit is contained in:
parent
5e822cec8d
commit
0042590aa6
539 changed files with 7475 additions and 3120 deletions
67
.Deprecated/AASBufferFix/Utils.cs
Normal file
67
.Deprecated/AASBufferFix/Utils.cs
Normal file
|
@ -0,0 +1,67 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace NAK.AASBufferFix;
|
||||
|
||||
public class Utils
|
||||
{
|
||||
public static int GenerateAnimatorAASFootprint(Animator animator)
|
||||
{
|
||||
int avatarFloatCount = 0;
|
||||
int avatarIntCount = 0;
|
||||
int avatarBoolCount = 0;
|
||||
int bitCount = 0;
|
||||
|
||||
foreach (AnimatorControllerParameter animatorControllerParameter in animator.parameters)
|
||||
{
|
||||
// Do not count above bit limit
|
||||
if (!(bitCount <= 3200))
|
||||
break;
|
||||
|
||||
if (animatorControllerParameter.name.Length > 0 && animatorControllerParameter.name[0] != '#' && !coreParameters.Contains(animatorControllerParameter.name))
|
||||
{
|
||||
AnimatorControllerParameterType type = animatorControllerParameter.type;
|
||||
switch (type)
|
||||
{
|
||||
case AnimatorControllerParameterType.Float:
|
||||
avatarFloatCount++;
|
||||
bitCount += 32;
|
||||
break;
|
||||
case AnimatorControllerParameterType.Int:
|
||||
avatarIntCount++;
|
||||
bitCount += 32;
|
||||
break;
|
||||
case AnimatorControllerParameterType.Bool:
|
||||
avatarBoolCount++;
|
||||
bitCount++;
|
||||
break;
|
||||
default:
|
||||
//we dont count triggers
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//bool to byte
|
||||
avatarBoolCount = ((int)Math.Ceiling((double)avatarBoolCount / 8));
|
||||
|
||||
//create the footprint
|
||||
|
||||
return (avatarFloatCount + 1) * (avatarIntCount + 1) * (avatarBoolCount + 1);
|
||||
}
|
||||
|
||||
private static readonly HashSet<string> coreParameters = new HashSet<string>
|
||||
{
|
||||
"MovementX",
|
||||
"MovementY",
|
||||
"Grounded",
|
||||
"Emote",
|
||||
"GestureLeft",
|
||||
"GestureRight",
|
||||
"Toggle",
|
||||
"Sitting",
|
||||
"Crouching",
|
||||
"CancelEmote",
|
||||
"Prone",
|
||||
"Flying"
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue