2D Game Kit Reference Guide
Tutorial
Beginner
1 Hour30 Mins
Unity Technologies
Overview
Summary
The best way to use this document is like a reference guide, searching by component or setting you want to know more about. Use the navigation bars to find the section you need. To learn the basics of how to use the Game Kit, check the Walkthrough which provides a good foundation on using the Kit. The Explorer example game included in this project uses all the components we provided for gameplay. To get inspiration or an example of how to use a GameObject, explore the scenes Zone 1 through 5 in the Scenes folder. Important terms and concepts are highlighted with links if you would like to find out more information about them.
Topics we'll cover
Language
English
Recommended Unity Versions
2017.3
Tutorial Materials
Tutorial
2D Game Kit Reference Guide
1.
Ellen
The Ellen Prefab is the Player character for the Game Kit. Aside from the standard platform controls of moving and jumping she can crouch, jump down (through platforms), melee attack and shoot.

Standard movement controls (PC)

She is put together using Sprite Renderer , Animator , Capsule Collider 2D and Rigidbody 2D components as well as a number of custom scripts.
 

Character Controller 2D

The Character Controller 2D script is used to move Ellen within the Scene while obeying physics.
 
  • Grounded Layer Mask: Default Setting: Platform These are the layers which the character can stand on. Having it set to the Platform layer allows Ellen to walk on anything else that is on that layer such as the ground.
  • Grounded Raycast Distance: Default Setting: 0.1 This determines whether Ellen is standing on the ground by using Raycasts from the bottom of her Collider. Increasing this number would make Ellen think the ground is higher and her feet would get stuck in the platform. Lowering this number will make Ellen think the ground is lower causing her to look like she is falling.

Player Input

In this project you can easily remap the input for a player. The Player Input script tells Unity’s Input Manager what controls your game should use. Whether it’s keyboard and mouse or an Xbox One controller, you can change the keys or buttons for your game on this component.
Please note that any changes to this component are per Scene, as you are changing the copy (instance) of the Ellen Prefab. If you have multiple levels in your game and you have changed Ellen’s Player Input, you must hit the Apply button at the top of the Ellen instance. This changes the settings on the original Prefab and ensures that any other instance of Ellen in other levels have the same input.
 
We’ve provided a handy reminder to let you know if you’re looking at an instance. If you see this warning on the Player Input component, click Select Prefab, which takes you to edit the prefab.
 
The settings for Player Input are;
 
  • Input Type: Default Setting: Mouse And Keyboard. The option for the type of input, the options are Mouse and Keyboard or Controller. The default controller type for this Kit is Xbox One.
  • Pause: The key press or button used for pausing the game.
  • Key: The key on the Keyboard pressed for the action.
  • Controller Button: The controller button pressed for the action.
  • Enabled: Whether the action is on or off. Ticked is on, unticked is off.
  • Interact: The key press or button used for interacting with the environment.
  • Key: The key on the Keyboard pressed for the action.
  • Controller Button: The controller button pressed for the action.
  • Enabled: Whether the action is on or off. Ticked is on, unticked is off.
  • Melee Attack: The key press or button used for Ellen swinging her Staff.
  • Key: The key on the Keyboard pressed for the action.
  • Controller Button: The controller button pressed for the action.
  • Enabled: Whether the action is on or off. Ticked is on, unticked is off.
  • Ranged Attack: The key press or button used for Ellen shooting her gun.
  • Key: The key on the Keyboard pressed for the action.
  • Controller Button: The controller button pressed for the action.
  • Enabled: Whether the action is on or off. Ticked is on, unticked is off.
  • Jump: The key press or button used for jumping.
  • Key: The key on the Keyboard pressed for the action.
  • Controller Button: The controller button pressed for the action.
  • Enabled: Whether the action is on or off. Ticked is on, unticked is off.
  • Horizontal: The key press or analogue stick to move left or right.
  • Positive: The key on the keyboard to move the character right (positive on the X axis).
  • Negative: The key on the keyboard to move the character left (negative on the X axis).
  • Controller Axis: The controller analogue stick or button to move left and right.
  • Vertical: The key press or analogue stick to crouch or look up.
  • Positive: The key on the keyboard to move the camera to look up (positive on the Y axis).
  • Negative: The key on the keyboard to crouch (negative on the Y axis).
  • Controller Axis: The controller analogue stick or button to look up and crouch.
  • Persistence Type and Data Tag: For information on how the Data Persistence system works see the Data Persistence section. Whether Melee Attack and Ranged Attack are enabled is the data persisted by this class.

