Example #1
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);
            }
        }
Example #2
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
         }
     });
 }