Skip to content

gnatogryz/injector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is this

This is a convenience thing to make things convenient. A lazy-init function + injector for Unity serialized fields.

How to do things

Lazy init example of a camera component:

Camera _cam;
public Camera camera => this.Lazy(ref _cam);

Inject a component from hierarchy (editor-only):

[FindInChildrenByName]
public UnityEngine.UI.Button acceptButton;
[FindInChildrenByName("acceptButton")]
public UnityEngine.UI.Image acceptButtonImage;

The injection occurs on script reload, scene save etc. Not in runtime. The injection is verbose, which means you'll get feedback on found/missing components.

See it do stuff:

IMAGE ALT TEXT HERE

About

Unity scene reference injection tool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages