Skip to main content

EditorTools Sample

An editor window built in code with the package's helpers.

The Reset to defaults button returns the cost and the cooldown to their defaults, and Undo restores them.The Reset to defaults button returns the cost and the cooldown to their defaults, and Undo restores them.

The Reset to defaults button returns the cost and the cooldown to their defaults, and Undo restores them.

Open it​

  1. Import the sample: Tools → Aspid 🐍 → FastTools → Welcome → Samples → Import on EditorTools. It has no scene.
  2. Open Tools → Aspid 🐍 → FastTools → Samples → Ability Catalog: the abilities are on the left, the selected one on the right.

Try​

  1. A ListView in one chain. The list is one chain of ListView extensions. Type in the search field: the list filters.

  2. Binding. The fields are bound with .BindTo(serializedObject). Edit the name: the list and the title follow.

  3. Property setters. Select Fireball and press Reset to defaults: Mana Cost and Cooldown are applied once, so one Undo reverts both.

    serializedObject.FindProperty("_cooldown")
    .Update()
    .SetFloat(AbilityConfig.DefaultCooldown);
    serializedObject.FindProperty("_manaCost")
    .SetIntAndApply(AbilityConfig.DefaultManaCost);
  4. The type picker from code. Click Effect: TypeSelectorWindow.Show() opens the [TypeSelector] picker with the IAbilityEffect classes only.

  5. Open the script. Double-click the ability title: AddOpenScriptCommand opens AbilityConfig.cs. The title's tooltip names the script with GetDisplayName().

  6. The FastTools theme. Pick another Theme in Tools → Aspid 🐍 → FastTools → Settings → Appearance: AddAspidWindowTheme recolors the catalog at once.

Where to look​

FileShows
Scripts/Editor/AbilityCatalogWindow.csEvery call above
Styles/Colors from the theme's --aspid-colors-* tokens
Scripts/Effects/[TypeSelectorDisplay] names, a group and icons

Reference: VisualElement Extensions, SerializedProperty Extensions, Editor Helpers and TypeSelectorWindow.