Search Unity

Which thread is Button's listener called?

Discussion in 'General Discussion' started by chriszhao, May 22, 2019.

  1. chriszhao

    chriszhao

    Joined:
    Apr 3, 2019
    Posts:
    2
    I present an delegate and use UnityAPI Button.OnClick.AddListener to set this action as button's listener. When button has been clicked, this listener has been called. All of this is work well. But I am not sure Which thread is calling this listener? Is it mainThread? As all know, UnityAPI mostly can not called out of mainthread, so I think it is importment.
    Any response is appreciated.
     
  2. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,205
  3. chriszhao

    chriszhao

    Joined:
    Apr 3, 2019
    Posts:
    2
    Get it. Thank you very much :)