protected override float GetHeight(float width, GUIContent label)
        {
            var height = LudiqGUIUtility.GetHelpBoxHeight(message, MessageType.Warning, width);

            height += EditorGUIUtility.standardVerticalSpacing;
            return(height);
        }
Beispiel #2
0
        private float GetBackgroundEmbedWarningHeight(float width)
        {
            var fixContent = new GUIContent("Fix");

            var fixButtonWidth = Styles.fixBackgroundEmbedButton.CalcSize(fixContent).x - (Styles.spaceBeforeButton / 2);
            var warningWidth   = width - fixButtonWidth - (Styles.spaceBeforeButton / 2);
            var warningHeight  = LudiqGUIUtility.GetHelpBoxHeight(BackgroundEmbedWarning, MessageType.Warning, warningWidth);

            return(warningHeight);
        }
Beispiel #3
0
        private void OnBackgroundEmbedWarningGUI(Rect position, ref float y)
        {
            var fixContent = new GUIContent("Fix");

            var fixButtonWidth = Styles.fixBackgroundEmbedButton.CalcSize(fixContent).x - (Styles.spaceBeforeButton / 2);
            var warningWidth   = position.width - fixButtonWidth - (Styles.spaceBeforeButton / 2);
            var warningHeight  = LudiqGUIUtility.GetHelpBoxHeight(BackgroundEmbedWarning, MessageType.Warning, warningWidth);

            var warningPosition = new Rect
                                  (
                position.x,
                y,
                warningWidth,
                warningHeight
                                  );

            var fixButtonPosition = new Rect
                                    (
                warningPosition.xMax + Styles.spaceBeforeButton,
                y,
                fixButtonWidth,
                warningHeight
                                    );

            EditorGUI.HelpBox(warningPosition, BackgroundEmbedWarning, MessageType.Warning);

            if (GUI.Button(fixButtonPosition, fixContent))
            {
                if (EditorUtility.DisplayDialog("Background Embed Graph", "A background embed graph has been detected on this nest. This may cause slowdowns on serialization operations and unfixable background warnings. Do you want to delete the embed graph?", "Delete", "Cancel"))
                {
                    metadata.RecordUndo();
                    embedGraphMetadata.value = null;
                }
            }

            y += warningPosition.height;
        }
Beispiel #4
0
 protected float GetExceptionHeight(float width)
 {
     return(LudiqGUIUtility.GetHelpBoxHeight(exceptionMessage, MessageType.Error, width));
 }
Beispiel #5
0
 private float GetComponentPrefabWarningHeight(float width)
 {
     return(LudiqGUIUtility.GetHelpBoxHeight(ComponentPrefabWarning, MessageType.Warning, width));
 }
Beispiel #6
0
 private float GetNoGraphSelectedHeight(float width)
 {
     return(LudiqGUIUtility.GetHelpBoxHeight(NoGraphSelectedMessage, MessageType.Info, width));
 }
Beispiel #7
0
 private float GetNoMultiEditHeight(float width)
 {
     return(LudiqGUIUtility.GetHelpBoxHeight(NoMultiEditMessage, MessageType.Info, width));
 }
Beispiel #8
0
 public float GetHeight(float width)
 {
     return(LudiqGUIUtility.GetHelpBoxHeight(message, messageType, width));
 }