mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 22:39:22 +00:00
[NAK_CVR_Mods] Change every instance of "NotAKidOnSteam" to "NotAKidoS"
This commit is contained in:
parent
a6c030955e
commit
7f02d6811f
159 changed files with 711 additions and 294 deletions
|
@ -23,7 +23,7 @@ public class AvatarScaleManager : MonoBehaviour
|
|||
#region Universal Scaling Limits
|
||||
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
// To match AvatarScaleTool: https://github.com/NotAKidOnSteam/AvatarScaleTool/tree/main
|
||||
// To match AvatarScaleTool: https://github.com/NotAKidoS/AvatarScaleTool/tree/main
|
||||
public const float DefaultMinHeight = 0.25f;
|
||||
public const float DefaultMaxHeight = 2.50f;
|
||||
// ReSharper restore MemberCanBePrivate.Global
|
||||
|
@ -275,7 +275,7 @@ public class AvatarScaleManager : MonoBehaviour
|
|||
//doesn't have mod or has no custom height, get from player avatar directly
|
||||
CVRPlayerEntity playerEntity = CVRPlayerManager.Instance.NetworkPlayers.Find((players) => players.Uuid == playerId);
|
||||
if (playerEntity != null && playerEntity.PuppetMaster != null)
|
||||
return playerEntity.PuppetMaster.GetAvatarHeight();
|
||||
return playerEntity.PuppetMaster.netIkController.GetRemoteHeight();
|
||||
|
||||
// player is invalid???
|
||||
return -1f;
|
||||
|
@ -296,8 +296,8 @@ public class AvatarScaleManager : MonoBehaviour
|
|||
{
|
||||
var playerId = puppetMaster._playerDescriptor.ownerId;
|
||||
if (_networkedScalers.TryGetValue(playerId, out NetworkScaler scaler))
|
||||
scaler.OnAvatarInstantiated(puppetMaster.avatarObject, puppetMaster._initialAvatarHeight,
|
||||
puppetMaster.initialAvatarScale);
|
||||
scaler.OnAvatarInstantiated(puppetMaster.avatarObject, puppetMaster.netIkController._initialHeight,
|
||||
puppetMaster.netIkController._initialScale);
|
||||
}
|
||||
|
||||
internal void OnNetworkAvatarDestroyed(PuppetMaster puppetMaster)
|
||||
|
@ -349,8 +349,8 @@ public class AvatarScaleManager : MonoBehaviour
|
|||
NetworkScaler scaler = puppetMaster.gameObject.AddComponent<NetworkScaler>();
|
||||
scaler.Initialize(playerId);
|
||||
|
||||
scaler.OnAvatarInstantiated(puppetMaster.avatarObject, puppetMaster._initialAvatarHeight,
|
||||
puppetMaster.initialAvatarScale);
|
||||
scaler.OnAvatarInstantiated(puppetMaster.avatarObject, puppetMaster.netIkController._initialHeight,
|
||||
puppetMaster.netIkController._initialScale);
|
||||
|
||||
_networkedScalers[playerId] = scaler;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System.Diagnostics;
|
||||
using ABI_RC.Core;
|
||||
using ABI_RC.Core.Util.AnimatorManager;
|
||||
using NAK.AvatarScaleMod.AvatarScaling;
|
||||
using NAK.AvatarScaleMod.ScaledComponents;
|
||||
using UnityEngine;
|
||||
|
@ -178,9 +179,13 @@ public class BaseScaler : MonoBehaviour
|
|||
if (_avatarTransform == null)
|
||||
return false;
|
||||
|
||||
_targetHeightChanged = false;
|
||||
|
||||
ScaleAvatarRoot();
|
||||
UpdateAnimatorParameter();
|
||||
ApplyComponentScaling();
|
||||
|
||||
InvokeTargetHeightChanged();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -195,11 +200,13 @@ public class BaseScaler : MonoBehaviour
|
|||
_targetHeight = _initialHeight;
|
||||
_targetScale = _initialScale;
|
||||
_scaleFactor = 1f;
|
||||
_targetHeightChanged = true;
|
||||
_targetHeightChanged = false;
|
||||
|
||||
ScaleAvatarRoot();
|
||||
UpdateAnimatorParameter();
|
||||
ApplyComponentScaling();
|
||||
|
||||
InvokeTargetHeightReset();
|
||||
}
|
||||
|
||||
private void ScaleAvatarRoot()
|
||||
|
@ -222,17 +229,23 @@ public class BaseScaler : MonoBehaviour
|
|||
if (!_isAvatarInstantiated)
|
||||
return; // no avatar
|
||||
|
||||
if (!_targetHeightChanged
|
||||
&& _useTargetHeight)
|
||||
ScaleAvatarRoot();
|
||||
if (!_shouldForceHeight)
|
||||
return; // using built-in scaling
|
||||
|
||||
if (!_targetHeightChanged)
|
||||
return;
|
||||
// called on state change
|
||||
if (_targetHeightChanged)
|
||||
{
|
||||
if (_useTargetHeight)
|
||||
ApplyTargetHeight();
|
||||
else
|
||||
ResetTargetHeight();
|
||||
_targetHeightChanged = false;
|
||||
InvokeTargetHeightChanged();
|
||||
}
|
||||
|
||||
if (_useTargetHeight)
|
||||
ApplyTargetHeight();
|
||||
else
|
||||
ResetTargetHeight();
|
||||
// called constantly when forcing change
|
||||
if (_shouldForceHeight)
|
||||
ScaleAvatarRoot();
|
||||
}
|
||||
|
||||
internal virtual void OnDestroy()
|
||||
|
@ -241,7 +254,7 @@ public class BaseScaler : MonoBehaviour
|
|||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Component Scaling
|
||||
|
||||
internal static readonly Type[] scalableComponentTypes =
|
||||
|
|
|
@ -35,8 +35,8 @@ public class LocalScaler : BaseScaler
|
|||
if (_animatorManager == null)
|
||||
return;
|
||||
|
||||
_animatorManager.SetAnimatorParameter(ScaleFactorParameterName, _scaleFactor);
|
||||
_animatorManager.SetAnimatorParameter(ScaleFactorParameterNameLocal, _scaleFactor);
|
||||
_animatorManager.SetParameter(ScaleFactorParameterName, _scaleFactor);
|
||||
_animatorManager.SetParameter(ScaleFactorParameterNameLocal, _scaleFactor);
|
||||
}
|
||||
|
||||
public override void LateUpdate()
|
||||
|
@ -84,7 +84,6 @@ public class LocalScaler : BaseScaler
|
|||
// animation scale changed and now will override universal scaling
|
||||
ResetTargetHeight();
|
||||
InvokeAnimatedHeightOverride();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ public class NetworkScaler : BaseScaler
|
|||
|
||||
protected override void UpdateAnimatorParameter()
|
||||
{
|
||||
_animatorManager?.SetAnimatorParameter(ScaleFactorParameterNameLocal, _scaleFactor);
|
||||
_animatorManager?.SetParameter(ScaleFactorParameterNameLocal, _scaleFactor);
|
||||
}
|
||||
|
||||
internal override void OnDestroy()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue