public void OnPick(InputAction.CallbackContext context) { if (context.performed) { Debug.Log("On pick called"); if (currentPickable == null) { return; } IPickable p = currentPickable.gameObject.GetComponent <IPickable>(); if (p != null) { Debug.Log("Picking up pickable"); p.OnPick(picker); pickables.Remove(currentPickable); } } }