- Unity 3.x Game Development by Example Beginner's Guide
- Ryan Henson Creighton
- 358字
- 2021-04-02 18:34:13
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
, which appears to do something different than the enabled
variable.
Have a go hero - Pulling the wings off of flies
If you were the type of kid who disassembled your parents' clock radio, or got up close and personal with the insects in your backyard to see what made them tick, this is your time to shine. The Language Reference is your gateway to every special reserved word ("keyword") in the Unity language. Try clicking on the enabled
variable in that list. The resulting page not only repeats the explanation of the variable, but it also provides an example of how you might use that variable in code. You can even use the drop-down lists on the right to see the C# and Boo translations. (Go ahead check them out! Fortune favors the bold.)

If you're wired a certain way, you've already thrown this book down and are eagerly scouring the Language Reference looking for code you can mess around with. That's okay. We'll be here when you get back. If you are still a little wary of this foreign language and would like a little more guidance using it, read on.
- DB2 V9權威指南
- JSP網絡編程(學習筆記)
- PHP程序設計(慕課版)
- INSTANT Sencha Touch
- Learn Programming in Python with Cody Jackson
- Windows Server 2012 Unified Remote Access Planning and Deployment
- JavaScript入門經典
- 用戶體驗增長:數字化·智能化·綠色化
- 深入理解Android:Wi-Fi、NFC和GPS卷
- C語言程序設計實驗指導 (第2版)
- 深入淺出React和Redux
- Unity 3D腳本編程:使用C#語言開發跨平臺游戲
- Node.js開發指南
- TypeScript 2.x By Example
- 監控的藝術:云原生時代的監控框架