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,28 +221,19 @@ ulong NextDirtyBits()
|
|||||||
{
|
{
|
||||||
int newIntValue = animator.GetInteger(par.nameHash);
|
int newIntValue = animator.GetInteger(par.nameHash);
|
||||||
changed = newIntValue != lastIntParameters[i];
|
changed = newIntValue != lastIntParameters[i];
|
||||||
if (changed)
|
lastIntParameters[i] = newIntValue;
|
||||||
{
|
|
||||||
lastIntParameters[i] = newIntValue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (par.type == AnimatorControllerParameterType.Float)
|
else if (par.type == AnimatorControllerParameterType.Float)
|
||||||
{
|
{
|
||||||
float newFloatValue = animator.GetFloat(par.nameHash);
|
float newFloatValue = animator.GetFloat(par.nameHash);
|
||||||
changed = Mathf.Abs(newFloatValue - lastFloatParameters[i]) > 0.001f;
|
changed = Mathf.Abs(newFloatValue - lastFloatParameters[i]) > 0.001f;
|
||||||
if (changed)
|
lastFloatParameters[i] = newFloatValue;
|
||||||
{
|
|
||||||
lastFloatParameters[i] = newFloatValue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (par.type == AnimatorControllerParameterType.Bool)
|
else if (par.type == AnimatorControllerParameterType.Bool)
|
||||||
{
|
{
|
||||||
bool newBoolValue = animator.GetBool(par.nameHash);
|
bool newBoolValue = animator.GetBool(par.nameHash);
|
||||||
changed = newBoolValue != lastBoolParameters[i];
|
changed = newBoolValue != lastBoolParameters[i];
|
||||||
if (changed)
|
lastBoolParameters[i] = newBoolValue;
|
||||||
{
|
|
||||||
lastBoolParameters[i] = newBoolValue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (changed)
|
if (changed)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user