We published a plugin open source for Unity so that scripts can find their global dependencies automatically in the editor. Has saved me a lot of time and pain so I hope it will help someone else too!


This will help you by automatically setting references to other global objects like the camera or a specific script you need a reference to.

It's possible to use both private and public fields. Here's an example using SerializeField

[SerializeField, FromScene] private SceneDependency1 _sceneDependency1; 
[SerializeField, FromScene] private SceneDependency2 _sceneDependency2; 
[SerializeField, FromPrefab] private PrefabDependency _prefabDependency; 
  • _sceneDependency1 will be populated with a component from the scene of type SceneDependency1
  • _sceneDependency2 will be populated with a component from the scene of type SceneDependency2
  • _prefabDependency will be populated with a component from the assets folder of type PrefabDependency

We've done our best to describe it on the github page and with the example project.

We have used this in some form or another in our recent projects. The best part is that we can spare some scene commits to avoid merging them.. 

Here's the Github: https://github.com/NilsFantastic/DependencyFinderExampleProject/

We're sharing this in hope it will be a help you too bu we'll also gladly hear feedback about the github page and about the project itself.

Don't be a stranger! :)

Leave a comment

Log in with itch.io to leave a comment.