Editor API (C#)

AirshipType

Used to query the types in Airship

var exampleComponentType = AirshipType.GetType("ExampleComponent");

string Name

The name of the type

string RuntimePath

The Runtime Lua path this type is associated with

string AssetPath

The Editor asset path of the file that contains this type

string UniqueId

A unique identifier for this type

AirshipType[] BaseTypes

The types this type inherits

AirshipDeclarationType DeclarationType

The declaration type of this type - e.g. Behaviour, Enum, ScriptableObject or SerialziableClass.

bool IsAssignableFrom(AirshipType baseType)

Used to check if this type is, or inherits another type

AirshipCustomEditors

static AirshipEditor GetEditor(AirshipComponent component)

Used to get the editor for the specified component

AirshipEditor

Derive from this base class to create a custom inspector for an AirshipBehaviour

[AirshipCustomEditor("TypeScriptClassName")]
public class ExampleComponentEditor : AirshipEditor {
    public override void OnInspectorGUI() {
        
    }
}

AirshipSerializedObject serializedObject

The serialized object

AirshipScript script

The script the editor is for

UnityEngine.Object target

The target object for this editor

void OnInspectorGUI()

The IMGUI inspector lifecycle for the editor

AirshipEditorGUI

Contains IMGUI drawing methods for Airship

static void HorizontalLine(Color color = default, int thickness = 1, int padding = 10, int margin = 0)

Draws a horizontal line

static bool PropertyField(AirshipSerializedProperty property)

Draws the given AirshipSerializedProperty.

static bool PropertyField(GUIContent label, AirshipSerializedProperty property)

Draws the given AirshipSerializedProperty with a custom label.

static int BeginTabs(int selectedIndex, GUIContent[] tabs)

Will draw a tab view, must contain an EndTabs call at the end of the content.

static void EndTabs()

static void BeginGroup(GUIContent label)

Begin a group (will be "grouped" in a padded frame)

static void EndGroup()

Ends the previous group scope