Miscellaneous Scripts
There are some simple utility scripts included with Core GameKit. Here's what each does:
-
Player Spawner: Found under
Dark Tonic -> Core GameKit -> Spawner -> Player Spawner
. This script can be used to automatically spawn your player, delay respawning by X seconds, and spawn an optional particle prefab as well. This is used in both example Scenes. -
Wave Music Changer: In order to get the Wave Music settings in Global Waves to work, you will need to use another script we have provided. Don't worry, no coding is needed! Simply go to the prefab that contains your music file Audio Source and attach the script by selecting
Dark Tonic -> Core GameKit -> Wave Music Changer
. That's all there is to it! Note that you will not need an Audio Clip in that Audio Source component. It will be replaced at Wave change time by the script. -
Click To Kill Or Damage: Found under
Dark Tonic -> Core GameKit -> Combat -> Click To Kill Or Damage
. This script you can put onto an object that has a single instance in the Scene (Main camera is a good candidate). What it does is, whenever the left mouse button is clicked down or a finger is tapped down (on mobile), it will kill or apply X damage (whichever one you specify) to the first Killable directly under your finger or mouse, determined by a RayCast. The settings are:- Kill Objects: Defaults to checked. When this is checked, the Killable will be killed if you tap or click on it.
- Damage Points To Inflict: Whole number. If Kill Objects is unchecked, the Killable you tap or click will have this number of points damage taken immediately. If that takes its current Hit Points to zero, it will be killed. This script is used in Example Scene 4. Take a look!
Note: There's also a 2d version of this script called Click To Kill Or Damage 2D. That one should be used instead to tap 2d sprites.