-
Notifications
You must be signed in to change notification settings - Fork 126
3. Regular Attributes
All attributes based on built-in class - PropertyAttribute. It means they work independently to Toolbox Editor, can be used without limitation outside this package, and have priority over all Toolbox attributes. You can use only one attribute per property.
- TagSelectorAttribute
- ProgressBarAttribute
- MinMaxSliderAttribute
- AssetPreviewAttribute
- SuffixAttribute
- EnumTogglesAttribute
- NotNullAttribute
- DirectoryAttribute
- SceneNameAttribute
- PresetAttribute
- SearchableEnumAttribute
- PasswordAttribute
- LeftToggleAttribute
- FormattedNumberAttribute
- LayerAttribute
- AnimationCurveSettingsAttribute
- ClampAttribute
- ChildObjectOnlyAttribute
- SceneObjectOnlyAttribute
- PrefabObjectOnlyAttribute
- NotPrefabObjectOnlyAttribute
Supported types: string.
[TagSelector]
public string var1;
Supported types: int, float, double.
[ProgressBar("Name", minValue: 0.0f, maxValue: 100.0f, HexColor = "#EB7D34", IsInteractable = true)]
public float var1 = 80.0f;
Supported types: Vector2.
[MinMaxSlider(0.5f, 71.7f)]
public Vector2 var1;
Supported types: any UnityEngine.Object.
[AssetPreview]
public GameObject var1;
[AssetPreview(useLabel: false)]
public Component var2;
Supported types: all.
[Suffix("cm")]
public float var1;
Supported types: Enum.
[System.Flags]
public enum FlagExample
{
Nothing = 0,
Flag1 = 1,
Flag2 = 2,
Flag3 = 4,
Flag4 = 8,
Flag5 = 16,
Flag6 = 32,
Flag7 = 64,
Flag8 = 128,
Flag9 = 256,
Everything = ~0
}
[EnumToggles]
public FlagExample enumFlag = FlagExample.Flag1 | FlagExample.Flag2 | FlagExample.Flag6;
Supported types: any UnityEngine.Object.
[NotNull("Variable has to be assigned.")]
public Transform var1;
*This attribute will be deprecated and reimplemented as part of the Toolbox attributes.
Supported types: string.
[Directory]
public string var1;
Supported types: string.
[SceneName]
public string var1;
Supported types: all. Remark: can be used only within classes, structs are not supported.
private readonly int[] presetValues = new[] { 1, 2, 3, 4, 5 };
[Preset(nameof(presetValues))]
public int presetTarget;
Supported types: any Enum.
[SearchableEnum]
public KeyCode enumSearch;
Supported types: string.
[Password]
public string password;
Supported types: bool.
[LeftToggle]
public bool var1;
Supported types: int, float, double.
[FormattedNumber]
public int bigNumber;
Supported types: int.
[Layer]
public int var1;
Supported types: AnimationCurve.
[AnimationCurveSettings(-2, -2, 2, 2, HexColor = "#FFD666")]
public AnimationCurve animationCurve
Supported types: int, float, double.
[Clamp(minValue = 1.5f, maxValue = 11.3f)]
public double var1;
*This attribute will be deprecated and reimplemented as part of the Toolbox attributes.
Supported types: GameObject, Component.
[ChildObjectOnlyAttribute]
public GameObject var1
*This attribute will be deprecated and reimplemented as part of the Toolbox attributes.
Supported types: GameObject, Component.
[SceneObjectOnlyAttribute]
public GameObject var1
*This attribute will be deprecated and reimplemented as part of the Toolbox attributes.
Supported types: GameObject, Component.
[PrefabObjectOnlyAttribute]
public GameObject var1
*This attribute will be deprecated and reimplemented as part of the Toolbox attributes.
Supported types: GameObject, Component.
[NotPrefabObjectOnlyAttribute]
public GameObject var1
*This attribute will be deprecated and reimplemented as part of the Toolbox attributes.