Player Character

 
The Player Character script holds all the information for how Ellen behaves in the game, the settings here affect movement, Audio and Cameras.
If you change any settings, the changes are only applied to the Prefab instance in that Scene. If you would like the changes to happen across all levels in your game, click Apply at the top of the instance for the change to be applied to the Ellen Prefab.
 
  • References: By default you should not need to adjust this.These are all the references the script requires to function.
  • Sprite Renderer: Used to determine which way the character is facing.
  • Damageable: Used to determine the direction of motion when the character is hurt.
  • Melee Damager: Used to enable/disable damage during appropriate animations.
  • Facing Left/Right Bullet Spawn Point: Used as locations to spawn bullets from when firing.
  • Bullet Pool: Used when spawning bullets.
  • Camera Follow Target: Used to control camera positioning relative to the character, which allows behaviour such as maintaining a lead from the character when moving fast.
 
  • Movement Settings: These are the settings for controlling how fast Ellen moves on the ground.
  • Max Speed: Default Setting: 7 How fast Ellen can run.
  • Ground Acceleration: Default Setting: 100 How fast Ellen gets to her Max Speed when on the ground.
  • Ground Deceleration: Default Setting: 100 How fast Ellen slows to a stop when there is no input.
  • Pushing Speed Proportion: Default Setting: 0.5 What proportion of the Max Speed Ellen moves at when pushing a box.
 
  • Airborne Settings: These are the settings for controlling how fast Ellen moves while in the air.
  • Airborne Accel Proportion: Default Setting: 1 What proportion of the Ground Acceleration Ellen uses when in the air.
  • Airborne Decel Proportion: Default Setting: 0.5 What proportion of the Ground Deceleration Ellen uses when in the air.
  • Gravity: Default Setting: 38 How fast Ellen accelerates towards the ground. This also affects the jump height.
  • Jump Speed: Default Setting: 16.5 How fast Ellen takes off from a jump. This affects the jump height.
  • Jump Abort Speed Reduction: Default Setting: 100 The speed at which the jump value is reduced when the jump button is released. This affects jump height.
 
  • Hurt Settings: These settings determine how Ellen moves and appears when she is hurt. For other settings to do with how Ellen reacts to damage see the section of this document on the Damage System.
  • Hurt Jump Angle: Default Setting: 45 When Ellen is hurt she recoils by jumping into the air away from the source of the damage. This is the angle from horizontal at which she jumps.
  • Hurt Jump Speed: Default Setting: 8 How fast Ellen takes off when recoiling from damage.
  • Flickering Duration: Default Setting: 0.05 When Ellen is hurt her sprite turns on and off quickly to produce a flickering effect. This duration sets how long the sprite stays on and off whilst flickering.
 
  • Melee Settings: These are settings for how Ellen moves when she swings her staff. For other settings to do with how Ellen damages things see the section of this document on the Damage System.
  • Melee Attack Dash Speed: Default Setting: 15 The distance at which Ellen dashes horizontally when she attacks with a Staff.
  • Dash While Airborne: Default Setting: Enabled An optional setting to enable a dash during an airborne attack. This sets horizontal movement and does not increment it. If Ellen is already moving horizontally while airborne, this setting may not be noticeable.
 
  • Ranged Settings: These are settings to do with the bullets that are spawned when Ellen is firing her gun.
  • Shots Per Second: Default Setting: 2 The maximum number of bullets that can be spawned per second.
  • Bullet Speed: Default Setting: 30 The speed given to bullets when they are spawned.
  • Holding Gun Timeout Duration: Default Setting: 1.5 How long Ellen continues to hold her gun out after she has stopped firing.
  • Right Bullet Spawn Point Animated: Default Setting: Enabled The bullet spawn point is animated to follow the gun position. By default, the Ellen asset has a bullet spawn position on the right. When she is facing left we mirror the spawn point animation. If you would like to add your own animated sprite that faces to the left, then uncheck this box.
 
  • Audio Settings: By default you should not need to adjust this. We randomise the audio played for Ellen’s various actions so that it does not sound repetitive. These are the references to the RandomAudioPlayers which play the audio.
  • Footstep Audio Player: The RandomAudioPlayer used when Ellen makes a step.
  • Landing Audio Player: The RandomAudioPlayer used when Ellen becomes grounded after being airborne.
  • Hurt Audio Player: The RandomAudioPlayer used when Ellen is damaged.
  • Melee Audio Player: The RandomAudioPlayer used when Ellen does a melee attack.
  • Ranged Attack Audio Player: The RandomAudioPlayer used when Ellen does a ranged attack.
 
  • Camera Follow Settings: Rather than following Ellen, the camera follows a target offset from Ellen’s location. These settings control the offset.
  • Camera Horizontal Facing Offset: Default Setting: 2 The amount the target is offset horizontally in front of Ellen.
  • Camera Horizontal Speed Offset: Default Setting: 0.2 The amount the target is shifted based on Ellen’s horizontal speed.
  • Camera Vertical Input Offset: Default Setting: 2 How much the target is offset vertically based on the player’s input.
  • Max Horizontal Delta Damp Time: Default Setting: 0.4 The amount of time it takes for the target to move horizontally from no offset to its desired horizontal offset.
  • Max Vertical Delta Damp Time: Default Setting: 0.6 The amount of time it takes for the target to move vertically from no offset to its desired vertical offset.
  • Vertical Camera Offset Delay: Default Setting: 1 The amount of time that the up or down input keys need to be held before the target starts to move vertically, so that the player can ‘look up’ or ‘down’.
 
  • Misc Settings: A folder for other settings.
  • Sprite Originally Faces Left: Default Setting: Disabled This refers to the sprite asset itself without any flipping. It is used to determine things like which spawn point bullets should spawn from.

