You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I imagine it like this when the cursor is on the field:
[ light bulb ] private Image _image;
Pressing on the light bulb, the following menu entry will be available:
"Require Component >"
Pressing this, [RequireComponent(typeof(Image))] will be added to the class
When pressing on the ">", the options "Assign at Start()" and "Assign at Awake()" appear.
Both will add the tag to the class and additionally add code to the according magic functions:
Note this could also be triggered with a quick-fix on the RequireComponent attribute itself, rather than initiating it from a field in the class. (in case the user started his work there first)
I would like to have a helper function for creating "RequireComponent"-Tags.
See: https://docs.unity3d.com/ScriptReference/RequireComponent.html
I imagine it like this when the cursor is on the field:
[ light bulb ]
private Image _image;
Pressing on the light bulb, the following menu entry will be available:
"Require Component >"
Pressing this,
[RequireComponent(typeof(Image))]
will be added to the classWhen pressing on the ">", the options "Assign at Start()" and "Assign at Awake()" appear.
Both will add the tag to the class and additionally add code to the according magic functions:
Assign at Start() =
void Start() { _image = GetComponent<Image>(); }
Assign at Awake() =
void Awake() { _image = GetComponent<Image>(); }
The text was updated successfully, but these errors were encountered: