Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

Alchemy

> 开发工具
Open source

Provides a rich set of editor extensions and serialization extensions for Unity.

1.3K stars0 likes0 views
WebsiteGitHub

About

Provides a rich set of editor extensions and serialization extensions for Unity.

Alchemy

日本語版READMEはこちら

Overview

Alchemy is a library that provides attribute-based Inspector extensions.

In addition to providing easy and powerful attribute-based editor extensions, Alchemy can serialize types that Unity does not normally support, such as dictionaries, hash sets, nullable value types, and tuples, so they can be edited in the Inspector. Add the appropriate attributes to a target type and mark it as partial; a source generator creates the necessary code. Unlike Odin, there is no need to inherit from dedicated base classes.

v2.0 also adds EditorWindow and Hierarchy extensions. These make it easy to build tools that streamline your editor workflow.

Features

  • Add over 30 attributes to extend the Inspector
  • Support SerializeReference, allowing selection of types from a dropdown
  • Serialize additional types, including dictionaries, hash sets, nullable value types, and tuples, and edit them in the Inspector
  • Create EditorWindows using attributes
  • Improve Hierarchy usability
  • Create custom attributes that work with Alchemy

Setup

Requirements

  • Unity 2021.2 or later (Unity 2022.1 or later is recommended for serialization extensions)
  • Unity.Serialization 2.0 or later (for serialization extensions)

Installation

  1. Open the Package Manager from Window > Package Manager
  2. Click the "+" button > Add package from git URL
  3. Enter the following URL:
https://github.com/annulusgames/Alchemy.git?path=/Alchemy/Assets/Alchemy

Alternatively, open Packages/manifest.json and add the following entry to the dependencies block:

json
{
    "dependencies": {
        "com.annulusgames.alchemy": "https://github.com/annulusgames/Alchemy.git?path=/Alchemy/Assets/Alchemy"
    }
}

Documentation

The full documentation can be found here.

Basic Usage

To customize the display in the Inspector, add attributes to the class fields.

cs
using UnityEngine;
using UnityEngine.UIElements;
using Alchemy.Inspector;

public class AttributesExample : MonoBehaviour
{
    [LabelText("Custom Label")]
    public float foo;

    [HideLabel]
    public Vector3 bar;
    
    [AssetsOnly]
    public GameObject baz;

    [Title("Title")]
    [HelpBox("HelpBox", HelpBoxMessageType.Info)]
    [ReadOnly]
    public string message = "Read Only";
}

Attributes for grouping fields are also available. Groups can be nested by separating group names with a slash /.

cs
using UnityEngine;
using Alchemy.Inspector;

public class GroupAttributesExample : MonoBehaviour
{
    [FoldoutGroup("Foldout")]
    public int a;

    [FoldoutGroup("Foldout")]
    public int b;

    [FoldoutGroup("Foldout")]
    public int c;

    [TabGroup("Tab", "Tab1")]
    public int x;

    [TabGroup("Tab", "Tab2")]
    public string y;

    [TabGroup("Tab", "Tab3")]
    public Vector3 z;
}

By adding the [Button] attribute to a method, you can execute the method from the Inspector.

…

Alchemy provides many other attributes. The list of available attributes can be found in the documentation.

Editing Interfaces and Abstract Classes

Alchemy supports Unity's SerializeReference. By adding the [SerializeReference] attribute, interfaces and abstract classes can be edited in the Inspector.

cs
using System;
using UnityEngine;

public interface IExample { }

[Serializable]
public sealed class ExampleA : IExample
{
    public float alpha;
}

[Serializable]
public sealed class ExampleB : IExample
{
    public Vector3 beta;
}

[Serializable]
public sealed class ExampleC : IExample
{
    public GameObject gamma;
}

public class SerializeReferenceExample : MonoBehaviour
{
    [SerializeReference] public IExample Example;
    [SerializeReference] public IExample[] ExampleArray;
}

Interfaces and abstract classes are displayed as shown above, and you can select concrete types from the dropdown to instantiate them.

For more details, refer to SerializeReference.

Hierarchy

Alchemy provides several features that extend the Hierarchy.

Toggles and Icons

You can display active-state toggles and component icons for each object in the Hierarchy. These features can be configured in Project Settings.

Decoration

From the Create menu, you can create objects that decorate the Hierarchy.

These objects are automatically excluded from builds. If they have children, the children are unparented before the decorative objects are deleted. For more details, refer to Decorating the Hierarchy.

AlchemyEditorWindow

By inheriting from the AlchemyEditorWindow class instead of EditorWindow, you can create editor windows using Alchemy attributes.

…

Data for windows that inherit from AlchemyEditorWindow is saved as JSON in the project's ProjectSettings folder. For more details, refer to Saving Editor Window Data.

Using Serialization Extensions

To edit types that Unity does not normally serialize, such as dictionaries, use the [AlchemySerialize] attribute.

Serialization extensions require the Unity.Serialization package. Additionally, reflection-based serialization using Unity.Serialization may not work in AOT environments prior to Unity 2022.1. Check the package manual for details.

The following example uses Alchemy's serialization extension to make various types serializable and editable in the Inspector.

…

For technical details on the serialization process, refer to Alchemy Serialization Process in the documentation.

Help

Unity forum: https://forum.unity.com/threads/released-alchemy-inspector-serialization-extensions.1523665/

License

MIT License

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C#editor-extensionhierarchyinspectorserialization

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具