This repository has been archived by the owner on Dec 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Attributes
Annulus Games edited this page Feb 12, 2023
·
3 revisions
There are currently 31 types of attributes available.
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[ReadOnly] public int foo;
[ReadOnly] public int bar;
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[Button]
private void Foo()
{
Debug.Log("Foo!");
}
[Button(InspectorButtonSize.Large)]
private void Bar()
{
Debug.Log("Bar!");
}
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[PropertyOrder(1)] public int foo;
[PropertyOrder(0)] public string bar;
[PropertyOrder(-1), Button]
private void Baz()
{
Debug.Log("Baz!");
}
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[SerializeField]
private int _foo;
[ShowInInspector]
public int foo => _foo;
[ShowInInspector]
public int GetFoo()
{
return _foo;
}
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[OnValueChanged("OnValueChanged")] public int foo;
private void OnValueChanged(int value)
{
Debug.Log(value);
}
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
[HideMonoScript]
public class AttributeExample : MonoBehaviour
{
public int foo;
public string bar;
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
[DisableLucidEditor]
public class AttributeExample : MonoBehaviour
{
[SerializeReference] public IFoo foo;
public string bar;
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[Blockquote("Blockquote")]
public int foo;
public string bar;
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[TitleHeader("Title")]
public int foo;
public string bar;
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[SectionHeader("Section")]
public int foo;
public string bar;
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[HorizontalLine]
public int foo;
[HorizontalLine(InspectorColor.Red)]
public string bar;
[HorizontalLine(1f, 0.5f, 0f)]
public Vector3 baz;
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[GUIColor(InspectorColor.EditorWarning)] public int foo;
[GUIColor(0.5f, 0.5f, 0f)] public string bar;
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[Indent] public int foo;
[Indent(2)] public string bar;
[Indent(3)] public Vector3 baz;
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[HideLabel] public int foo;
[HideLabel] public string bar;
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[LabelText("Hello")] public int foo;
[LabelText("World")] public string bar;
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[LabelWidth(40f)] public int foo;
[LabelWidth(200f)] public string bar;
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[HelpBox("Info")] public int foo;
[HelpBox("Error", HelpBoxMessageType.Error)] public string bar;
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[HelpBoxIf("IsNull", "obj is null.", HelpBoxMessageType.Error)] public GameObject obj;
private bool IsNull()
{
return obj == null;
}
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
public bool show;
[ShowIf("show")] public GameObject obj;
[ShowIf("AlwaysTrue")] public int foo;
[ShowIf("AlwaysFalse")] public string bar;
private bool AlwaysTrue => true;
private bool AlwaysFalse()
{
return false;
}
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
public bool hide;
[HideIf("hide")] public GameObject obj;
[HideIf("AlwaysTrue")] public int foo;
[HideIf("AlwaysFalse")] public string bar;
private bool AlwaysTrue => true;
private bool AlwaysFalse()
{
return false;
}
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
public bool active;
[EnableIf("active")] public GameObject obj;
[EnableIf("AlwaysTrue")] public int foo;
[EnableIf("AlwaysFalse")] public string bar;
private bool AlwaysTrue => true;
private bool AlwaysFalse()
{
return false;
}
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
public bool inactive;
[DisableIf("inactive")] public GameObject obj;
[DisableIf("AlwaysTrue")] public int foo;
[DisableIf("AlwaysFalse")] public string bar;
private bool AlwaysTrue => true;
private bool AlwaysFalse()
{
return false;
}
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[DisableInPlayMode] public int foo;
[DisableInPlayMode] public string bar;
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[DisableInEditMode] public int foo;
[DisableInEditMode] public string bar;
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[Required]
public GameObject obj;
[Required("Custom Message")]
public Transform tr;
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[ValidateInput("IsNotNull")]
public GameObject obj;
[ValidateInput("IsZeroOrGreater", "foo must be 0 or greater.")]
public int foo = -1;
private bool IsNotNull(GameObject go)
{
return go != null;
}
private bool IsZeroOrGreater(int a)
{
return a >= 0;
}
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[Group("GroupName")] public int foo;
[Group("GroupName")] public string bar;
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[BoxGroup("Box")] public int foo;
[BoxGroup("Box")] public string bar;
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[FoldoutGroup("Foldout")] public int foo;
[FoldoutGroup("Foldout")] public string bar;
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[TabGroup("Tab", "Tab A")] public int foo;
[TabGroup("Tab", "Tab B")] public string bar;
[TabGroup("Tab", "Tab C")] public Vector3 baz;
}
using UnityEngine;
using AnnulusGames.LucidTools.Inspector;
public class AttributeExample : MonoBehaviour
{
[HorizontalGroup("Horizontal")] public int foo;
[HorizontalGroup("Horizontal")] public int bar;
[HorizontalGroup("Horizontal")] public int baz;
}