Choices to shape your future. Choose from a wide variety of graduate and professional programs, from optometry and health professions to education, writing and social work. Become a leader in healthcare with Pacific University's wide selection of health professions programs.
GetComponent() is a Unity method from the MonoBehaviour class that is used to access data on other components. To fully understand how this method works, you have to wrap your head around a few different concepts.
Function. Getters and setters, or accessor methods, provide access to an object's properties. A get method returns the value of a property held by an object. A get method has a return type matching the type of the associated member variable.he accepted convention is to name get and set methods for the associated member variable (for example, getName and setName, associated with the variable name), prefixed with get or set.. Not all member variables may have associated accessor methods.