Class AirshipBehaviourAbstract

A TypeScript parallel to the C# MonoBehaviour for Airship.

  • To expose the serializable properties to the inspector, it must be exported as default.

Example declaration:

export default class ExampleBehaviour extends AirshipBehaviour {
public OnStart() {
print("Hello, World!");
}
}

Hierarchy (view full)

Constructors

  • Use Awake instead of overloading the constructor!

    • You can specify non-optional properties using the null-assertion operator - !
    export default class ExampleBehaviour extends AirshipBehaviour {
    textComponent!: TMP_Text;
    Awake() {
    this.textComponent = this.gameObject.GetComponent<TMP_Text>();
    }
    }

    Returns AirshipBehaviour

    Deprecated

Properties

gameObject: GameObject

The GameObject this behaviour is attached to.

transform: Transform

The Transform this behaviour is attached to.

Methods

  • Awake is called when an enabled script instance is being loaded.

    Returns void

  • Frame-rate independent AirshipBehaviour.FixedUpdate message for physics calculations.

    Parameters

    • dt: number

    Returns void

  • LateUpdate is called every frame, if the AirshipBehaviour is enabled.

    Parameters

    • dt: number

    Returns void

  • Destroying the attached Behaviour will result in the game or Scene receiving OnDestroy.

    Returns void

  • This function is called when the behaviour becomes disabled.

    Returns void

  • This function is called when the object becomes enabled and active.

    Returns void

  • OnStart is called on the frame when a script is enabled just before any of the Update methods are called the first time.

    Returns void

  • Update is called every frame, if the AirshipBehaviour is enabled.

    Parameters

    • dt: number

    Returns void