Learning C# 7 By Developing Games with Unity 2017(Third Edition)
上QQ阅读APP看书,第一时间看更新

Using Unity's documentation

When we begin writing scripts, we will be looking at Unity's documentation quite often, so it's beneficial to know how to access the information we need. For an overview of a topic, we'll use the Reference Manual, and for specific coding details and examples, we'll use the Scripting Reference.

There are a number of ways to access the Unity documentation:

  • Through the Unity website at http://docs.unity3d.com/ScriptReference/index.html.
  • Through the Help menu on the top bar. In this way, you can access a local copy of Unity reference as we can see in the following image. This is worth remembering if there are internet connectivity issues:
  • Let's open Scripting Reference now and search for a GameObject:
  • Through the Help menu next to the component name. This will work only for Unity's built-in, standard components.

This is the place where we can find scripting documentation, answers to our questions, and a lot of example code. You might feel a bit lost right now, but don't worry, this is quite normal. The Unity documentation is really easy to use. For the fastest access to relevant information, use Search scripting... in the topright corner, as shown here:

The whole reason Scripting Reference exists is so that we can look for information as we need it. This will actually make us remember the code that we write over and over, just like our other daily routines and habits. It is a very good idea to take a brief look through the most common Unity objects, such as GameObject, Transform, MonoBehaviour, and Renderer.