public override void OnInspectorGUI() { EditorGUILayout.PropertyField(_UIModProperty); EditorGUILayout.PropertyField(_controlIDProperty); serializedObject.ApplyModifiedProperties(); base.OnInspectorGUI(); EditorGUILayout.PropertyField(_constractDragOnFitProperty); ItemAlignTo alignType = (ItemAlignTo)_alignToProperty.enumValueIndex; EditorGUILayout.PropertyField(_alignToProperty); ++EditorGUI.indentLevel; if (alignType != ItemAlignTo.None) { if (alignType == ItemAlignTo.Target) { EditorGUILayout.PropertyField(_alignTargetProperty); EditorGUILayout.PropertyField(_alignItemIndexProperty); EditorGUILayout.PropertyField(_forceClampProperty); } } --EditorGUI.indentLevel; serializedObject.ApplyModifiedProperties(); }
private bool NeedReCaculateEdges() { bool result = false; float contentSize = 0; if (horizontal) { contentSize = content.rect.width; } else if (vertical) { contentSize = content.rect.height; } //内容有变化,需要重新计算对齐边界 if (Mathf.Abs(_lastSize - contentSize) > 10f) { _lastSize = contentSize; result = true; } //对齐方式变化,也需要重新计算对齐边界 if (_lastAlignTo != alignTo) { _lastAlignTo = alignTo; result = true; } return(result); }
static int set_alignTo(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIScrollView obj = (UIScrollView)o; ItemAlignTo arg0 = (ItemAlignTo)ToLua.CheckObject(L, 2, typeof(ItemAlignTo)); obj.alignTo = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index alignTo on a nil value")); } }
static int get_alignTo(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UIScrollView obj = (UIScrollView)o; ItemAlignTo ret = obj.alignTo; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index alignTo on a nil value")); } }