2.
Enemy Behaviour
The Enemy Behaviour Component is applied to Chomper and Spitter, our two enemies in the game. Find these enemies in the project window in Prefabs > Enemies.
Both enemies use the same component, they just use different settings.
 
  • Sprite Faces Left: Check this box if the Sprite should face left.
  • Movement
  • Speed: The speed of the enemy.
  • Gravity: How fast it falls.
  • References
  • Projectile Prefab: The Prefab of the projectile the enemy is to fire (only for projectile enemy).
  • Scanning Settings
  • View Direction: The direction in which the enemy can detect the player. This is depicted with a green circle in the Scene View
  • View FOV: The Field of View the enemy has. This is depicted with a green circle in the Scene View
  • View Distance: How far away the enemy can see the player. This is depicted with a green circle in the Scene View
  • Time Before Target Lost: The amount of time before the enemy will stop chasing or searching the player once the player is out of range.
  • Melee Attack Data Melee attack information, this only applies to Melee enemies like Chomper.
  • Melee Range: The distance away from itself the enemy can hit the player.
  • Melee Damager: The Damager Script on the enemy. See Damage System for more information.
  • Contact Damager: The Contact Damager Script on the enemy, this script causes damage by touching the enemy.
  • Attack Dash: Enables or disables a dash forward when the enemy attacks.
  • Attack Force: The force applied to the Player when they’re attacked. This is what pushes the player back after being attacked.
  • Ranged Attack Data Ranged attack information. This only applies to for ranged enemies like Spitter.
  • Shooting Origin: The position the projectile is shot from.
  • Shoot Angle: The angle at which the projectile is shot from the origin.
  • Shoot Force: The force applied to the projectile.
  • Fire Rate: How fast the projectiles are shot.
  • Audio
  • Shooting Audio: The RandomAudioPlayer used when a shot is fired.
  • Melee Attack Audio: The RandomAudioPlayer used when a Melee attack occurs.
  • Die Audio: The RandomAudioPlayer used when the enemy dies.
  • Foot Step Audio: The RandomAudioPlayer used for the enemy’s footsteps.
  • Misc
  • Flickering Duration: If the enemy’s health is more than 1, when it is hit, it flickers to indicate a hit. This value is the duration of time the flicker lasts.

