Lab 7 - Clicky Mouse
Lab 7 - Clicky Mouse
Open Package
• Go to Assets à Import
Go Package à Custom Package.
• Add Box Collider • Create a new script, • Drag all 4 targets into
components to target Target.cs, attach it to the Prefabs folder to
objects ( “Good 1”, all target objects. create “original
“Good 2”, “Good 3”, prefabs”, then delete
and “Bad 1”), then them from the scene.
make sure that
Colliders surround
the objects properly.
Toss Targets in the Air
In Target.cs,
In Start(),
declare the
initialize the
variables as
targetRb
shown.
Toss Targets in the Air
•
•
Spawn Objects with Coroutine
•
•
•
Destroy the Targets with Click & Sensor
•
•
•
The name of your object in hierarchy
Score Text (exact spelling)
•
•
•
•
Score Text
•
Add Particle Explosion •
•
Add Sound Effects •
•
Add Sound Effects
•
Add Sound Effects Some cleaning up needs to be done.
First, for each Target, Add Component à Audio Source.
Next, we need to delay the Destroy call, or else the audio will not be heard.
Use coroutine to fix this problem.
First, create an IEnumerator method to destroy the object, then call the
coroutine when the object needs to be destroyed.
TO DO