Author Topic: 2.2.6c Android UICamera.currentTouchID issue  (Read 2501 times)

rcaltabiano

  • Guest
2.2.6c Android UICamera.currentTouchID issue
« on: December 11, 2012, 09:08:40 PM »
Hey all, I'm running into a bit of an issue that I'm sure it is just my usage. I've got a very simple script attached to an UIImageButton template as follows:

  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class EventTest : MonoBehaviour {
  5.         void OnPress (bool isDown) {
  6.                 print(UICamera.currentTouchID + ":" + isDown);
  7.         }
  8. }

When I'm running this in the editor preview, I get out put as expected:

  1. -1:True  //Left Down
  2. -1:False //Left Up
  3. -2:True  //Right Down
  4. -2:False //Right Up
  5. -1:True  //Left Down
  6. -2:True  //Right Down
  7. -1:False //Left Up
  8. -2:False //Right Up

And so on. The problem I am running into is when I have this running on my Android device I get something that is kinda unexpected or at least to me:

  1. 0:True  //First Finger Down
  2. 0:False //First Finger Up
  3. 0:True  //Second Finger Down
  4. 0:False //Second Finger Up
  5. 0:True  //First Finger Down
  6. 0:True  //Second Finger Down
  7. 0:False //First Finger Up
  8. 0:False //Second Finger Up

I would have expected something along these lines:

  1. 1:True  //First Finger Down
  2. 1:False //First Finger Up
  3. 1:True  //Second Finger Down
  4. 1:False //Second Finger Up
  5. 1:True  //First Finger Down
  6. 2:True  //Second Finger Down
  7. 1:False //First Finger Up
  8. 2:False //Second Finger Up

About my device / scene:
1. Google Nexus 7
2. Android version 4.2.1
3. 1 Scene, terrain, high models, really just a stress test scene, runs like crap 15fps.

Thoughts?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 2.2.6c Android UICamera.currentTouchID issue
« Reply #1 on: December 12, 2012, 09:18:27 AM »
That's what I would expect as well. Touch IDs should differ. What version of Unity is this in?

P.S. Make sure that UICamera allows multi-touch.

rcaltabiano

  • Guest
Re: 2.2.6c Android UICamera.currentTouchID issue
« Reply #2 on: December 12, 2012, 09:53:39 AM »
Allow Multi Touch is enabled and the Unity version is 4.0.0f7. There was a lot of warnings about outdated use of .active which a coworker went in and cleaned up (I just remembered that) so I wonder if that wasn't the cause of the issue. I'll test with the stock version and reply back if that was the case.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 2.2.6c Android UICamera.currentTouchID issue
« Reply #3 on: December 12, 2012, 10:01:24 AM »
Sounds like you have an old version of NGUI then. Latest version of NGUI has no warnings under 4.0.

rcaltabiano

  • Guest
Re: 2.2.6c Android UICamera.currentTouchID issue
« Reply #4 on: December 12, 2012, 10:13:04 AM »
Just double checked with my coworker, they modified the Free Edition version. Not the version we are currently using (2.2.6c, I double checked).

On a fresh new project, I was getting expected results. So I suspect someone screwed up a project setting somewhere.

rcaltabiano

  • Guest
Re: 2.2.6c Android UICamera.currentTouchID issue
« Reply #5 on: December 12, 2012, 10:44:48 AM »
Found the issue...I was being retarded. It was a long day yesterday =(