Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion Source/Runtime/Helpers/ClientSimPickupHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,26 @@ public class ClientSimPickupHelper : ClientSimBehaviour, IClientSimPickupable
private VRC_Pickup.PickupHand _heldHand;
private Action<IClientSimPickupable> _forceDropHandler;

private static ClientSimSettings _settings;

private void OnEnable()
{
if (_settings == null)
{
_settings = ClientSimSettings.Instance;
}
}

public static void InitializePickup(VRC_Pickup pickup)
{
ClientSimPickupHelper previousHelper = pickup.gameObject.GetComponent<ClientSimPickupHelper>();
if (previousHelper != null)
{
DestroyImmediate(previousHelper);
pickup.LogWarning($"Destroying old pickup helper on object: {Tools.GetGameObjectPath(pickup.gameObject)}");
if (_settings.displayLogs)
{
pickup.LogWarning($"Destroying old pickup helper on object: {Tools.GetGameObjectPath(pickup.gameObject)}");
}
}

ClientSimPickupHelper helper = pickup.gameObject.AddComponent<ClientSimPickupHelper>();
Expand Down