예제 #1
0
        public virtual void onTouch(View v, MotionEvent me)
        {
            MotionEventAction action = me.Action;
            int ptrId = me.PointerId;

            switch (action)
            {
            case MotionEventAction.ACTION_DOWN:
            case MotionEventAction.ACTION_POINTER_DOWN:
            {
                self.onTouchDown(ptrId, me.X, me.Y);
                break;
            }

            case MotionEventAction.ACTION_MOVE:
            {
                self.onTouchMoving(ptrId, me.X, me.Y);
                break;
            }

            case MotionEventAction.ACTION_UP:
            case MotionEventAction.ACTION_POINTER_UP:
            case MotionEventAction.ACTION_CANCEL:
            {
                self.onTouchUp(ptrId);
                break;
            }
            }
        }
예제 #2
0
 public MotionEvent(MotionEventAction index, int id, int x, int y)
 {
     Action    = index;
     PointerId = id;
     X         = x;
     Y         = y;
 }
예제 #3
0
        public void InjectMotionEvent(float x, float y, MotionEventAction action)
        {
            Logger.v("Inject Motion event point: " + x + ", " + y);
            Logger.v("Inject Motion event touch type: " + action.ToString());

            try
            {
                u3dautomation.CallStatic("InjectTouchEvent", new object[] { (int)action, x, y });
            }
            catch (System.Exception ex)
            {
                Logger.e(ex.Message + "\n" + ex.StackTrace);
            }
        }
예제 #4
0
 public void a(float A_0, float A_1, MotionEventAction A_2)
 {
     u.d(string.Concat(new object[]
     {
         "Inject Motion event point: ",
         A_0,
         ", ",
         A_1
     }));
     u.d("Inject Motion event touch type: " + A_2.ToString());
     if (r.b == null)
     {
         if (!r.c())
         {
             u.b("Inject Motion event error type!");
             return;
         }
         r.b = r.f.CreateInstance("UnityEngine.AndroidJavaClass", true, BindingFlags.Default, null, new object[]
         {
             "com.tencent.wetest.U3DAutomation"
         }, null, null);
     }
     if (r.b == null)
     {
         u.b("Inject Motion event u3dautomation is null!");
         return;
     }
     if (r.d == null && !r.c())
     {
         u.b("mcallstatic == null!");
         return;
     }
     r.d.Invoke(r.b, new object[]
     {
         "InjectTouchEvent",
         new object[]
         {
             (int)A_2,
             A_0,
             A_1
         }
     });
 }