firstTouch() 공개 정적인 메소드

public static firstTouch ( ) : Vector2
리턴 Vector2
예제 #1
0
 static public int firstTouch_s(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         var ret = LTGUI.firstTouch();
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
예제 #2
0
    public static bool pressedWithinRect(Rect rect)
    {
        Vector2 vector = LTGUI.firstTouch();

        if (vector.x < 0f)
        {
            return(false);
        }
        float num = (float)Screen.height - vector.y;

        return(vector.x > rect.x && vector.x < rect.x + rect.width && num > rect.y && num < rect.y + rect.height);
    }
예제 #3
0
 static public int firstTouch_s(IntPtr l)
 {
     try {
         var ret = LTGUI.firstTouch();
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
예제 #4
0
    public static bool pressedWithinRect(Rect rect)
    {
        Vector2 vector2 = LTGUI.firstTouch();

        if (vector2.x < 0f)
        {
            return(false);
        }
        float single = (float)Screen.height - vector2.y;

        if (vector2.x <= rect.x || vector2.x >= rect.x + rect.width || single <= rect.y)
        {
            return(false);
        }
        return(single < rect.y + rect.height);
    }