Keypad Canvas - Setup
This only needs to be done if you’re setting the canvas buttons yourself or if anything might be missing.
1). Select and open out your “KeypadCanvas” (In Hierarchy) to find all the elements.
2). Select any of the Button numbers, add an “OnClick()” event in the bottom right of the inspector by clicking the “+”. (Unless it already has one added, image below).
3. Add your “KeyPadController” GameObject to the available slot (This will link the "KeyController" script which exists on that object).
  1. 1.
    On the drop down on the right, (No function dropdown if nothing is selected) choose the “KeyController” option which will open out into more.
  2. 2.
    Choose “KeyController.KeyPressString”
  3. 3.
    You can then add whatever number or keyboard symbol you like in the slot below the dropdown.
  4. 4.
    Continue this for each button available.
Similar setup for the CLOSE / CLEAR / ENTER Button.
  1. 1.
    Select any of the input keys, add an “OnClick()” event in the bottom right of the inspector by clicking the “+”.
  2. 2.
    Add your “KeyPadController” GameObject to the available slot
  3. 3.
    On the drop down on the right, choose the “KeyController” option which will open out into more.
  4. 4.
    Choose “KeyController.KeyPressClose” or “KeyController.KeyPressClr” or “KeyController.KeyPress.Ent” to the corresponding buttons.
Copy link