mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-03 14:59:23 +00:00
[AvatarScaleMod] Quick edge-case fixes.
Fix avatars without scale sliders triggering anim scale change. Fix universal scaling reaching initial height causing a reset.
This commit is contained in:
parent
ff06c20c01
commit
3d50e64af1
2 changed files with 7 additions and 2 deletions
|
@ -65,8 +65,7 @@ public class BaseScaler : MonoBehaviour
|
||||||
if (Math.Abs(height - _targetHeight) < float.Epsilon)
|
if (Math.Abs(height - _targetHeight) < float.Epsilon)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (height < float.Epsilon
|
if (height < float.Epsilon)
|
||||||
|| Math.Abs(height - _initialHeight) < float.Epsilon)
|
|
||||||
{
|
{
|
||||||
ResetHeight();
|
ResetHeight();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -63,9 +63,15 @@ public class LocalScaler : BaseScaler
|
||||||
private bool CheckForAnimationScaleChange()
|
private bool CheckForAnimationScaleChange()
|
||||||
{
|
{
|
||||||
if (_avatarTransform == null) return false;
|
if (_avatarTransform == null) return false;
|
||||||
|
|
||||||
|
//scale matches last recorded animation scale
|
||||||
if (_avatarTransform.localScale == _legacyAnimationScale)
|
if (_avatarTransform.localScale == _legacyAnimationScale)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// avatar may not have scale animation, check if it isn't equal to targetScale
|
||||||
|
if (_avatarTransform.localScale == _targetScale)
|
||||||
|
return false;
|
||||||
|
|
||||||
// scale was likely reset or not initiated
|
// scale was likely reset or not initiated
|
||||||
if (_legacyAnimationScale == Vector3.zero)
|
if (_legacyAnimationScale == Vector3.zero)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue