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 - moibios

Pages: [1]
1
When 3D Object and NGUI Object located same position on viewPort, "if(UICamera.hoveredObject != null)" code only touched NGUI Object.

This code is no problem NGUI 3.0.2 version, Editor and Mobile too.

But, latest version "UICamera.hoveredObject" is pointed "UIRoot Object", nothing NGUI Object on "ScreenPointToRay".

So, latest version "if(UICamera.hoveredObject != null)" code is always "True". 3D object and NGUI object touched both.

If "IsOverUI" and "hoverdObject" and "fallThrough" is only works with the mouse, how can I solve this problem?

I want to be touch only NGUI Object, 3D object and GUI object when in the same position in the viewport




2
I`m poor at English. I hope to understand...

I using the version of Unity 4.5.2f1.

I using the version of NGUI 3.0.2 version.

This code work no problem 3.0.2 version.

if (UICamera.hoveredObject == null )
        return;

if (Input.GetMouseButtonDown(0))
{
      Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);

      RaycastHit rayHit = new RaycastHit();
      if (Physics.Raycast(ray, out rayHit) == false)
           return;

      MyFunction();
}

updating the version of NGUI 3.9.0 version.

after this code don`t work.

I find same problem at NGUI 3 Support.

So I changed code.

1. if (UICamera.hoveredObject != UICamera.fallThrough)
       return;

2. if (UICamera.isOverUI)
       return;

changed code, work no problem on Unity Editor.

but, changed code not working on Mobile. (mobile is Samsung Galaxy3, Android os Icecream 4.0.4).

seemed to ignore "if function" on Mobile.

I hope to help my problem.

Thank you.

Pages: [1]