void RectTransformGUI(UIRectTransformInfo style, UIStyleInfo info) { EditorGUI.indentLevel = 3; EditorGUILayout.BeginHorizontal(); style.isFold = EditorGUILayout.Foldout(style.isFold, "RectTransform:"); if (GUILayout.Button("删除")) { info.m_RectTransformInfo.isActive = false; } EditorGUILayout.EndHorizontal(); if (style.isFold) { EditorGUI.indentLevel = 4; style.anchoredPosition3D = EditorGUILayout.Vector3Field("AnchoredPosition3D", style.anchoredPosition3D); style.anchorMin = EditorGUILayout.Vector2Field("AnchorMin", style.anchorMin); style.anchorMax = EditorGUILayout.Vector2Field("AnchorMax", style.anchorMax); style.pivot = EditorGUILayout.Vector2Field("Pivot", style.pivot); style.localRotation = EditorGUILayout.Vector3Field("LocalRotation", style.localRotation); style.localScale = EditorGUILayout.Vector3Field("LocalScale", style.localScale); } }
public override UIStyleInfoInterface GetStyle(Component component) { RectTransform comp = (RectTransform)component; UIRectTransformInfo style = (UIRectTransformInfo)base.GetStyle(component); style.anchorMin = comp.anchorMin; style.anchorMax = comp.anchorMax; style.localRotation = comp.localEulerAngles; style.localScale = comp.localScale; style.pivot = comp.pivot; style.anchoredPosition3D = comp.anchoredPosition3D; style.sizeDelta = comp.sizeDelta; return(style); }