• Getting Started
    • Highlights
    • Installation
    • Change Log
  • General Attributes
    • Label & Text
      • RichLabel/NoLabel
      • AboveRichLabel / BelowRichLabel
      • OverlayRichLabel
      • PostFieldRichLabel
      • PlayaRichLabel
      • InfoBox/BelowInfoBox
      • PlayaInfoBox/PlayaBelowInfoBox
      • Separator / BelowSeparator
      • PlayaSeparator
      • SepTitle
      • GUIColor
    • Button
      • AboveButton/BelowButton/PostFieldButton
      • Button
    • Game Related
      • Layer
      • Scene
      • SortingLayer
      • Tag
      • InputAxis
      • ShaderParam
      • ShaderKeyword
    • Toggle & Switch
      • GameObjectActive
      • SpriteToggle
      • MaterialToggle
      • ColorToggle
    • Data Editor
      • Expandable
      • ReferencePicker
      • SaintsRow
      • ListDrawerSettings
      • Table
      • ShowInInspector
    • Numerical
      • Rate
      • PropRange
      • MinMaxSlider
      • ProgressBar
    • Animation
      • AnimatorParam
      • AnimatorState
      • CurveRange
    • Auto Getter
      • GetComponent
      • GetComponentInChildren
      • GetComponentInParent / GetComponentInParents
      • GetComponentInScene
      • GetPrefabWithComponent
      • GetScriptableObject
      • GetByXPath
      • AddComponent
      • FindComponent
      • GetComponentByPath
    • Validate & Restrict
      • FieldType
      • OnValueChanged
      • OnArraySizeChanged
      • ReadOnly/DisableIf/EnableIf
      • PlayaEnableIf/PlayaDisableIf
      • ShowIf / HideIf
      • PlayaShowIf/PlayaHideIf
      • Required
      • ValidateInput
      • MinValue / MaxValue
      • RequireType
      • ArraySize
      • PlayaArraySize
    • Layout
      • Ordered
      • Layout
      • LayoutStart / LayoutEnd
      • LayoutCloseHere / LayoutTerminateHere
      • LayoutDisableIf / LayoutEnableIf
      • LayoutShowIf / LayoutHideIf
    • Handles
      • DrawLabel
      • PositionHandle
      • DrawLine
      • SaintsArrow
      • ArrowHandleCap
      • DrawWireDisc
      • SphereHandleCap
    • Miscellaneous
      • Dropdown
      • AdvancedDropdown
      • EnumToggleButtons
      • FlagsDropdown
      • ResizableTextArea
      • LeftToggle
      • ResourcePath
      • ResourceFolder
      • DefaultExpand
      • ArrayDefaultExpand
      • AssetFolder
      • AssetPreview
      • AboveImage/BelowImage
      • ParticlePlay
      • ButtonAddOnClick
      • OnButtonClick
      • OnEvent
      • ColorPalette
  • Data Types
    • SaintsArray/SaintsList
    • SaintsDictionary<,>
    • SaintsInterface<,>/SaintsObjInterface<>
  • Addressable
    • AddressableLabel
    • AddressableAddress
    • AddressableResource
    • AddressableScene
  • AI Navigation
    • NavMeshAreaMask
    • NavMeshArea
  • Netcode for Game Objects
  • Spine
    • SpineAnimationPicker
    • SpineSkinPicker
    • SpineSlotPicker
    • SpineAttachmentPicker
  • DOTween
    • DOTweenPlay
    • DOTweenPlayStart / DOTweenPlayEnd
  • I2 Localization
    • LocalizedStringPicker
  • SaintsEditor
  • SaintsEditorWindow
    • Usage & Example
    • Life Circle & Functions
    • WindowInlineEditor
  • Misc
    • About GroupBy
    • Syntax for Show/Hide/Enable/Disable-If
    • Saints XPath-like Syntax
      • XPath
      • EXP
    • Add a Macro
    • Auto Validator
    • Common Pitfalls & Compatibility
      • List/Array & Nesting
      • Order Matters
      • Fallback To Other Drawers

Usage & Example

Basic usage: inherent from SaintsField.Editor.SaintsEditorWindow

#if UNITY_EDITOR using SaintsField.Editor; public class ExamplePanel: SaintsEditorWindow { [MenuItem("Window/Saints/Example/SaintsEditor")] public static void OpenWindow() { EditorWindow window = GetWindow<ExamplePanel>(false, "My Panel"); window.Show(); } // fields [ResizableTextArea] public string myString; [ProgressBar(100f)] public float myProgress; // life-circle: OnUpdate function public override void OnEditorUpdate() { myProgress = (myProgress + 1f) % 100; } [ProgressBar(100f)] public float myCoroutine; // Layout supported [LayoutStart("Coroutine", ELayout.Horizontal)] private IEnumerator _startProcessing; // Button etc supported // EditorCoroutine supported [Button] public void StartIt() { StartEditorCoroutine(_startProcessing = StartProcessing()); } [Button] public void StopIt() { if (_startProcessing != null) { StopEditorCoroutine(_startProcessing); } _startProcessing = null; } private IEnumerator StartProcessing() { myCoroutine = 0; while (myCoroutine < 100f) { myCoroutine += 1f; yield return null; } } // Other life-circle public override void OnEditorEnable() { Debug.Log("Enable"); } public override void OnEditorDisable() { Debug.Log("Disable"); } public override void OnEditorDestroy() { Debug.Log("Destroy"); } } #endif

An example of using as a ScriptableObject editor (or any serializable object)

#if UNITY_EDITOR using SaintsField.Editor; using SaintsField.Playa; public class ExampleSo: SaintsEditorWindow { [MenuItem("Window/Saints/Example/ScriptableEditor")] public static void OpenWindow() { EditorWindow window = GetWindow<ExampleSo>(false, "Scriptable Editor"); window.Show(); } [ AdvancedDropdown(nameof(ShowDropdown)), OnValueChanged(nameof(TargetChanged)) ] public ScriptableObject inspectTarget; [WindowInlineEditor] // this will inline the serialized object editor public Object editorInlineInspect; private IReadOnlyList<ScriptableObject> GetAllSo() => Resources.LoadAll<ScriptableObject>(""); private AdvancedDropdownList<ScriptableObject> ShowDropdown() { AdvancedDropdownList<ScriptableObject> down = new AdvancedDropdownList<ScriptableObject>(); down.Add("[Null]", null); foreach (ScriptableObject scriptableObject in GetAllSo()) { down.Add(scriptableObject.name, scriptableObject); } return down; } private void TargetChanged(ScriptableObject so) { Debug.Log($"changed to {so}"); editorInlineInspect = so; titleContent = new GUIContent(so == null? "Pick One": $"Edit {so.name}"); } [LayoutStart("Buttons", ELayout.Horizontal)] [Button] private void Save() {} [Button] private void Discard() {} } #endif