public static Avatar BuildGenericAvatar (GameObject go, string rootMotionTransformName);

Parámetros

goRoot object of your transform hierarchy.
rootMotionTransformNameTransform name of the root motion transform. If empty no root motion is defined and you must take care of avatar movement yourself.

Descripción

Create a new generic avatar.

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

function Start() {
    var go: GameObject = Selection.activeGameObject;

if (go != null &amp;&amp; go.GetComponent.<Animator>() != null) { var avatar: Avatar = AvatarBuilder.BuildGenericAvatar(go, ""); avatar.name = "Bob"; Debug.Log(avatar.isHuman ? "is human" : "is generic");

var animator: Animator = go.GetComponent.<Animator>() as Animator; animator.avatar = avatar; } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961