Skip to content

Action Category Icons

You can assign an icon to a custom action category. Category icons are shown in the Action Browser and other editor UI that displays action categories.

The recommended integration pattern is to implement IActionCategoryIconProvider. PlayMaker discovers providers when it needs to build action categories, so third-party packages do not need to use [InitializeOnLoad] just to register their icons.

Use RegisterCategoryIcon only when you already have a natural editor initialization point, or when you need to override the icon that would normally be discovered from a provider.

IActionCategoryIconProvider

Implement IActionCategoryIconProvider in an editor assembly to provide one or more category icons.

Provider types must have a parameterless constructor. They can be public or internal, and do not need an [InitializeOnLoad] attribute.

using System.Collections.Generic;
using HutongGames.PlayMaker.Editor;
using JetBrains.Annotations;
using UnityEditor;
using UnityEngine;

[UsedImplicitly]
public sealed class DialogueSystemCategoryIconProvider : IActionCategoryIconProvider
{
    public IEnumerable<ActionCategoryIcon> GetCategoryIcons()
    {
        yield return new ActionCategoryIcon(
            "Dialogue System",
            AssetDatabase.LoadAssetAtPath<Texture2D>(
                "Assets/Dialogue System/Editor/Icons/DialogueSystem.png"));
    }
}

The provider returns ActionCategoryIcon values. Each value maps a category name to a Texture2D.

yield return new ActionCategoryIcon("Dialogue System", icon);

Null icons are ignored, so a provider can safely return no icon while assets are missing or optional integrations are not installed.

You can also register an icon for a parent category. Child categories use the nearest parent category icon when they do not have their own icon.

RegisterCategoryIcon

ActionCategories.RegisterCategoryIcon is an imperative override API.

It is useful when:

  • You already have an editor setup or bootstrap path.
  • The icon depends on editor state, installed modules, user settings, or loaded assets.
  • You want to override an icon discovered from an IActionCategoryIconProvider.
  • You need a direct API for tests, diagnostics, or internal tools.
using HutongGames.PlayMaker.Editor;
using UnityEditor;
using UnityEngine;

Texture2D icon = AssetDatabase.LoadAssetAtPath<Texture2D>(
    "Assets/Dialogue System/Editor/Icons/DialogueSystem.png");

ActionCategories.RegisterCategoryIcon("Dialogue System", icon);

Passing null clears the registered icon:

ActionCategories.RegisterCategoryIcon("Dialogue System", null);

You can also clear a registered icon explicitly:

ActionCategories.UnregisterCategoryIcon("Dialogue System");

RegisterCategoryIcon takes precedence over icons discovered from providers. After the registered icon is cleared, PlayMaker falls back to the provider icon or the default category icon.