> For the complete documentation index, see [llms.txt](https://tools.continis.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tools.continis.io/subassets-toolbox/api/isubassetaware.md).

# ISubAssetAware

Implement this interface in your ScriptableObjects, to make them compatible with the editor workflows of SubAssets Toolbox. By implementing these methods every time a sub-asset is added or removed in any way, the object can react and save a reference to it (or perform any other setup action).

For an example implementation, import the [SubAsset Aware Scriptable Object](/subassets-toolbox/samples/subassetawareso.md) sample, and take a look at the `SubAssetAwareSO` class.

***

### AddSubAsset

```csharp
public void AddSubAsset(Object newSubAsset);
```

An object has been added as a sub-asset.

In your implementation, you should insert the new object into any List, array, Dictionary, or any data structure that allows you to retrieve the sub-asset at a later stage.

### RemoveSubAsset

```csharp
public void RemoveSubAsset(Object removedSubAsset);
```

A sub-asset will be removed.

In your implementation, you should ensure that the reference to the destroyed object is removed from whatever data structure was referencing it.

When this method is invoked as part of the API included in SubAssets Toolbox the sub-asset hasn't been destroyed yet, so you can inspect it if needed.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://tools.continis.io/subassets-toolbox/api/isubassetaware.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.
