diff --git a/Editor/PreviewSystem/Rendering/ProxyObjectController.cs b/Editor/PreviewSystem/Rendering/ProxyObjectController.cs index a86db9d..ff7b183 100644 --- a/Editor/PreviewSystem/Rendering/ProxyObjectController.cs +++ b/Editor/PreviewSystem/Rendering/ProxyObjectController.cs @@ -152,24 +152,25 @@ internal bool OnPreFrame() { _pickingOffOriginal = SceneVisibilityManager.instance.IsPickingDisabled(original.gameObject); _visibilityOffOriginal = SceneVisibilityManager.instance.IsHidden(original.gameObject); - } - - target.enabled = false; - - bool shouldDisablePicking = _pickingOffOriginal || _visibilityOffOriginal; - if (shouldDisablePicking != _pickingOffReplacement) - { - if (shouldDisablePicking) - { - SceneVisibilityManager.instance.DisablePicking(target.gameObject, false); - } - else + var pickingOffTarget = SceneVisibilityManager.instance.IsPickingDisabled(target.gameObject); + if (_pickingOffOriginal != pickingOffTarget) { - SceneVisibilityManager.instance.EnablePicking(target.gameObject, false); + if (_pickingOffOriginal) + { + SceneVisibilityManager.instance.DisablePicking(target.gameObject, false); + } + else + { + SceneVisibilityManager.instance.EnablePicking(target.gameObject, false); + } } + + _lastVisibilityCheck = VisibilityMonitor.Sequence; } + target.enabled = false; + SkinnedMeshRenderer smr = null; if (_originalRenderer is SkinnedMeshRenderer smr_) {