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
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
ReplaceAvatar(string, Gender)
置換Avatar模型
bool ReplaceAvatar(string goName, Gender gender)
Parameters
Returns
ResetAvatar()
恢復預設Avatar模型
void ResetAvatar()
StopAnimationClip()
停止自定義動畫
void StopAnimationClip()