Table of Contents

Interface INDMFPlatformProvider

Namespace
nadena.dev.ndmf.platform
public interface INDMFPlatformProvider

Properties

AvatarRootComponentType

The component type which marks the root of the avatar. If unset, we will use NDMFAvatarRoot instead.

This is used to identify the "primary" platform for the avatar, in addition to identifying the avatar root itself.

Type? AvatarRootComponentType { get; }

Property Value

Type

DisplayName

The display name of this platform. This is used in the UI to identify the platform.

string DisplayName { get; }

Property Value

string

HasNativeConfigData

If true, this platform has some kind of avatar-wide native configuration components. Currently, this controls whether NDMFAvatarRoot's inspector offers to convert configuration to/from this platform.

bool HasNativeConfigData { get; }

Property Value

bool

HasNativeUI

Indicates there is some kind of native UI window (eg the VRCSDK build window) that can be opened.

bool HasNativeUI { get; }

Property Value

bool

Icon

An optional icon to display in the UI for this platform.

Texture2D? Icon { get; }

Property Value

Texture2D?

QualifiedName

The internal fully qualified name of this platform. This is used when declaring platform compatibility. See WellKnownPlatforms for a list of well-known platform qualified names.

string QualifiedName { get; }

Property Value

string

Methods

CanInitFromCommonAvatarInfo(GameObject, CommonAvatarInfo)

Return true if we can initialize this platform's native config from the provided common config structure.

bool CanInitFromCommonAvatarInfo(GameObject avatarRoot, CommonAvatarInfo info)

Parameters

avatarRoot GameObject
info CommonAvatarInfo

Returns

bool

CreateBuildUI()

Creates a UI Elements element to use as the build control UI to be shown in the NDMF console when this platform is selected.

BuildUIElement? CreateBuildUI()

Returns

BuildUIElement

ExtractCommonAvatarInfo(GameObject)

Extracts information from platform-specific components on the avatar, and presents it as a CommonAvatarInfo object. The platform may choose only to supply a subset of the information in the CAI structure.

CommonAvatarInfo ExtractCommonAvatarInfo(GameObject avatarRoot)

Parameters

avatarRoot GameObject

Returns

CommonAvatarInfo

GeneratePortableComponents(GameObject, bool)

When this platform is not the selected platform, but is the "primary" platform for an avatar, create portable NDMF components to represent platform-specific dynamics (e.g. dynamic bones).

This function may be invoked either at build time, or in response to user action. If the latter, registerUndo will be true, and any actions performed should be registered in the Unity undo system.

void GeneratePortableComponents(GameObject avatarRoot, bool registerUndo)

Parameters

avatarRoot GameObject
registerUndo bool

InitBuildFromCommonAvatarInfo(BuildContext, CommonAvatarInfo)

This method is invoked early in the build process (between FirstChance and PlatformInit), and is provided with a CommonAvatarInfo structure with any configuration extracted from portable components, or components from the primary platform for the avatar.

void InitBuildFromCommonAvatarInfo(BuildContext context, CommonAvatarInfo info)

Parameters

context BuildContext
info CommonAvatarInfo

InitFromCommonAvatarInfo(GameObject, CommonAvatarInfo)

Destructively initialize or overwrite this platform's native config from this common config structure. The caller will take care of undo and prefab override management, if necessary.

void InitFromCommonAvatarInfo(GameObject avatarRoot, CommonAvatarInfo info)

Parameters

avatarRoot GameObject
info CommonAvatarInfo

OpenNativeUI()

Opens the platform native UI window.

void OpenNativeUI()