The Renderer class
The Renderer
class lists a bunch of stuff that might look like so much gibberish to you. It has these lists:
Variables
Messages sent
Inherited variables
Inherited functions
Inherited class functions
From that list, the only familiar word might be "functions", which we just learned are reusable bundles of code (or endlessly eatable sandwiches, if you prefer). As we write more code in this chapter, we'll come to understand what variables are. For now, focus on the things listed under the Variables section.
One of the variables is called enabled
. Do you remember when you wrote renderer.enabled = false;
? You've already used a variable, perhaps without knowing it. And, check it out—some of the other things that we noticed in the Mesh Renderer component are listed here. There are variables called castShadows
and receiveShadows
, which we saw as checkboxes in the Inspector panel. There are also some material-related variables. At the bottom of the list, there's a variable called isVisible...