Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - lassade

Pages: [1]
1
Support / tk2dUI woking with 2D physics
« on: December 24, 2013, 02:53:13 pm »
I got some of the UI working with the new unity 2D physics, all i did was add the code below to the RaycastForUIItem method in tk2dUIManager script inside the for loop

Code: [Select]
Collider2D c = Physics2D.OverlapPoint (ray.origin, currCamera.FilteredMask);
if (c != null)
{
return c.GetComponent<tk2dUIItem>();
}

if you chose to comment the 3D physics part, you can also get the mouse point using

Code: [Select]
Vector2 mouseWorldPosition = currCamera.HostCamera.ScreenToWorldPoint (screenPos);
NOTE: 2D colliders closer to the camera will be triggered first

Pages: [1]