ドキュメント

Unity Engine

Unity Engine

BuildGenericAvatar(GameObject, string)

Create a new generic avatar.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.AnimationModule
public static Avatar BuildGenericAvatar(GameObject go, string rootMotionTransformName)

Parameters

Root object of your transform hierarchy.

rootMotionTransformName

Transform name of the root motion transform. If empty no root motion is defined and you must take care of avatar movement yourself.

Returns

Type

Description

Avatar

Remarks

All transforms under the root game object will be part of this generic avatar.

Examples

using UnityEngine;// This example automatically builds a generic avatar// for the GameObject it is attached to and assigns it// to the Animator.[RequireComponent(typeof(Animator))]public class GenericAvatarBuilderExample : MonoBehaviour{ void Start() { var animator = GetComponent<Animator>(); var avatar = AvatarBuilder.BuildGenericAvatar(gameObject, ""); avatar.name = "RuntimeAvatar"; animator.avatar = avatar; }}