Extending the system

Q). I want to do something different when the code is valid:

Using the UnityEvent feature on each controller will allow you to add multiple event types, see the demo scene for a clear example on this! 😊

Q). I want to use a different character controller whilst using this asset:

You can see that we create a reference to the "FPSController" at the top of the “DisableManager” script. You can create a new reference to the controller you’re using and make sure to disable input and mouse look when you disable the player!
1
public void DisablePlayer(bool disable)
2
{
3
if (disable)
4
{
5
player.enabled = false;
6
Cursor.lockState = CursorLockMode.None;
7
Cursor.visible = true;
8
//Disable crosshair & Player
9
}
10
if (!disable)
11
{
12
Cursor.lockState = CursorLockMode.Locked;
13
Cursor.visible = false;
14
player.enabled = true;
15
//Enable crosshair & Player
16
}
17
}
Copied!

Q). I want organise my keypad elements in the scene what can I do?

If you take a look at the demo scene it has the two major elements of the keypad system which include “KeyPadController” and “KeyPadCanvas” inside one GameObject called “KeyPadElements#1” or similar. You can put your two elements inside an empty GameObject to keep things organised. Make sure that when you create the empty GameObject you set the X, Y, Z position coordinates to 0, 0, 0. If not the object will take the position of the parent GameObject and the canvas UI’s might not appear.

Q). I want to add more than one keypad to one scene, how do I do this?

You can duplicate “KeyPadController” and “KeyPadCanvas” scripts TOGETHER, or add an additional demo prefab to your scene! You can increment the number once duplicated yourself and you just want to check that each of the inspector slots has the corresponding elements in the hierarchy, to what you just duplicated. For example: If you select the “KeyPadController#2” but make sure you organise everything correctly and all your gameobject link to the correct objects themselves, this is why it’s good to organise everything into one empty gameobject. Check out the demo scene for more tips!

Q). I want to change the button UI, how do I do this?

Select any of the buttons from the “KeyPadCanvas” and change the “Source Image”, so you can add your own sprite to create a different style of button. “Highlight colour”, to change how the button is highlight when hovered over.

Q). You can also change the overall style of the Keypad

By changing the source image for the “IMAGEONLY_KeyPad_Unit”. I need to change the number on the buttons, how do I do this? Select one of the buttons from the “KeyPadCanvas” and drop the parent down to reveal the “Text” element, select this and you can change the text field to whatever you need. You can then change fonts, sizes and styles if you need too. Make sure to remember to also change that in the button properties at the bottom.