mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-04 15:29:22 +00:00
[AvatarScaleMod] Test 2: Height Request
Now requests initial height on instance join instead of syncing every 10s. Reworked inbould & outbound message queue. Fixed potential race condition where scalefactor could become 0. A lot of this is still incredibly jank. Just trying to get things working before cleanup.
This commit is contained in:
parent
d599f57973
commit
c7eb5715ba
7 changed files with 440 additions and 146 deletions
|
@ -16,22 +16,26 @@ public static class ModNetworkDebugger
|
|||
if (AvatarScaleManager.Instance == null)
|
||||
return;
|
||||
|
||||
float currentHeight = AvatarScaleManager.Instance.GetHeight();
|
||||
float currentHeight;
|
||||
const float step = 0.1f;
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.Equals) || Input.GetKeyDown(KeyCode.KeypadPlus))
|
||||
{
|
||||
currentHeight += step;
|
||||
AvatarScaleMod.Logger.Msg($"Networking height: {currentHeight}");
|
||||
currentHeight = AvatarScaleManager.Instance.GetHeight();
|
||||
AvatarScaleManager.Instance.SetHeight(currentHeight + step);
|
||||
currentHeight = AvatarScaleManager.Instance.GetHeight();
|
||||
|
||||
ModNetwork.SendNetworkHeight(currentHeight);
|
||||
AvatarScaleManager.Instance.SetHeight(currentHeight);
|
||||
AvatarScaleMod.Logger.Msg($"Networking height: {currentHeight}");
|
||||
}
|
||||
else if (Input.GetKeyDown(KeyCode.Minus) || Input.GetKeyDown(KeyCode.KeypadMinus))
|
||||
{
|
||||
currentHeight -= step;
|
||||
AvatarScaleMod.Logger.Msg($"Networking height: {currentHeight}");
|
||||
currentHeight = AvatarScaleManager.Instance.GetHeight();
|
||||
AvatarScaleManager.Instance.SetHeight(currentHeight - step);
|
||||
currentHeight = AvatarScaleManager.Instance.GetHeight();
|
||||
|
||||
ModNetwork.SendNetworkHeight(currentHeight);
|
||||
AvatarScaleManager.Instance.SetHeight(currentHeight);
|
||||
AvatarScaleMod.Logger.Msg($"Networking height: {currentHeight}");
|
||||
}
|
||||
else if (Input.GetKeyDown(KeyCode.Backspace))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue