Haruma-K/uPalette

How to manual generate enums.

Closed this issue · 1 comments

I see in readme how to Automatic generation of enums. Can i generate enums manual ?

@Anton111111
Sorry for the late reply. You can do it as follows!

using UnityEditor;
using uPalette.Editor.Core.Shared;
using uPalette.Runtime.Core;

public static class Example
{
    public static void GenerateNameEnums()
    {
        var paletteStore = PaletteStore.Instance;
        var generator = new GenerateNameEnumsFileService(paletteStore);
        generator.Run();
        AssetDatabase.Refresh();
    }
}