scene-ref-attribute icon indicating copy to clipboard operation
scene-ref-attribute copied to clipboard

`SceneAttribute` finds references across all loaded scenes instead of current one

Open ANU-CHEEKI-BREEKI opened this issue 5 months ago • 0 comments

Description:

When using SceneAttribute, it currently finds references in all additively opened scenes.

However, I believe it should only search for references within the scene where the ValidatedMonoBehaviour is located. This is because Unity doesn't support cross-scene references in edit mode anyway.

Expected behavior:

  • SceneAttribute should limit its search to the same scene that contains the object being validated.

Steps to reproduce:

  1. Open two scenes additively in the editor.
  2. Use SceneAttribute on a field in a ValidatedMonoBehaviour in Scene A.
  3. Assign a reference from Scene B.
  4. Field has `Scene mismatch' "value".

Suggested fix:

Filter found references so only those from the same Scene as the target GameObject are considered valid.

ANU-CHEEKI-BREEKI avatar Jul 30 '25 10:07 ANU-CHEEKI-BREEKI