GetLocalCorners() public method

Get the corners of the calculated rectangle in the local space of its Transform.

public GetLocalCorners ( Vector3 fourCornersArray ) : void
fourCornersArray Vector3 Array that corners should be filled into.
return void
Ejemplo n.º 1
0
 static public int GetLocalCorners(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
         UnityEngine.RectTransform self = (UnityEngine.RectTransform)checkSelf(l);
         UnityEngine.Vector3[]     a1;
         checkArray(l, 2, out a1);
         self.GetLocalCorners(a1);
         pushValue(l, true);
         return(1);
     }
     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
 }
    static int GetLocalCorners(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                UnityEngine.RectTransform obj  = (UnityEngine.RectTransform)ToLua.CheckObject(L, 1, typeof(UnityEngine.RectTransform));
                UnityEngine.Vector3[]     arg0 = new UnityEngine.Vector3[4];
                obj.GetLocalCorners(arg0);
                ToLua.Push(L, arg0);
                return(1);
            }
            else if (count == 2)
            {
                UnityEngine.RectTransform obj  = (UnityEngine.RectTransform)ToLua.CheckObject(L, 1, typeof(UnityEngine.RectTransform));
                UnityEngine.Vector3[]     arg0 = ToLua.CheckStructArray <UnityEngine.Vector3>(L, 2);
                obj.GetLocalCorners(arg0);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.RectTransform.GetLocalCorners"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
 static int QPYX_GetLocalCorners_YXQP(IntPtr L_YXQP)
 {
     try
     {
         int QPYX_count_YXQP = LuaDLL.lua_gettop(L_YXQP);
         if (QPYX_count_YXQP == 1)
         {
             UnityEngine.RectTransform obj            = (UnityEngine.RectTransform)ToLua.CheckObject(L_YXQP, 1, typeof(UnityEngine.RectTransform));
             UnityEngine.Vector3[]     QPYX_arg0_YXQP = new UnityEngine.Vector3[4];
             obj.GetLocalCorners(QPYX_arg0_YXQP);
             ToLua.Push(L_YXQP, QPYX_arg0_YXQP);
             return(1);
         }
         else if (QPYX_count_YXQP == 2)
         {
             UnityEngine.RectTransform QPYX_obj_YXQP  = (UnityEngine.RectTransform)ToLua.CheckObject(L_YXQP, 1, typeof(UnityEngine.RectTransform));
             UnityEngine.Vector3[]     QPYX_arg0_YXQP = ToLua.CheckStructArray <UnityEngine.Vector3>(L_YXQP, 2);
             QPYX_obj_YXQP.GetLocalCorners(QPYX_arg0_YXQP);
             return(0);
         }
         else
         {
             return(LuaDLL.luaL_throw(L_YXQP, "invalid arguments to method: UnityEngine.RectTransform.GetLocalCorners"));
         }
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
 static public int GetLocalCorners(IntPtr l)
 {
     try {
         UnityEngine.RectTransform self = (UnityEngine.RectTransform)checkSelf(l);
         UnityEngine.Vector3[]     a1;
         checkType(l, 2, out a1);
         self.GetLocalCorners(a1);
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 5
0
 static int GetLocalCorners(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UnityEngine.RectTransform obj  = (UnityEngine.RectTransform)ToLua.CheckObject(L, 1, typeof(UnityEngine.RectTransform));
         UnityEngine.Vector3[]     arg0 = ToLua.CheckObjectArray <UnityEngine.Vector3>(L, 2);
         obj.GetLocalCorners(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static int GetLocalCorners0(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                UnityEngine.RectTransform obj  = (UnityEngine.RectTransform)ToLua.CheckObject(L, 1, typeof(UnityEngine.RectTransform));
                UnityEngine.Vector3[]     arg0 = new UnityEngine.Vector3[4];
                obj.GetLocalCorners(arg0);
                ToLua.Push(L, arg0);
                return(1);
            }
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
		private void DrawSizeDistances(Transform userSpace, Rect rectInParentSpace, Transform parentSpace, RectTransform gui, RectTransform guiParent, float size, int axis, float alpha)
		{
			if (alpha <= 0f)
			{
				return;
			}
			Color color = RectTransformEditor.kAnchorColor;
			color.a *= alpha;
			GUI.color = color;
			if (userSpace == gui.transform)
			{
				gui.GetWorldCorners(RectTransformEditor.s_Corners);
			}
			else
			{
				gui.GetLocalCorners(RectTransformEditor.s_Corners);
				for (int i = 0; i < 4; i++)
				{
					RectTransformEditor.s_Corners[i] += gui.transform.localPosition;
					RectTransformEditor.s_Corners[i] = userSpace.TransformPoint(RectTransformEditor.s_Corners[i]);
				}
			}
			string text = gui.sizeDelta[axis].ToString();
			GUIContent label = new GUIContent(text);
			Vector3 b = ((axis != 0) ? userSpace.right : userSpace.up) * size * 2f;
			this.DrawLabelBetweenPoints(RectTransformEditor.s_Corners[0] + b, RectTransformEditor.s_Corners[(axis != 0) ? 1 : 3] + b, label);
		}