I have been mocking up some ideas but I still feel like I am missing some information. I think I have boiled it down to a specific need...
* My GUI camera (2D) will see things that need to be drag-and-drop. It also needs to block all events to the game, so if I click or drag on a button, the game doesn't receive any fall-through input.
* My game camera (3D) is controlled by dragging anywhere in the game. There are a lot of 3D GUI elements that receive clicks, but all drags in-game are for the camera (Our camera script is a special behaviour, so I need my current script.)
I tried to set this up by setting the 3D camera mask to nothing, or deleting it, but in both cases the fall-through hover object is "FallThrough EventHandler". Here is my debug log for the click from the code below:
Clicked FallThrough EventHandler (UnityEngine.GameObject)
UnityEngine.Debug:Log(Object)
UIGameCamera:OnClick() (at Assets/Scripts/UI/UIGameCamera.cs:17)
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
UICamera:Notify(GameObject, String, Object) (at Assets/NGUI/Scripts/UI/UICamera.cs:517)
UICamera:ProcessTouch(Boolean, Boolean) (at Assets/NGUI/Scripts/UI/UICamera.cs:957)
UICamera:ProcessMouse() (at Assets/NGUI/Scripts/UI/UICamera.cs:761)
UICamera:Update() (at Assets/NGUI/Scripts/UI/UICamera.cs:623)
Here is the simple test class I am using to try this out:
public class UIGameCamera : MonoBehaviour
{
private void Start()
{
UICamera.fallThrough = this.gameObject;
}
private void OnClick()
{
Debug.Log("Clicked " + UICamera.hoveredObject);
}
private void OnDrag(Vector2 delta)
{
Debug.Log("Dragging Camera");
}
}
If I could get the object that is clicked, this would be done. If I am not doing anything wrong, and I need to do a quick raycast, that is fine. I just want to know I am following nGUI methodology and not trying to fight it.
Thanks a lot!
P.S. I bought through the Unity store because I didn't have anything in our PayPal account and the current free version isn't the latest version. I would have liked to buy direct.