Game Development Reference
In-Depth Information
Figure 7-20. The occlusion trigger
2.
Name it Occluder , and check Is Trigger on its collider.
3.
Create a new C# Script in the Game Scripts folder, and name it
OcclusionManager .
4.
Open the script.
5.
Beneath the class declaration, create the following variables:
public bool state; //active state to put the array elements into
public GameObject[] newArea; // array for the other side of the gate
6.
Save the script, and put it on the Occlusion object.
7.
In the Inspector, open the New Area array.
The New Area array will include Common Wall 1 and the Staging Area, the objects on the other side
of the wall. So its Size will be 2.
8.
Set the array Size to 2 .
9.
Drag the appropriate gameObjects into the array elements (Figure 7-21 ).
 
Search WWH ::




Custom Search