Game Development Reference
In-Depth Information
Note
We haven't created the EnemyController class yet, so it will show as an error. We
will add that next.
So, we have added properties to hold the selected target as we did with the selected
weapon, a flag, and a property to track whether we can actually select an enemy (as the
player needs to select a weapon first); additionally, we've added a variable to maintain a
record of just how many enemies are left in the battle, which the enemy AI will use to de-
cide how chicken they are or not.
Tip
Instantiating prefabs in the code requires the prefab to be in the Resources folder, be-
cause they are associated with the asset-bundling features. With Unity Pro, you can also
download the asset bundles from the Web and include them in your project at runtime.
With the free version, however, you can only use what is in your project already.
For single objects, it's easier to attach a prefab to the editor and use it from there (either on
an existing class or a static editor class).
Search WWH ::




Custom Search