scene-ref-attribute
scene-ref-attribute copied to clipboard
`SceneAttribute` finds references across all loaded scenes instead of current one
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:
SceneAttributeshould limit its search to the same scene that contains the object being validated.
Steps to reproduce:
- Open two scenes additively in the editor.
- Use
SceneAttributeon a field in aValidatedMonoBehaviourin Scene A. - Assign a reference from Scene B.
- Field has `Scene mismatch' "value".
Suggested fix:
Filter found references so only those from the same Scene as the target GameObject are considered valid.