Beispiel #1
0
 /// <summary>
 /// Draws the read-only field that links to the script anywhere in the inspector.
 /// </summary>
 /// <param name="position">The position options of the decoration.</param>
 public ScriptFieldAttribute(DecoratorPosition position = DecoratorPosition.Before) : base(position)
 {
 }
Beispiel #2
0
 /// <summary>
 /// Draws a label with a prefix around the member.
 /// </summary>
 /// <param name="prefix"> The text of the prefix.</param>
 /// <param name="label">The text of the label.</param>
 /// <param name="position">The position options of the decoration.</param>
 public LabelAttribute(string prefix, string label, DecoratorPosition position) : base(prefix, label, false, false, position)
 {
 }
Beispiel #3
0
 /// <summary>
 /// Draws a label around the member.
 /// </summary>
 /// <param name="label">The text of the label.</param>
 /// <param name="labelAsCallback">Choose whether or not the label should be considered as a callback of type string.</param>
 /// <param name="styleName">The style name for the GUIStyle of the label (it won't affect the prefix).
 /// See the doc for more info on style names.</param>
 /// <param name="position">The position options of the decoration.</param>
 public LabelAttribute(string label, bool labelAsCallback, string styleName, DecoratorPosition position) : base(label,
                                                                                                                labelAsCallback, position) => StyleName = styleName;
Beispiel #4
0
 public static bool Contains(this DecoratorPosition position, DecoratorPosition flag) => (position & flag) != 0;
Beispiel #5
0
 public static bool ContainsExact(this DecoratorPosition position, DecoratorPosition flag) => (position & flag) == flag;
Beispiel #6
0
 /// <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)
 {
 }
Beispiel #7
0
 protected BasePositionDecoratorAttribute(DecoratorPosition position) => Position = position;
Beispiel #8
0
 /// <summary>
 /// Draws a help box around the member.
 /// </summary>
 /// <param name="message">The message of the box.</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, string visibleCallback, DecoratorPosition position = DecoratorPosition.Before)
     : this(message, HelpBoxType.Info, visibleCallback, position)
 {
 }
 public FlexibleSpaceAttribute(DecoratorPosition position = DecoratorPosition.Before) => Position = position;
Beispiel #10
0
 /// <summary>
 /// Draws a title around the member, just like Unity's [Header].
 /// </summary>
 /// <param name="title">The text of the title.</param>
 /// <param name="position">The position options of the decoration (default: Before).</param>
 public TitleAttribute(string title, DecoratorPosition position = DecoratorPosition.Before) : base(position) => Title = title;
Beispiel #11
0
        protected BaseLabelAttribute(string prefix, string label, bool prefixAsCallback, bool labelAsCallback, DecoratorPosition position)
            : base(position)
        {
            Prefix = prefix;
            Label  = label;

            PrefixAsCallback = prefixAsCallback;
            LabelAsCallback  = labelAsCallback;
        }
Beispiel #12
0
 protected BaseLabelAttribute(string label, bool labelAsCallback, DecoratorPosition position) : base(position)
 {
     Label           = label;
     LabelAsCallback = labelAsCallback;
 }