> For the complete documentation index, see [llms.txt](https://docs.fullscreen.no/info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fullscreen.no/info/standalone-assets/herobridge-standalone/api.md).

# API

### HeroBridge Standalone API Reference

All examples assume you already have a reference to a `SidekickCharacter` component.

```cs
SidekickCharacter sidekick = characterGameObject.GetComponent<SidekickCharacter>();
```

***

### Configuration

```csharp
/// <summary>
/// Enables or disables rebuilding the Animator hierarchy when applying parts.
/// </summary>
/// <param name="value">
/// True to rebuild the Animator root (recommended default behavior).
/// False to confirm the Animator reference without rebuilding.
/// </param>
sidekick.SetRebuildAnimatorRoot(bool value);
```

```csharp
/// <summary>
/// Sets whether the character body should be reset before applying new parts.
/// </summary>
/// <param name="value">
/// When true, parts not included in the new setup are removed.
/// When false, existing parts that are not overridden remain.
/// </param>
sidekick.SetResetBody(bool value);
```

```csharp
/// <summary>
/// Enables or disables automatic matching of symmetrical parts.
/// </summary>
/// <param name="value">
/// When enabled, matching left/right parts are applied if available.
/// </param>
sidekick.SetUseMatchingParts(bool value);
```

```csharp
/// <summary>
/// Enables or disables including a None option when cycling parts.
/// </summary>
/// <param name="value">
/// When enabled, cycling can remove the current part.
/// </param>
sidekick.SetIncludeNone(bool value);
```

***

### Parts

```csharp
/// <summary>
/// Applies one or more Sidekick parts to the character.
/// </summary>
/// <param name="partValue">
/// A part identifier or a comma-separated list of identifiers.
/// Example:
/// "SK_HUMN_BASE_01_01HEAD_HU01"
/// "SK_HUMN_BASE_01_01HEAD_HU01,SK_HUMN_BASE_01_02HAIR_HU01"
/// </param>
sidekick.SetPart(string partValue);
```

```csharp
/// <summary>
/// Removes the currently equipped part for a specific part type.
/// </summary>
/// <param name="partType">
/// The part type name, such as "Hair", "Head", or "Torso".
/// Type names are PascalCase without spaces.
/// </param>
sidekick.RemovePart(string partType);
```

***

### Cycling Parts

```csharp
/// <summary>
/// Cycles to the next available part of the specified type.
/// </summary>
/// <param name="partType">
/// The part type to cycle, such as "Hair" or "Head".
/// </param>
sidekick.CycleNext(string partType);
```

```csharp
/// <summary>
/// Cycles to the previous available part of the specified type.
/// </summary>
/// <param name="partType">
/// The part type to cycle, such as "Hair" or "Head".
/// </param>
sidekick.CyclePrevious(string partType);
```

```csharp
/// <summary>
/// Selects a random part from the available parts of the specified type.
/// </summary>
/// <param name="partType">
/// The part type to cycle, such as "Hair" or "Head".
/// </param>
sidekick.CycleRandom(string partType);
```

***

### Presets

```csharp
/// <summary>
/// Applies a Head preset by name.
/// </summary>
/// <param name="presetName">
/// The preset name as defined in Presets.json.
/// Example: "Species Humans 01".
/// </param>
sidekick.SetPresetHead(string presetName);
```

```csharp
/// <summary>
/// Applies an Upper Body preset by name.
/// </summary>
sidekick.SetPresetUpperBody(string presetName);
```

```csharp
/// <summary>
/// Applies a Lower Body preset by name.
/// </summary>
sidekick.SetPresetLowerBody(string presetName);
```

```csharp
/// <summary>
/// Applies a Body Shape preset by name.
/// </summary>
sidekick.SetPresetBodyShape(string presetName);
```

```csharp
/// <summary>
/// Applies a Species color preset by name.
/// </summary>
sidekick.SetPresetColorSpecies(string presetName);
```

```csharp
/// <summary>
/// Applies an Outfit color preset by name.
/// </summary>
sidekick.SetPresetColorOutfits(string presetName);
```

***

### Colors

```csharp
/// <summary>
/// Sets the color value that will be applied to a Sidekick color property.
/// </summary>
/// <param name="value">
/// An HTML color string such as "#FFAA00" or "#FFAA00FF".
/// </param>
sidekick.SetColorValue(string value);
```

```csharp
/// <summary>
/// Applies the previously set color to a specific Sidekick color property.
/// </summary>
/// <param name="colorPropertyName">
/// The name of the color property, such as "Skin Color" or "Hair Color".
/// </param>
sidekick.SetColorProperty(string colorPropertyName);
```

***

### Expressions

```csharp
/// <summary>
/// Sets the transition duration used when changing facial expressions.
/// </summary>
/// <param name="value">
/// Transition duration in seconds.
/// </param>
sidekick.SetExpressionTransition(float value);
```

```csharp
/// <summary>
/// Applies a facial expression to the character.
/// </summary>
/// <param name="emotion">
/// The expression name, such as "Happy", "In Pain", or "Neutral".
/// </param>
sidekick.SetEmotion(string emotion);
```

```csharp
/// <summary>
/// Restores the current facial expression after a part or preset change.
/// </summary>
sidekick.RestoreEmotionAfterChange();
```

```csharp
/// <summary>
/// Gets the name of the currently active facial expression.
/// </summary>
/// <returns>
/// The current emotion name, or "Neutral" if none is active.
/// </returns>
string emotion = sidekick.CurrentEmotion;
```

***

### Body Blendshapes

```csharp
/// <summary>
/// Sets the Body Type blendshape value.
/// </summary>
/// <param name="value">
/// A value between 0 and 100.
/// </param>
sidekick.SetBodyType(float value);
```

```csharp
/// <summary>
/// Sets the Body Size blendshape value.
/// </summary>
/// <param name="value">
/// A value between -100 and 100.
/// </param>
sidekick.SetBodySize(float value);
```

```csharp
/// <summary>
/// Sets the Musculature blendshape value.
/// </summary>
/// <param name="value">
/// A value between 0 and 100.
/// </param>
sidekick.SetMusculature(float value);
```

***

### Saving and Loading

{% hint style="info" %}
**Note:**\
The character GameObject name is used as the unique ID when saving and loading.
{% endhint %}

```csharp
/// <summary>
/// Saves the character appearance to a save slot.
/// </summary>
/// <param name="saveslot">
/// The save slot index. The value is rounded to an integer.
/// </param>
sidekick.SaveCharacter(float saveslot);
```

```cs
/// <summary>
/// Loads the character appearance from a save slot.
/// </summary>
/// <param name="saveslot">
/// The save slot index. The value is rounded to an integer.
/// </param>
sidekick.LoadCharacter(float saveslot);
```

### Components

The following components support being triggered manually via an `Apply()` method.\
All of them require a reference to a **GameObject with a Sidekick Character component**.

* Sidekick Part Applier
* Sidekick Preset Applier
* Sidekick Expression Applier
* Sidekick Cycle Part
* Sidekick Save Load Applier
* Sidekick Part Icon Generator
* Sidekick Color Applier
* Sidekick Body Blendshape Applier

These components can be used with **Apply Mode set to On Invoke**, so you can control exactly when they execute.

#### Example: Calling Apply from code

```cs
/// <summary>
/// Applies the configured behavior of a Sidekick Applier component.
/// </summary>
SidekickBodyBlendshapeApplier applier = GetComponent<SidekickBodyBlendshapeApplier>();
applier.Apply();
```
