Interface ICharacterKeyResolver
Tells which registered character a piece of authored content stands for, so content that names a character by what it spawns — a prefab, a character's config — can ask ICharacterSpawnService for it by the key the character was registered under.
Namespace: Serenity.Character.Application.Interfaces.Services
Assembly: Serenity.Character.Application.dll
Syntax
public interface ICharacterKeyResolver
Remarks
The shipped character spawn service implements it over the characters it registered. A wave entry names its character by Id and the wave service asks this resolver for that Id; only in the editor does an entry that names no Id fall back to asking which registered character its actor prefab belongs to, because a prefab matches by reference and a build may load two copies of it. A replacement spawn service that does not implement it leaves every wave entry unspawned, with a warning naming the entry.
Methods
TryResolveCharacterKey(object, out string)
Finds the key of the registered character authoredCharacter stands for.
Declaration
bool TryResolveCharacterKey(object authoredCharacter, out string characterKey)
Parameters
| Type | Name | Description |
|---|---|---|
| object | authoredCharacter | What the content references: a registered key, a registered character's config, or the prefab a registered character's config names. |
| string | characterKey | The key to pass to Spawn(string, float, float, float, float, float, float, float), or null when no registered character matches. |
Returns
| Type | Description |
|---|---|
| bool | True when a registered character matches. |