UserRepresentationType
Namespace: Holo.Core
Assembly: Holo.Core
Description
Represents a type of user representation (e.g. Avatar, Webcam, HoloCapturer).
It exposes a runtime-extendable registry that allows you to:
- Use built-in types (e.g.
UserRepresentationType.AVATAR,UserRepresentationType.WEBCAM, etc.) - Register new custom types at runtime via
CreateAndRegister.
Syntax
public sealed class UserRepresentationType
{
public string Id { get; }
public string DisplayName { get; }
public bool IsPlayer { get; }
public UserRepresentationType Register();
public static UserRepresentationType CreateAndRegister(string _id, string _displayName, bool _isPlayer);
public static UserRepresentationType Get(string id);
public static UserRepresentationType GetByDisplayName(string displayName);
public static IEnumerable<UserRepresentationType> GetAll();
public static List<UserRepresentationType> GetOrdered();
public static void RegisterBuiltIns();
}
Properties
| Property | Type | Description |
|---|---|---|
| Id | string | Stable internal identifier (e.g. "AVATAR", "WEBCAM"). |
| DisplayName | string | Human-readable name used in UI elements. |
| IsPlayer | bool | Indicates whether this representation counts as an active player. |
Static Methods
| Method | Description |
|---|---|
| CreateAndRegister(string _id, string _displayName, bool _isPlayer) | Creates and registers a new representation type, throwing if Id is null/empty or already registered. |
| Get(string id) | Returns the UserRepresentationType with the given ID, or null if not registered. |
| GetByDisplayName(string displayName) | Returns the type with the given display name, or null if not registered. |
| GetAll() | Returns all registered types (built-in + custom). |
| GetOrdered() | Returns all registered types ordered by DisplayName. |
| RegisterBuiltIns() | Registers all built-in constants (NONE, AVATAR, WEBCAM, etc.) into the global registry. |
Built-in Types
These are standard representation types that ship with the SDK:
- UserRepresentationType.NONE
- UserRepresentationType.AVATAR
- UserRepresentationType.WEBCAM
- UserRepresentationType.SPECTATOR
- UserRepresentationType.VOICE
- UserRepresentationType.HOLOCAPTURER_DEPTH
- UserRepresentationType.HOLOCAPTURER_PM
- UserRepresentationType.CAMERAMAN
Example
Creating and Registering a Custom Representation Type
using Holo.Core;
public static class MyCustomRepresentationBootstrap
{
public static readonly UserRepresentationType CUSTOM_HOLOGRAM =
UserRepresentationType.CreateAndRegister(
"CUSTOM_HOLOGRAM",
"Custom Hologram",
true);
}
You can later retrieve this type from anywhere:
var type = UserRepresentationType.Get("CUSTOM_HOLOGRAM");
// or
var typeFromDisplay = UserRepresentationType.GetByDisplayName("Custom Hologram");