Customizing the Editor Window

This is the default look of your editor window:

 

You can customize the object selection / creation / deletion behaviour by overriding the following methods:

// Called when a new object is created, obj parameter is the new object
protected override void OnObjectNew(ObjectType obj);

// Called when an object is duplicated, obj parameter is the new object
protected override void OnObjectDuplicated(ObjectType obj);

// Called when an object is saved, obj parameter is the saved object
protected override void OnObjectSaved(ObjectType obj);

// Called when an object is deleted, obj parameter is the deleted object
protected override void OnObjectDeleted(ObjectType obj);

// Called when the selection changes, oldObj parameter is the previous object (can be null), newObj is the new object
protected override void OnSelectionChanged(ObjectType oldObj, ObjectType newObj);

 

You can also override the DrawCustomFunctions method to add custom actions below the « New <YourType> » button. For example:

protected override void DrawCustomFunctions()
{
    DrawCustomFunction("My Custom Function", CustomAction);
}

private void CustomAction()
{
    Debug.Log("This is my custom action!")
}

Finally, you can customize the core draw method of your window by overriding the DrawEditor method of your window:

protected override void DrawEditor(Card target)
{
    base.DrawEditor(target);

    // Do something else
}