Themed Key Sys - Setup
Themed Key - Video Setup
Themed Key Main Setup
Make sure to have a "ThemedKey_Canvas" object in your scene which will have all the UI elements. This will be a child of the "AK_CanvasContainer" if you've already imported it from the initial setup
Basic Steps
Make sure you have the Themed Key Canvas added
Add a "Themed Key - Inventory Manager" prefab or script to an empty GameObject
Add a set of Themed PBR key models to your scene - Setup as follows:
Set the tag to "InteractiveObject"
Set the layer to "Interact"
Add a "Box Collider"
Add the "AKItemController" script and set the system type to: "ThemedKeySys"
Add the "ThemedKeyItemController" script and set the item type to: "Key"
Add the "ThemedKeyController" script and set the key to the corresponding key type
Add a Door prefab or a door of your own
Set the tag to "InteractiveObject"
Set the layer to "Interact"
Add a "Box Collider"
Add the "AKItemController" script and set the system type to: "ThemedKeySys"
Add the "ThemedKeyItemController" script and set the item type to: "Door"
Add the "ThemedKeyDoorController" script and setup as follows:
Set the "AnimatedDoorKey" to the GameObject which is parented to the doors with the key animation
Set the door type to the specific door you're using
See more setup details below:
Inventory Controller Setup
This object should be an empty GameObject and it will control everything that goes on for your themed key system!
Heart Full UI | Add the "Slot1_Heart_Full" from the "ThemedKey_Canvas" |
Diamond Full UI | Add the "Slot2_Diamond_Full" from the "ThemedKey_Canvas" |
Spade Full UI | Add the "Slot3_Spade_Full" from the "ThemedKey_Canvas" |
Club Full UI | Add the "Slot4_Club_Full" from the "ThemedKey_Canvas" |
PBR Key Setup
Add this script to either a PBR Key (Heart / Diamond / Spade / Club)
Make sure your object has a tag of "InteractiveObject" and a Layer of "Interact"
Add a "Box Collider" to your object
Add an "AKItemController" - Set the System Type to: "ThemedKeySys"
Add a "ThemedKeyItemController" script and set the ItemType to: "Key"
Add a "ThemedKeyController" script and set it to the type of type, for the particular key
Door Controller Setup
Add this script to either a PBR Door
Make sure your object has a tag of "InteractiveObject" and a Layer of "Interact"
Add a "Box Collider" to your object
Add an "AKItemController" - Set the System Type to: "ThemedKeySys"
Add a "ThemedKeyItemController" script and set the ItemType to: "Door"
Add the key animation which is parented to the object called "AnimatedKeys_Door".
Add a "ThemedDoorController" script and set it to the type of type, for the particular door type
Door Properties
Door Type | Select the door via the drop down |
Animated Door Key | Add the "Type_Key" to this slot which will be parented to the door |
Sound Timers - Edit to increase delay
Key Audio Delay | Time we should wait before playing the audio of the key sound |
Door Open Delay | This is how long we should wait before we open the door |
Animation Event
This is an event you can use to play an animation when you unlock the door, so the example here is the script attached to the door which is called "GenericDoorOpen" which is attached to the same object. Add itself to the empty slot and choose the "PlayAnimation" method to play the default door animation.
Remember you can change the animation and event by using a different script you have created yourself!
Door Frame Setup
Each Door is a child of a Frame Prefab, and the "AnimatedKeys_HeartDoor" have a selection of keys, each with their own animation for when it's suitable to open a door.
Adding the ThemedKey_Canvas to the "UI Manager" prefab
Default Controls
Left Click to interact with a pickup
Press "TAB" to open the inventory
These can be edited in the "InputManager"
Last updated