3.
Health Pickup
The Health Pickup is a prefab that increases the player’s health when the player walks through it. Find it in the Project window in Prefabs > Interactables
 
  • Health Amount: The amount of health the box provides
  • On Giving Health: The events triggered when the player collides with the box and health is given to the player.

4.
Pressure Pad
The pressure pad is automatically set up so that when the player walks on it, it lights up and plays a sound. You can connect the pressure pad to trigger events like opening a door.
 
  • Activation Type: How the button is activated. The option below changes depending on this setting.
  • Item Count: The amount of GameObjects on the pressure pad to activate it.
  • Mass: The weight of a GameObject required to activate the pad.
  • Required Count: The required number of items for the pad to trigger the event in On Pressed & On Release. This changes to Required Mass if Activation Type is changed.
  • Deactivated Box Sprite: (Optional) The sprite to change to when the platform is not pressed. Only needed if the Boxes option has a Sprite Renderer
  • Activated Box Sprite: (Optional)The sprite to change to when the platform is pressed. Only needed if the Boxes option has a Sprite Renderer
  • Boxes: (Optional) A list of boxes expected to be pushed onto the PressurePad. When they are pushed on, the sprites change to those in Deactivated Box Sprite and Activated Box Sprite.
  • On Pressed: Events that happen when the Pressure Pad is pressed. This is dependant on the correct Required Count or Required Mass
  • On Release: Events that happen when the Pressure Pad is released. This is dependant on the correct Required Count or Required Mass

5.
Damage System
The damage system in the kit is composed of two components: Damager and Damageable scripts.
Adding a Damager script to a GameObject makes it able to inflict damage to any GameObject that has a Damageable component, as long as their settings match.

Damager

The Damager Component has events for collision with Damageable components and non Damageable components. The health calculation is done automatically and these events are used for triggering gameplay changes or visual effects.
The Damager component does not require a collider. It displays a box gizmo in the Scene View which you can use to tweak its size and position.
 
  • Damage: The amount of damage the GameObject inflicts on a Damageable (e.g Ellen or Chomper) when hit.
  • Offset and Size: these are the two parameters that define the Damager collision box. This is the outer box displayed on the Spikes in the Scene View as the outer box, it will inflict damage when this is collided with.
 
  • Offset Based On Sprite Facing: This setting allows the Damager to change position based on which direction a sprite is facing. For example, this is used on Ellen allowing the Damager to flip left and right depending on which way she is facing.
  • Sprite Renderer: The Sprite Renderer that the above setting uses.
  • Can Hit Triggers: Toggles whether the Damager collides with triggers (if checked) or totally ignore triggers (if unchecked).
  • Force Respawn: If this is enabled, the GameObject containing a Damageable immediately respawns to the latest checkpoint ( the Acid prefab uses this when the player falls into the water).
  • Ignore Invincibility: If enabled, the Damager still registers a ‘hit’ to the Damageable but does not remove health. In the example game, the Acid uses this so that the player always respawns, even if they are invincible from a previous enemy hit.
  • Hittable Layers: The Layers on which the Damager inflicts damage. Layers that are not selected do not receive damage.
  • On Damageable Hit: Events here play when a GameObject with a Damageable component is hit.
  • On Non Damageable Hit: Events here play when a GameObject with no Damageable component is hit.

