/// <summary> /// Draws a help box around the member. /// </summary> /// <param name="message">The message of the box.</param> /// <param name="type">The type of the box. It can be Info, Warning or Error (default: Info).</param> /// <param name="visibleCallback">callback to define whether or not the box is visible. /// The callback type should be bool.</param> /// <param name="positionCallback">Callback for the position options of the decoration. /// The callback type should be DecoratorPosition.</param> public HelpBoxAttribute(string message, HelpBoxType type, string visibleCallback, string positionCallback) : base(positionCallback, DecoratorPosition.Before) { Message = message; Type = type; VisibleCallback = visibleCallback; }
/// <summary> /// Displays a helpbox /// </summary> /// <param name="text">The text shown in the box</param> /// <param name="type">The type of box (icon) shown</param> public static void DrawHelpBox(string text, HelpBoxType type) { EditorGUILayout.BeginHorizontal(GuiStyles.ButtonNoHoverNoBorder); GUIContent content = new GUIContent(); switch (type) { case HelpBoxType.Warning: { content.image = Aura.ResourcesCollection.warningIconTexture; content.text = "\n<b>WARNING : </b>\n\n" + text + "\n"; } break; case HelpBoxType.Experimental: { content.image = Aura.ResourcesCollection.experimentalIconTexture; content.text = "\n<b>PREVIEW : </b>\n\n" + text + "\n"; } break; case HelpBoxType.Question: { content.image = Aura.ResourcesCollection.questionIconTexture; content.text = "\n" + text + "\n"; } break; } GUILayout.Label(content, GuiStyles.Label); EditorGUILayout.EndHorizontal(); }
/// <summary> /// Draws a help box around the member. /// </summary> /// <param name="message">The message of the box.</param> /// <param name="type">The type of the box. It can be Info, Warning or Error (default: Info).</param> /// <param name="visibleCallback">callback to define whether or not the box is visible. /// The callback type should be bool.</param> /// <param name="position">The position options of the decoration (default: Before).</param> public HelpBoxAttribute(string message, HelpBoxType type = HelpBoxType.Info, string visibleCallback = null, DecoratorPosition position = DecoratorPosition.Before) : base(position) { Message = message; Type = type; VisibleCallback = visibleCallback; }
public HelpBoxAttribute(string text, HelpBoxType messageType = HelpBoxType.None, int spaceAbove = 12, int spaceBelow = 4) { this.text = text; this.messageType = messageType; this.spaceAbove = spaceAbove; this.spaceBelow = spaceBelow; }
/// <summary> 取得訊息圖示 </summary> /// <param name="type"> 訊息類型 </param> private Texture GetHelpIcon(HelpBoxType type) { switch (type) { case HelpBoxType.None: return(null); case HelpBoxType.Info: return(EditorGUIUtility.IconContent("console.infoicon").image); case HelpBoxType.Warning: return(EditorGUIUtility.IconContent("console.warnicon").image); case HelpBoxType.Error: return(EditorGUIUtility.IconContent("console.erroricon").image); case HelpBoxType.C8763: if (customIcon_1 == null) { customIcon_1 = Resources.Load <Texture>("C8763"); } return(customIcon_1); //return EditorGUIUtility.IconContent("BuildSettings.SelectedIcon").image; default: return(null); } }
public MessageType GetMessageType( HelpBoxType type ) { switch ( type ) { case HelpBoxType.Error: return MessageType.Error; case HelpBoxType.Info: return MessageType.Info; case HelpBoxType.None: return MessageType.None; case HelpBoxType.Warning: return MessageType.Warning; } return 0; }
private MessageType GetHelpBoxType(HelpBoxType type) { switch (type) { case HelpBoxType.Info: return(MessageType.Info); case HelpBoxType.Warning: return(MessageType.Warning); case HelpBoxType.Error: return(MessageType.Error); default: return(MessageType.None); } }
public MessageType GetMessageType(HelpBoxType type) { switch (type) { case HelpBoxType.Error: return(MessageType.Error); case HelpBoxType.Info: return(MessageType.Info); case HelpBoxType.None: return(MessageType.None); case HelpBoxType.Warning: return(MessageType.Warning); } return(0); }
private MessageType GetType(HelpBoxType helpBoxType) { switch (helpBoxType) { default: case HelpBoxType.None: return(MessageType.None); case HelpBoxType.Info: return(MessageType.Info); case HelpBoxType.Warning: return(MessageType.Warning); case HelpBoxType.Error: return(MessageType.Error); } }
public HelpBoxAttribute(string message, HelpBoxType type, int order) { Message = message; Type = type; this.order = order; }
public HelpBoxAttribute(string message, HelpBoxType type) { Message = message; Type = type; this.order = 0; }
public HelpBoxAttribute(string message) { Message = message; Type = HelpBoxType.None; this.order = 0; }
public HelpBox() { Height = 40; Text = ""; Type = HelpBoxType.Info; }
public HelpBox(string text, float height, HelpBoxType type = HelpBoxType.Info) { Text = text; Height = height; Type = type; }
public HelpBoxAttribute(string message, HelpBoxType type = HelpBoxType.None, int order = 0) { Message = message; Type = type; this.order = order; //PropertyAttribute.order 在多个DecoratorDrawer叠加时 设置调用次序 }
/// <summary> /// Draws a help box around the member. /// </summary> /// <param name="message">The message of the box.</param> /// <param name="type">The type of the box. It can be Info, Warning or Error (default: Info).</param> /// <param name="position">The position options of the decoration (default: Before).</param> public HelpBoxAttribute(string message, HelpBoxType type, DecoratorPosition position) : this(message, type, null, position) { }
/// <summary> /// Draws a help box around the member. /// </summary> /// <param name="message">The message of the box.</param> /// <param name="type">The type of the box. It can be Info, Warning or Error (default: Info).</param> /// <param name="positionCallback">Callback for the position options of the decoration. /// The callback type should be DecoratorPosition.</param> public HelpBoxAttribute(string message, HelpBoxType type, string positionCallback) : this(message, type, null, positionCallback) { }
public HelpBox() { Text = string.Empty; Height = 40; Type = HelpBoxType.Info; }
public HelpBoxAttribute( string message) { Message = message; Type = HelpBoxType.None; this.order = 0; }
/// <summary> 顯示一個訊息欄位 </summary> /// <param name="tText" > 訊息內容 </param> /// <param name="tBoxType" > 訊息分類 </param> /// <param name="tIsAlwaysOpen"> 是否關閉摺疊功能 (true = 關閉) </param> public HelpBoxAttribute(string tText, HelpBoxType tBoxType = HelpBoxType.Info, bool tIsAlwaysOpen = false) { this.text = tText; this.BoxType = tBoxType; this.isAlwaysOpen = tIsAlwaysOpen; }
public HelpBoxAttribute( string message, HelpBoxType type) { Message = message; Type = type; this.order = 0; }
public HelpBox(string text, HelpBoxType type = HelpBoxType.Info) { Text = text; Height = 40; Type = type; }
public HelpBoxAttribute( string message, HelpBoxType type, int order) { Message = message; Type = type; this.order = order; }
/******************************** ******* CONSTRUCTORS ******* *******************************/ /// <summary> /// Display a help box with a message in the editor. /// </summary> /// <param name="_label">Label to display in the box.</param> /// <param name="_type">Type of box to display.</param> public HelpBoxAttribute(string _label, HelpBoxType _type) { Type = _type; Label = _label; }
public HelpBoxAttribute(string text, HelpBoxType type) { this.text = text; this.type = type; }