Doloro GDK 22 .1.0 Beta
by Tauri Interactive
Custom inspector tabs

Table of Contents

About

You may find very useful ability to extend the inspector with you own source.

Just several cases of use you could face during your development:

  • you have some tool that should be integrated to the IDE.
  • you need custom uniform interface for certain nodes.
  • you are frequently doing same actions and want to bind them on some in-IDE hotkey or on-screen button.

All the mentioned case as a lot of other can be solved by extending the inspector with a custom module.

Development

To create a loadable module enough to create a class derived from the Doloro.AI.DAIInspector.AInspectorTab. But to make it right you should follow the next steps.

  1. (Optional) Create a folder that will be a root of your module and add new Assembly definition to make the module distributable.
    1. Add references to the DoloroAICore, DoloroAICoreEditor, DoloroAIInspector, DoloroAIInspectorEditor assemblies to the definition.
  2. Create an Editor folder. That folder will locate editor-only assembly.
  3. Create new class.
  4. Derive the class from the Doloro.AI.DAIInspector.AInspectorTab.

Now you got a draft of your future module entry class.

namespace Doloro.AI.DAIInspector
{
public class NEW_INSPECTOR_TAB_CLASS : AInspectorTab
{
public override GUIContent Header => new System.NotImplementedException();
public override string GUID => new System.NotImplementedException();
// Tab constructor.
public NEW_INSPECTOR_TAB_CLASS(Inspector inspector) : base(inspector) { }
// Tab GUI.
public override void OnInspectorGUI() {}
}
}

Now you need to adjust the tab integration settings by overriding the following members. That's an optional step.

Member Type Purpose
Header GUIContent Content that will be show at the Inspector within tab's header. Use to define title, tooltip and icon.
GUID string Unique key related to the tab. Using in internal systems to track its cross-session system data. Must be constant.
Order int Order in tabs sorting. Lesser - higher in view.
ModifiesAISource bool If true the inspector will track the changes in GUI and apply them to the source project. Set true in case you are providing access to node's fields \ properties

After ending with embedding adjustments, you may start with the module features development by implementation of following handlers.

Member Type Purpose
OnInspectorGUI void() Handler that class to draw tab's GUI.
OnPostHeader void() Handler that class after the tab header has being drawn. Use to add extra UI above. Use GUILayoutUtility.GetLastRect() to get rendered tab header's on-screen rect.

Example

Features development for Inspector limited only with your imagination and experience as developer. As best example we recommend you to explore following tabs sources:

Tab Details
Doloro.AI.DAIInspector.DefaultPropertiesTab Default node inspector
Doloro.AI.DAIInspector.CustomPropertiesTab Custom node inspector
Doloro.AI.DAIInspector.HistoryTab History tab
Doloro.AI.DAIInspector.DebugTab Debug tab