Topic: Android/Samsung Tablet: NGUI Texture, first touch not firing events
Unity 5.3.2f1, Online Maps latest stable
Android Build, Samsung SM-P900 Table (Note 2)
Online Maps NGUI Texture Control, no additional components
Build Symbol Defines: CROSS_PLATFORM_INPUT;NGUI
--same issue with both MOBILE_INPUT defined, and not defined
Additional Info:
Allow Add Marker : OFF
Allow Zoom: ON
Allow User Control: ON
Invert Touch Zoom: OFF
Zoom In On Double Click: OFF
I was testing an Android build/deploy of my app, and discovered that I could not drag the map, but I could pinch-zoom (so input events in general are working). Build was generated using BUILD AND RUN of the Android target to a USB connected device.
I could press my markers as expected, as well as other NGUI objects, so press events in general are working.
Further troubleshooting using Unity Remote 4, Unity Editor and Debug.log to catch events, I determined that at least two events were not firing during user input on the map:
OnlineMapsControlBase.instance.OnMapPress += OnMapPress; <-- would not fire
OnlineMapsControlBase.instance.OnMapDrag += OnMapDrag; <-- would not fire
OnlineMapsControlBase.instance.OnMapRelease += OnMapRelease; <-- fired as expected
I used the following to test the events firing/not firing:
public class OverlandMap : MonoBehaviour {
void OnMapPress()
{
Debug.Log("OverlandMap--onMapPress fired");
}
void OnMapRelease()
{
Debug.Log("OverlandMap--onMapRelease fired");
}
void OnMapDrag()
{
Debug.Log("OverlandMap--onMapDrag fired");
}
// Use this for initialization
void Start () {
OnlineMapsControlBase.instance.OnMapPress += OnMapPress;
OnlineMapsControlBase.instance.OnMapRelease += OnMapRelease;
OnlineMapsControlBase.instance.OnMapDrag += OnMapDrag;
}
}
By random chance, I clicked on the Unity Editor Game window while the build was still running, and saw the OnMapPress event fire in my Console. I then went back to my tablet, and all events were working as normal--they fired in the Console window, and the map scrolled normally (via drag gesture). This is reproduceable--it happens every run.
Obviously I can't click on the game window when running an app native build (outside of Unity Remote/Unity Editor), but I'm pretty sure the same will happen.
To make sure it wasn't my error somewhere, I then used a basic project with a simple NGUI Texture map and was able to duplicate.
I did try some troubleshooting with VS 2015 attached as debugger, and confirmed that OnlineMapsControlBase::OnMapBasePress() was being called, but quickly got lost in the camera/map event processing code.
Please let me know if you need any additional information or troubleshooting assistance.