Now, to populate the public variables, we will perform the following steps:
- First, we need the ParticleSystems package that comes with Unity standard assets. If you do not have them, navigate to Assets | Import Package | ParticleSystems, choose All, and then click on Import.
- Select GameController from the Hierarchy panel and go to the Kill Target (Script) pane in the Inspector panel.
- Drag the Ethan object from the Hierarchy panel onto the Target field.
- From the main menu bar, navigate to GameObject | Effects | Particle System and name it SparkEmitter.
- Reselect GameController and drag SparkEmitter onto the Hit Effect field.
- In the Project panel, find the Explosion prefab in Assets/Standard Assets/ParticleSystems/Prefabs ...