Info
- One window for the project's settings, definitions and other config assets
- Code in
EditorTools/Management (Polis.Core.EditorTools.Management), editor only. The attribute is in Polis.Core.OdinExtensions.Attributes
- Open with Polis/App Management in the menu or the sliders button on the main toolbar (Polis/App Management)
- Tree of pages with search on the left, the selected page on the right
Usage
[ManagementPanel(path, icon)] on a settings, definition or other ScriptableObject type - path in the tree and a FontAwesome icon, optional Order
- Other asset types: the page shows the only asset or lists them all.
Asset = Odin expression for the asset to show
- Types we don't own: put it on the assembly with the type as the first argument
- Custom page: subclass
AManagementPanel with a parameterless constructor, draw it with Odin attributes, override Refresh(). It is found by type, path and icon come from its own [ManagementPanel]
Example
[CreateAssetMenu(menuName = "Polis/Score Settings", fileName = nameof(ScoreSettings))]
[ManagementPanel("Settings/Score", FontAwesomeEditorIconType.TrophySolid)]
public class ScoreSettings : ScriptableObject, IAppSettings { }
// A type we don't own, one asset picked by an expression
[assembly: ManagementPanel(typeof(AddressableAssetSettings), "Project/Addressables", FontAwesomeEditorIconType.BoxesStackedSolid,
Asset = "@UnityEditor.AddressableAssets.AddressableAssetSettingsDefaultObject.Settings")]
Pages
- Settings - a page per
IAppSettings type, see Managers & Services
- Shows the asset inline
- Create when the project has none: next to the project's other settings, made addressable
- Make Addressable when the app doesn't use the asset: address
Settings/<name> in the Core group and the Settings label, same as the validator fix
- Warns when there are several assets of the type, the app uses the one with the label
- Definitions - a page per
AUniqueDefinition type, see Definitions
- List of its assets sorted by address, the selected one inline
- Refresh and + in the list header. A new definition goes next to the others, its ID comes from the file name
- Tells when the selected one is off and shows its Addressables problems
- Project, Network, Build - other assets: Unity's Player, Quality and Graphics settings, Addressables, Localization, XR Plug-in Management, the Build Tool's Global Settings, PurrNet network prefabs, addressable network prefabs and network rules
- A type without
[ManagementPanel] sits in a default folder (Settings, Definitions or Other) and its page says so
Gotchas
- Abstract, generic and obsolete types get no page
- Settings pages look only in
Assets/, definition pages also in packages