Adding Inspector Properties
Adding properties to your component
Any public marked property that is a valid serializable type in Unity will show up in the inspector for an AirshipBehaviour component
export default class ExampleAirshipBehaviour extends AirshipBehaviour {
public exampleString = "Hello, World!";
public exampleBoolean = true;
public exampleNumber = 10;
}
If you do not want your properties exposed, you can just specify them as private or protected. You can also use the @NonSerializable attribute decorator (and use @SerializeField to show private/protected fields to the inspector!)
Adding references to Unity and Airship components
You can add references to Unity Objects in the same way as values. If you might not attach a reference in the inspector you should define it as optional with a ?

Adding AirshipBehaviour reference properties
Just like our Unity Object references, we can also add references to other AirshipBehaviour components. Any defined class that extends AirshipBehaviour can be used as a reference.

Organizing your properties
You can use attributes to stylize our inspector properties using decorators:

JSDoc Tooltips
In Airship we support implicit JSDoc tooltips - which are generated by JSDoc comments:
NOTE: JSDoc Code blocks, inline code blocks, tables, hyperlinks and images are not supported in the editor and will not show up in the tooltips.
Not only does this have the benefit of being documented in your editor:

But Airship will also generate a tooltip in-editor with the same formatting:

Examples of formatting in the tooltips:

Last updated