Added Dohya

This commit is contained in:
2026-08-29 13:34:57 +03:00
parent f6a7547e84
commit 9f87122a34
1478 changed files with 963649 additions and 35753 deletions
@@ -45,6 +45,7 @@ public sealed class NetworkPhysicalLeverInteractable :
NetworkVariableWritePermission.Server);
private bool hasSnapTarget;
private bool maximumEndpointLatched;
private float snapTargetValue;
private float automaticReturnTime = -1f;
@@ -57,6 +58,7 @@ public sealed class NetworkPhysicalLeverInteractable :
public event Action<float> ValueChanged;
public event Action<bool> StateChanged;
public event Action MaximumReached;
public override string InteractionPrompt => IsControlledByLocalPlayer
? ReleasePrompt
@@ -96,6 +98,7 @@ public sealed class NetworkPhysicalLeverInteractable :
{
synchronizedValue.Value = InitialPositionValue;
isActivated.Value = initialPositionIsMaximum;
maximumEndpointLatched = initialPositionIsMaximum;
}
synchronizedValue.OnValueChanged += HandleValueChanged;
@@ -220,9 +223,24 @@ public sealed class NetworkPhysicalLeverInteractable :
const float endpointTolerance = 0.001f;
if (synchronizedValue.Value >= 1f - endpointTolerance)
{
SetActivation(true);
else if (synchronizedValue.Value <= endpointTolerance)
if (!maximumEndpointLatched)
{
maximumEndpointLatched = true;
MaximumReached?.Invoke();
}
}
else
{
maximumEndpointLatched = false;
}
if (synchronizedValue.Value <= endpointTolerance)
{
maximumEndpointLatched = false;
SetActivation(false);
}
}
private void SetActivation(bool activated)