How to add properties/variables for AIPath derived classes

Hi, when making a derived class from AIPath my public variables do not show up in the inspector. How can I make them appear? Thanks for any info.

Similar post here but no reply -

image

Hi

Good point. Currently what you have to do is to create a custom editor script and add your property there.

[CustomEditor(typeof(MyAI), true)]
[CanEditMultipleObjects]
public class MyAIEditor : BaseAIEditor {
    protected override void Inspector () {
        base.Inspector();
        PropertyField("myField");
   }
}

I’ve made changes locally so that the default editor will expose all fields it doesn’t already know about. This will be included in the next beta update.

1 Like