Hello Guest

Author Topic: Simple idea for tk2dUIManager.raycastLayerMask  (Read 3995 times)

Clet_

  • Newbie
  • *
  • Posts: 9
    • View Profile
Simple idea for tk2dUIManager.raycastLayerMask
« on: November 04, 2013, 07:06:01 pm »
I didn't know where to post this, but I figured it would probably be seen here, so here it goes.

As for now, the property "raycastLayerMask" of tk2dUIManager is public and is only assigned to sorted cameras' raycastLayerMask at tk2dUIManager's start. This caused a problem when I had to dynamically change the layer mask in-game.

Wouldn't it be a good idea to turn that public property into a private one with a Getter/Setter, that updates every sorted camera's raycastLayerMask when set to a different value?
That would greatly simplify tk2dUIItem disabling. This is a simple idea I got, and I thought that sharing this with the dev team, would maybe give you some hint on further updates.

Regards.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Simple idea for tk2dUIManager.raycastLayerMask
« Reply #1 on: November 05, 2013, 11:39:46 am »
If you're using the tk2dUICamera - you can actually change the value on there every frame if you want.The filtered mask is read every ray cast, so I think that would work fine?

Clet_

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Simple idea for tk2dUIManager.raycastLayerMask
« Reply #2 on: November 05, 2013, 01:30:06 pm »
Of course, but at first sight, it seemed counter-intuitive that affecting the raycastLayerMask of the tk2dUIManager with a new value did absolutely nothing. That's why I thought that turning it into a private member with getter/setter that automatically affect the sorted cameras' raycastLayerMask would be a simple, yet less confusing way to affect dynamically the raycast layer masks.

Thanks for your time and great job with 2D Toolkit

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Simple idea for tk2dUIManager.raycastLayerMask
« Reply #3 on: November 05, 2013, 01:37:50 pm »
I think the whole thing is made more confusing by all that backwards compatibility stuff in there... it used to be on the uimanager, now its on the tk2dUICamera...