Author Topic: Getting OnClick event called on UITexture  (Read 3044 times)

NeatWolf

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 8
    • View Profile
Getting OnClick event called on UITexture
« on: February 12, 2015, 12:36:42 PM »
Hi,

I know it may be a little trivial, but I'm trying to get the OnClick Event called on a UITexture but doesn't seem to work.

I'm attaching a screenshot as reference.

Am I missing something?

the attached behaviour contains a method:

  1.         public void OnClick()
  2.         {
  3.                 Debug.Log("Click!");
  4.                 if (!PreMatchManager.Instance.levelChosen
  5.                     && PreMatchManager.Instance.CanChooseLevel(levelNumber))
  6.                 {
  7.                         PreMatchManager.Instance.ChooseLevel(levelNumber);
  8.                 }
  9.         }
that never gets called!

NeatWolf

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: Getting OnClick event called on UITexture
« Reply #1 on: February 13, 2015, 05:27:51 AM »
SOLVED

My camera event type was set to 3D UI and I was using 2D Colliders.