- Floor map markers now activate properly even if being held at round start.

- Floor map markers now react to round end much more consistently and reliably.
This commit is contained in:
2025-12-06 22:37:27 -05:00
parent 5c26296e05
commit ae22426488
4 changed files with 96 additions and 65 deletions
+14 -7
View File
@@ -150,11 +150,6 @@ public class FloorMapMarker : UdonSharpBehaviour
public void CheckCollisionsLoop()
{
if (Active)
{
SendCustomEventDelayedSeconds(nameof(CheckCollisionsLoop), TIME_BETWEEN_REPEAT_COLLISION_CHECKS);
}
if (_EnableCollisionChecks && !IsGrabbed)
{
if (_CollidingLocations.Count > 0 && IsUpright())
@@ -190,6 +185,11 @@ public class FloorMapMarker : UdonSharpBehaviour
}
}
}
if (Active)
{
SendCustomEventDelayedSeconds(nameof(CheckCollisionsLoop), TIME_BETWEEN_REPEAT_COLLISION_CHECKS);
}
}
@@ -208,7 +208,6 @@ public class FloorMapMarker : UdonSharpBehaviour
{
DisableMovementCompletely(CorrectLocation);
IsLit = true;
Active = false;
_EnableCollisionChecks = false;
_UsedUp = true;
@@ -242,15 +241,22 @@ public class FloorMapMarker : UdonSharpBehaviour
public void Activated(bool SetActive)
{
Active = SetActive;
RequestSerialization();
}
private void ReactToActivation()
{
_PickupComponent.pickupable = Active;
if (IsGrabbed) _EnableCollisionChecks = true;
SendCustomEventDelayedSeconds(nameof(CheckCollisionsLoop), TIME_BETWEEN_REPEAT_COLLISION_CHECKS);
}
[NetworkCallable]
public void SetLit(bool Lit)
{
IsLit = Lit;
RequestSerialization();
}
public bool IsUsedUp()
{
@@ -283,6 +289,7 @@ public class FloorMapMarker : UdonSharpBehaviour
{
_Active = value;
ReactToActivation();
RequestSerialization();
}
get => _Active;
}