Damageable

The Damageable Component receives damage from collisions of GameObjects with the Damager Component attached to them. There are events for when damage is received, health is restored, health changes, or complete depletion of health (death) occurs.
Contrary to the Damager, the Damageable component relies on colliders attached to the same GameObject, so in addition to adding a Damageable Script to your GameObject, don't forget to add colliders to define hittable zones.
 
  • Starting Health: Health level. Damagers remove their health at each impact. GameObjects with a Damageable Component die when this reaches 0.
  • Invulnerable After Damage: This Damageable becomes invulnerable for a given time after impact.
  • Invulnerability Duration: Length of time (in seconds) that this Damageable is considered invulnerable after impact (only applicable if previous setting is set).
  • Disable On Death: This setting disables the GameObject on death.
  • Center Offset: This is used to define where the centre of the Damageable is (an offset of (0,0,0) means it is on the GameObject position). Used to compute distance to the Damager.
  • On Take Damage: Events triggered when the GameObject receives damage.
  • On Die: Events triggered when the GameObject's health is depleted.
  • On Gain Health: Events triggered when a GameObject gains new health.
  • Persistent Type: See Persistent Data
  • Data Tag: See Persistent Data

Checkpoints

Find checkpoints the Project window, in the folder Prefabs > SceneControl
 
Each time the Player enters a Checkpoint collider, this Checkpoint becomes active. When they fall into the water (or get hit by any Damager that has the Force Respawn setting) they reappear at that Checkpoint.
Note: The Player reappears at the GameObject position, so make sure it is above ground.

6.
Moving Platform
A Prefab located in the Project window in Prefabs > Interactables
To create a Moving Platform in your Scene, drag a MovingPlatform Prefab from the Project View into the Scene View.
It includes a Moving Platform Script, Box Collider 2D, Rigidbody 2D, Platform Effector 2D and a Platform Catcher Script.
 
The Platform Catcher Script allows GameObjects on top of the platform to move freely. You should not need to change this.
In the Scene View, the GameObject has a red dotted line with a Transform Tool on the end. This indicates the movement path of the platform and its destination. Drag the Transform Tool in any direction to change the path and destination.
 
 
  • Platform Catcher: This automatically finds the Platform Catcher Script on the Platform. You should not need to change this.
  • Preview Position: Allows you to scrub through and preview the platform's path in the Scene View.
  • Start Moving: When enabled, the platform starts moving as soon as a level is loaded. If unticked, it needs to be triggered by an event.
  • When becoming visible: This option only appears if the platform is set to Start Moving. If this is enabled, the platform starts moving only when it becomes visible on screen, not when the level is loaded.
  • Looping: Defines how the platform reacts once it reaches the end of its path.
  • BACK_FORTH: platform moves back and forth between a start and end point.
  • LOOP: Once the platform reaches the last point of its path, it moves towards the start point in a straight line to restart the cycle, making a loop.
  • ONCE: The platform stops when it reaches the final point.
  • Speed: Default Setting: 2 The speed at which the platform moves (in units per second).
 
  • Add Node: This button adds another Node, or destination point to your platform’s path. A platform moves from Node to Node.
  • Node 0: The platform position. Cannot be deleted. There is no position as this cannot be altered.
  • Wait Time: The amount of time the platform waits to move on to the next Node.
  • Node 1: The first path and destination, this is always included by default.
  • Position: The position of the Node (local space).
  • Delete: The button to delete a Node.
  • Wait Time: The amount of time the platform waits to move on to the next node.
A platform with two Nodes looks like this in the Scene View.
 

7.
Interaction System
The interaction system allows the player to interact with GameObjects. To do this, it uses three components:
  • InteractOnCollision2D
  • InteractOnTrigger2D
  • InteractOnButton2D
