Table of Contents

Interface IAvatar

Avatar控制介面

public interface IAvatar

Methods

AddAttachment(string, HumanBodyBones, Vector3, Quaternion, Vector3)

掛載配件

bool AddAttachment(string goName, HumanBodyBones boneToAttach, Vector3 position, Quaternion rotation, Vector3 scale)

Parameters

goName string

配件GameObject名稱

boneToAttach HumanBodyBones

掛載到的骨頭

position Vector3

配件的local position

rotation Quaternion

配件的local rotation

scale Vector3

配件的local scale

Returns

bool

PlayAnimationClip(string, bool, bool, float)

播放自定義動畫

void PlayAnimationClip(string clipName, bool loop = false, bool reset = true, float transitionTime = 0.25)

Parameters

clipName string

動畫名稱

loop bool

重複播放與否,必須和Animation Clip中Loop Time屬性一致方能正常運作。

reset bool

播放完成是否回到預設狀態動畫,必須搭配loop為false才有作用。

transitionTime float

和現有動畫的移轉插補時間

RemoveAttachment(string, HumanBodyBones)

卸除配件

bool RemoveAttachment(string goName, HumanBodyBones boneToDetach)

Parameters

goName string

配件GameObject名稱

boneToDetach HumanBodyBones

Returns

bool

ReplaceAvatar(string, Gender)

置換Avatar模型

bool ReplaceAvatar(string goName, Gender gender)

Parameters

goName string

Avatar GameObject名稱

gender Gender

性別

Returns

bool

ResetAvatar()

恢復預設Avatar模型

void ResetAvatar()

StopAnimationClip()

停止自定義動畫

void StopAnimationClip()