Whats is m_Terrain being assigned as in following lines of code?
Is this just a funny way to say m_Terrain = terain?
Transform terain = GameObject.Find("Terrain");
m_Terrain = terain.GetComponent(typeof(Terrain)) as Terrain;
Whats is m_Terrain being assigned as in following lines of code?
Is this just a funny way to say m_Terrain = terain?
Transform terain = GameObject.Find("Terrain");
m_Terrain = terain.GetComponent(typeof(Terrain)) as Terrain;
The first line picks a GameObject named “Terrain” (this is just a object name). The second line picks a Terrain component for the object in the first line. This is the way to access the Terrain class from a GameObject and use its own methods/attributes.
Take a look at the examples at http://docs.unity3d.com/Documentation/ScriptReference/index.Accessing_Other_Game_Objects.html