Interactions are dependant on GameObjects having a Collider 2D Component on them. A Collider is an invisible area around a GameObject that can detect when something touches or enters it. The main ones we use in the Kit are Box (Box Collider 2D), Capsule (Capsule Collider 2D) and Circle (Circle Collider 2D).
These are all set up for you in the various Prefabs provided in the Kit.
If you wish to add new types of interactions on GameObjects or create your own, depending on which of the following InteractOn components you use, you must take note of the Is Trigger checkbox on the Collider of the GameObject you’d like to make interactable. This documentation includes information on what state the Collider needs to be in for a particular InteractOn component.
 

Interact On Collision 2D

This is used to trigger events when GameObject Colliders touch.
 
  • Script: The name of the script being used (cannot be changed).
  • Layers: Only GameObjects on the selected Layers trigger the events.
  • On Collision: Events listed here happen when a GameObject that belong to the set layer collide.
(If setting up your own, there is no need to enable Is Trigger on the Collider)

Interact On Trigger 2D

This is used to trigger events when a GameObject enters a collider and more events when an GameObject exits a collider.
(If making your own, ensure Is Trigger is enabled on the Collider Component).
 
  • Script: The name of the script being used (cannot be changed).
  • Layers: Only GameObjects on the selected Layers trigger the events.
  • On Enter: Events listed here happen when a GameObject that belong to the set layer enter the Trigger.
  • On Exit: Events listed here happen when an GameObject that belongs to the set layer exits the Trigger.
 
  • Inventory Checks: This allows you to ensure events only happen when a GameObject entering the trigger has a GameObject in its inventory (or example, only opening a door once a player entering the trigger zone has a Key in their inventory).
  • Size: Increase this number to increase the amount of Inventory the trigger should expect. This is set to 0 by default.
  • Element 0: The first Inventory Check.
  • Inventory Items: GameObjects it expects in the inventory of the GameObject colliding with it.
  • Size: The number of items you would like the triggering GameObject to carry in its inventory.
  • Element 0: The first inventory item needed. This must match the expected names, these are listed in the Inventory System section.
  • On has Item: Events triggered when the GameObject holds ALL the items set in the Inventory Items.
  • On Does Not Have Item: Events triggered when the GameObject does not hold ALL the items set in Inventory Items.

Interact On Button 2D

This is used to trigger events when a GameObject is inside the trigger zone and a player presses the Interact button in the game (see the Player Input section for more information on the Interact Button).
(If making your own, ensure Is Trigger is enabled on the Collider Component).
 
  • Script: The name of the script being used (cannot be changed).
  • Layers: Only GameObjects on the selected Layers will trigger the events.
  • On Enter: Events listed here happen when an GameObject that belongs to the set layer enters the Trigger.
  • On Exit: Events listed here happen when a GameObject that belongs to the set layer exits the Trigger.
  • Inventory Checks: This allows you to ensure events only happen when a GameObject entering the trigger and pressing the interact button has a GameObject in its inventory (for example, only opening a door once a player has a Key in their inventory when entering the trigger and pressing the interact button).
  • Size: Increase this number to increase the amount of Inventory the trigger should expect. This is set to 0 by default.
  • Element 0: The first Inventory Check.
  • Inventory Items: GameObjects it expects in the inventory of the GameObject colliding with it.
  • Size: The number of items you would like the triggering GameObject to carry in its inventory.
  • Element 0: The first inventory item needed. This must match the expected names listed in the Inventory System section.
  • On Button Press: Events that are triggered when the interact button is pressed.

8.
Inventory System
The inventory system is made up of two parts, the Inventory Controller Component and the Inventory Item.
The Inventory Controller should be added to a GameObject holding the inventory. An Inventory Item script should be added to the item that is being collected. For example Ellen (Inventory Controller) collects a Key (Inventory Item)
The Inventory Controller is able to automatically collects the Inventory Item on contact with their colliders, and defines actions that happen when a GameObject is received or removed.

Inventory Controller

