Advanced Level Editor (ALE)
⚠ ALE IS IN VERY EARLY DEVELOPMENT! ANYTHING CAN CHANGE SUDDENLY! USE AT YOUR OWN RISK ⚠
Image is what ALE currently looks like. Will get periodically updated along with ALE. Keep in mind everything is a work in progress!
❓ What is it?
ALE is a runtime level editor for Unity that aims to be simple to use both for the user and the developer. It's built with performance and usability in mind. It should also be extendable so you can adapt it to fit just right for your game.
ALE works on a "editor mode system" where each mode does it's own thing and you switch between them. Right now there is only the (very much WIP!) unified mode that tries to replicate Unity. You can create your own modes and add them as components on the level editor and the mode will just work.
ALE also does some "magic" for you to simplify your life. It uses Mono.Cecil to do some code weaving and inject code into your assemblies to automate your workflow. This means it will be very performant since you can do stuff like exposing properties without reflection (which can be rather slow)! It also means that, in theory, ALE should work on ALL platforms, Mono and IL2CPP!
✨ The magic
As mentioned above, ALE does some "magic" for you. I've tried to avoid reflection as much as possible since it can be rather slow and instead opted to generate code during compile time, IL weaving if you will. The best example of this is the ExposeToLevelEditor
attribute that injects IExposeToLevelEditor
in your scripts.
In the future, the same will magic will be applied to much more. It's coming eventually™.
✅ TODO List
ALE is still in EARLY development. There's still a lot to do and it's nowhere close to finish. But it should be useable now. Anyways, here are some things that I need to do and the things that are finished.
Required
What needs to be done before 1.0.0 verified.
- Binary serialization and deserialization
- JSON serialization and deserialization
- Unified serializer for binary and JSON
- Editor camera
- Full 2D support
- Full 3D support
- Input System support
- Undo and redo
- Hierarchy
- Hierarchy customization
- Inspector
- Custom component fields
- Resource browser
- Resource browser customization
- Level editor gizmos
- Play mode
- Save all exposed values in play mode
- Auto serialize unknown types³
- Auto expose unknown types
- Integrate custom serializers
- Menu items
- Add component menus
- Fast enter play mode support
- Custom component wrappers
- Serialize arrays¹
- Serialize lists¹
- Serialize dictionary²
- Resource limit support
Optional
What would be really nice to have before 1.0.0 verified.
- Orientation gizmos
- Scene grid
- Manipulation handles
- Adaptive editor GUI
- Tilemap integration
- ProBuilder integration
- Multiselection support
- More errors and visuals to tell when something is wrong
- Custom component UGUI
- Unity mathematics support
- XML documentation in code
Inspector fields
The supported inspector fields.
- Number fields
- Text fields
- Toggle field
- Vector2(int) field
- Vector3(int) field
- Vector4/Quaternion field
- Object reference field
- Resource reference field
- Color field
- Array field
- Nested classes/structs
- Enum field
¹ Doesn't work 100% with Unity objects yet. May appear to work during runtime but most likely won't work in build!
² While technically it will serialize dictionaries, it won't serialize exposed field dictionaries.
³ It will automatically serialize structs but not classes.
📦 Installation
Without package manager
To install it without the package manager, download the project as a zip file and extract it from the packages folder. From there, put the files either inside your assets folder or in your packages folder.
With package manager
Currently, only the development package is available. It's updated with each commit to the master branch.
- Open the package manager and click 'Add from Git url' in the top right corner
- Paste in
https://github.com/Hertzole/advanced-level-editor.git#dev-package
and click enter - Wait an eternity for Unity to realize that you have installed the package.
- It should now be installed. Either create it from scratch or import the "Complete" sample and modify that. I recommend the sample because it's currently quite a pain to set everything up...
🔨 Getting Started
⚠ DOCUMENTATION IS VERY SPARSE RIGHT NOW AND WILL PROBABLY REMAIN SO FOR QUITE A WHILE ⚠
Setup a level editor
If you've installed it through the package manager, I recommend importing the "Complete" sample and start modifying that.
//TODO: Finish setup guide
Start by creating an empty object and add the Level Editor
component. Then assign the required fields.
Expose a field to the level editor
To expose a field or property to the level editor, you simply do
[ExposeToLevelEditor(0)]
public float myField;
[ExposeToLevelEditor(1)]
public string MyProperty { get; set; }
NOTICE! The IDs need to be unique and they are used for saving levels and fetching values! You should not change these after creating your exposed field!
Write custom writers and readers for serialization
TODO
📃 License
ALE itself is licensed under MIT. However, it contains some code that is under Unity's own license. As long as you use ALE within Unity, you're good to go.
❤ Credits
yasirkula - Dynamic Panels for Unity3D for panels
yasirkula - Runtime Inspector & Hierarchy for Unity 3D for tree control
Unity Technologies/ProBuilder team - GILES for editor camera
judah4 - HSV Color Picker for color picker
Mirage team - Lots of weaving code from Mirage
paulpach - Helped me with weaver related questions
Yoshifumi Kawai - MessagePack for C# for serialization
❤ Developed with love and support from Aurora Punks ❤