# AirshipSingleton

In most games you will want to have some managers that are accessible from anywhere in your codebase. We support this with the AirshipSingleton:

```typescript
export default class WalletManager extends AirshipSingleton {
    public money = 0;
    // ...
}
```

An AirshipSingleton inherits from [AirshipBehaviour](/typescript/airshipbehaviour.md), meaning it can be attached to a Game Object in your scene and expose properties to the inspector. Uniquely, though, it can be used even without being attached to a game object manually.

To grab the instance of a singleton, you can use the static `Get` method on the Singleton from anywhere in your codebase:

```typescript
const myMoney = WalletManager.Get().money;
```

This will find the existing instance (if it exists), or create an instance if it does not.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.airship.gg/typescript/airshipbehaviour/airshipsingleton.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