This Component has an entry for each item that can be carried in your inventory. The Component can exist on a character, a chest or a shop.
 
  • Inventory Events: List of events to occur on specific GameObjects added to the inventory. Increase the number here to add new events (tip: you can delete an event by right clicking on the name in the list and choosing Delete Array Element). *
  • Key: A unique identifier that represents the Inventory Item e.g. Key, Gun, Staff. This must match the Key in the Inventory Item component on the item you wish to be collected. The inventory can only hold a single instance of each GameObject; if a GameObject with the same Key is already in the inventory, the add event in Inventory Controller is not called.
  • OnAdd: Events triggered when the item is added to the inventory.
  • OnRemove: Events triggered when the item is removed from the inventory.
  • Data Settings: See the Persistent Data documentation for more info.
Do not confuse the Key of an item (which is the unique identifier assigned to an item) with a key, a collectible GameObject we like to use in games. Mention within the documentation of the unique identifier is in bold to limit confusion.

Inventory Item

Any item that can be carried in the inventory needs an Inventory Item Component. This specifies the Key of the item, an Audio Clip and which Layers can pick the item up.
An InventoryItem is a component added to the GameObject representing the item. It also requires a Circle Collider 2D and automatically adds one if missing. That collider is set to trigger and is used to detect when the Player touches the GameObject.
The state of the GameObject (active or not) is saved, so it remains the same when the Scene is reloaded and the Player re-enters the zone.
 
  • Inventory Key: A unique name for the item (e.g. Key1), used by the inventory to track if an item is already owned or not.
  • Layers: The Layer the GameObject collecting the item is on.
  • Disable On Enter: This setting disables the GameObject once it has been collected.
  • Clip: The Audio clip to be played when the item is collected. If empty, no clip is played.
  • Data Settings: See the Persistent Data documentation for more info.

9.
HubDoor
This component is used to change the sprite of a GameObject depending on how many inventory items have been collected.
Once all the items have been collected the On Unlocked function is called. In the below example the three inventory items to collect are Key1, Key2 and Key3. Each time one item in the inventory is collected the sprite changes.
Interact On Trigger 2D and Interact On Button 2D are also able to check if this component has been satisfied.
 
  • Required Inventory Item Keys: The list of Keys of the GameObjects that need to be collected. Once ALL are collected it triggers the On Unlocked event.
  • Size: The amount of items that need to be collected. Size increases the number of Elements below.
  • Element: The Key of the GameObjects collected.
  • Unlock State Sprites: The list of sprites that display when collecting items. Sprites change sequentially.
  • Size: Number of sprite slots.
  • Element: A sprite that changes the appearance of a GameObject when an inventory item is collected.
  • Key Director Trigger: This triggers a Director sequence if one is set up.
  • Character Inventory: The GameObject holding the Inventory Controller. This component uses to track the collection.
  • On Unlocked: The events triggered when all the items have been collected and sprites changed.
  • Data Settings: See the Persistent Data documentation for more info.

10.
Enemy Spawner
The Enemy Spawner prefab is located in the Project view, in Prefabs > Enemies. This controls the spawning of multiple enemies in your Scene at the location it is placed.
 
  • Prefab: The enemy Prefab to be spawned.
  • Initial Pool Count: This determines the amount of enemies which will be held in the pool. A good value to enter here is equal to the number of concurrent enemy that need to be spawned.
  • Total Enemies To Be Spawned: The number of enemies that the spawner can spawn until it stops spawning enemies.
  • Concurrent Enemies to be spawned: The number of enemies that the spawner spawns in the world at the same time. For example: If this is 5 with 10 total enemies, the spawner spawns 5 enemies. Once one is killed, the spawner spawns a new one, unless it has already spawned 10 in total.
  • Spawn Area: This is the extent of the spawn zone around the spawn point. Enemies are spawned at random positions within the zone. This can be visualized in the Scene view by the white rectangle gizmo around the spawn point.
 
  • Spawn Delay: The delay between the death of an enemy and the spawning of the next one.
  • Removal Delay: The time before an enemy is removed from the world and sent back to the pool.