mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
simplify parameter change
This commit is contained in:
parent
aba028e74b
commit
c69ae75d6a
@ -221,29 +221,20 @@ ulong NextDirtyBits()
|
||||
{
|
||||
int newIntValue = animator.GetInteger(par.nameHash);
|
||||
changed = newIntValue != lastIntParameters[i];
|
||||
if (changed)
|
||||
{
|
||||
lastIntParameters[i] = newIntValue;
|
||||
}
|
||||
}
|
||||
else if (par.type == AnimatorControllerParameterType.Float)
|
||||
{
|
||||
float newFloatValue = animator.GetFloat(par.nameHash);
|
||||
changed = Mathf.Abs(newFloatValue - lastFloatParameters[i]) > 0.001f;
|
||||
if (changed)
|
||||
{
|
||||
lastFloatParameters[i] = newFloatValue;
|
||||
}
|
||||
}
|
||||
else if (par.type == AnimatorControllerParameterType.Bool)
|
||||
{
|
||||
bool newBoolValue = animator.GetBool(par.nameHash);
|
||||
changed = newBoolValue != lastBoolParameters[i];
|
||||
if (changed)
|
||||
{
|
||||
lastBoolParameters[i] = newBoolValue;
|
||||
}
|
||||
}
|
||||
if (changed)
|
||||
{
|
||||
dirtyBits |= 1ul << i;
|
||||
|
Loading…
Reference in New Issue
Block a user