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

            height += EditorGUIUtility.standardVerticalSpacing;
            return(height);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 4
0
 private float GetNoGraphSelectedHeight(float width)
 {
     return(LudiqGUIUtility.GetHelpBoxHeight(NoGraphSelectedMessage, MessageType.Info, width));
 }
Ejemplo n.º 5
0
 private float GetNoMultiEditHeight(float width)
 {
     return(LudiqGUIUtility.GetHelpBoxHeight(NoMultiEditMessage, MessageType.Info, width));
 }
Ejemplo n.º 6
0
 protected float GetExceptionHeight(float width)
 {
     return(LudiqGUIUtility.GetHelpBoxHeight(exceptionMessage, MessageType.Error, width));
 }
Ejemplo n.º 7
0
 public float GetHeight(float width)
 {
     return(LudiqGUIUtility.GetHelpBoxHeight(message, messageType, width));
 }
Ejemplo n.º 8
0
 private float GetComponentPrefabWarningHeight(float width)
 {
     return(LudiqGUIUtility.GetHelpBoxHeight(ComponentPrefabWarning, MessageType.Warning, width));
 }