public SetInsetAndSizeFromParentEdge ( System.Edge edge, float inset, float size ) : void | ||
edge | System.Edge | |
inset | float | |
size | float | |
return | void |
// Use this for initialization void Start() { // Initialize the Component rectTransform = GetComponent<RectTransform>(); if (Math.Abs(Camera.main.aspect - 16.0f / 9.0f) < 0.1f) { rectTransform.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Bottom, Offset169.y, rectTransform.rect.height); } }
static int QPYX_SetInsetAndSizeFromParentEdge_YXQP(IntPtr L_YXQP) { try { ToLua.CheckArgsCount(L_YXQP, 4); UnityEngine.RectTransform QPYX_obj_YXQP = (UnityEngine.RectTransform)ToLua.CheckObject(L_YXQP, 1, typeof(UnityEngine.RectTransform)); UnityEngine.RectTransform.Edge QPYX_arg0_YXQP = (UnityEngine.RectTransform.Edge)ToLua.CheckObject(L_YXQP, 2, typeof(UnityEngine.RectTransform.Edge)); float QPYX_arg1_YXQP = (float)LuaDLL.luaL_checknumber(L_YXQP, 3); float QPYX_arg2_YXQP = (float)LuaDLL.luaL_checknumber(L_YXQP, 4); QPYX_obj_YXQP.SetInsetAndSizeFromParentEdge(QPYX_arg0_YXQP, QPYX_arg1_YXQP, QPYX_arg2_YXQP); return(0); } catch (Exception e_YXQP) { return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP)); } }
static int SetInsetAndSizeFromParentEdge(IntPtr L) { try { ToLua.CheckArgsCount(L, 4); UnityEngine.RectTransform obj = (UnityEngine.RectTransform)ToLua.CheckObject(L, 1, typeof(UnityEngine.RectTransform)); UnityEngine.RectTransform.Edge arg0 = (UnityEngine.RectTransform.Edge)ToLua.CheckObject(L, 2, typeof(UnityEngine.RectTransform.Edge)); float arg1 = (float)LuaDLL.luaL_checknumber(L, 3); float arg2 = (float)LuaDLL.luaL_checknumber(L, 4); obj.SetInsetAndSizeFromParentEdge(arg0, arg1, arg2); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static public int SetInsetAndSizeFromParentEdge(IntPtr l) { try { UnityEngine.RectTransform self = (UnityEngine.RectTransform)checkSelf(l); UnityEngine.RectTransform.Edge a1; checkEnum(l, 2, out a1); System.Single a2; checkType(l, 3, out a2); System.Single a3; checkType(l, 4, out a3); self.SetInsetAndSizeFromParentEdge(a1, a2, a3); return(0); } catch (Exception e) { return(error(l, e)); } }
static public int SetInsetAndSizeFromParentEdge(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.RectTransform.Edge a1; a1 = (UnityEngine.RectTransform.Edge)LuaDLL.luaL_checkinteger(l, 2); System.Single a2; checkType(l, 3, out a2); System.Single a3; checkType(l, 4, out a3); self.SetInsetAndSizeFromParentEdge(a1, a2, a3); 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 }
private void LayoutElement(RectTransform elemRect, float offsetX, float offsetY) { elemRect.SetParent(rect, false); elemRect.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Left, offsetX, elemRect.sizeDelta.x); elemRect.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Top, offsetY, elemRect.sizeDelta.y); }