Author Topic: Delegate onKey doe's not work.  (Read 2798 times)

Sahkan

  • Jr. Member
  • **
  • Thank You
  • -Given: 9
  • -Receive: 0
  • Posts: 74
    • View Profile
Delegate onKey doe's not work.
« on: August 17, 2014, 06:17:08 AM »
  1. void Awake()
  2.         {
  3.                 UIEventListener.Get(laterInputField.gameObject).onKey += laterInputField_Typed;
  4.         }
  5.  
  6. void laterInputField_Typed(GameObject go,KeyCode key)
  7.         {
  8.                 print ("laterInputField_Typed");
  9.         }
  10.  

This example won't print anything, and i'v checked, the other delegates are working fine .
I'm working from version 3.5.3 and i can't upgrade at the moment, so maybe a piece of missing code or something that can fix it will be very appreciated. Thanks.

Sahkan

  • Jr. Member
  • **
  • Thank You
  • -Given: 9
  • -Receive: 0
  • Posts: 74
    • View Profile
Re: Delegate onKey doe's not work.
« Reply #1 on: August 17, 2014, 07:47:52 AM »
Ok i'v used this and it works  :) :

EventDelegate.Set(laterInputField.onChange, LaterInputField);