static void DrawLine(float labelSize, float labelHeight, GUIContent visibilityContent, GUIContent tooltipContent, bool objectVisible, Action <bool> setVisibility, GUIContent lockContent = null, bool objectLocked = false, Action <bool> setLocked = null) { var marsStyles = MarsEditorGUI.Styles; using (new EditorGUILayout.HorizontalScope()) { GUILayoutUtility.GetRect(GUIContent.none, marsStyles.LabelLeftAligned, GUILayout.Width(k_IndentWidth)); EditorGUILayout.LabelField(visibilityContent, marsStyles.LabelLeftAligned, GUILayout.Width(labelSize + k_IndentWidth + k_LabelPadding)); using (var changed = new EditorGUI.ChangeCheckScope()) { objectVisible = EditorGUIUtils.ImageToggle(objectVisible, tooltipContent, marsStyles.AnimationVisibilityToggleOn, marsStyles.AnimationVisibilityToggleOff, marsStyles.SingleLineAlignment, GUILayout.Height(labelHeight), GUILayout.Width(labelHeight)); if (changed.changed) { setVisibility(objectVisible); } } if (setLocked == null) { return; } var inLock = MarsEditorGUI.InternalEditorStyles.InLock; var inLockHeight = inLock.CalcHeight(lockContent, inLock.fixedWidth); var lockRect = GUILayoutUtility.GetRect(inLock.fixedWidth, inLockHeight, marsStyles.SingleLineAlignment); using (var changed = new EditorGUI.ChangeCheckScope()) { objectLocked = GUI.Toggle(lockRect, objectLocked, lockContent, MarsEditorGUI.InternalEditorStyles.InLock); if (changed.changed) { setLocked(objectLocked); } } } }