Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

13 Commits

Repository files navigation

QuickRef

Installation

Add from Git URL:

https://github.com/lusties/QuickRef.git?path=Packages/QuickRef

Example Usage

Here's an example of how to use the QuickRef package in Unity:

usingLustie.QuickRef;publicclassExampleBehaviour:MonoBehaviour{//this will automatically reference these Unity Object in Inspector.[GetComponent,SerializeField]privateAudioSourceself_audioSource;[GetComponentInChildren]publicLightchild_light;[GetComponentInParent]publicCameraparent_camera;}

If you want to hide a field from the Inspector, use the [NoDisplay] attribute in order:

[SerializeField]// this for serialize private field[FindObjectOfType]// find object of type[NoDisplay]// hide in normal inspectorprivateCameranoDisplayedCamera;

Attribute List

Attribute List

AttributeDescription
[GetComponent]Automatically references the component on the same GameObject.
[GetComponentInChildren]Automatically references the component in the children of the GameObject.
[GetComponentInParent]Automatically references the component in the parent of the GameObject.
[FindObjectOfType]Finds an object of the specified type in the scene.
[NoDisplay]Hides the field from being displayed in the Inspector.

About

Quick Reference for Unity Object in Inspector

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages