动画
适用版本:中国版 3.10。仅中国版可用。
本文主要记录动画相关的接口,共 2 个。
网易官方文档PlayTpAnimation
客户端该接口只能在客户端脚本(mod.client.extraClientApi)中调用。 PlayerAnimCompClient
获取组件:clientApi.GetEngineCompFactory().CreatePlayerAnim(playerId)
第三人称视角播放玩家通用动作。
- 说明
- 示例
PlayTpAnimation(anim: str) -> bool
- anim: str,动作名称,如 sneaking。
返回值:bool,是否成功。
备注
- 支持的动作包括:sneaking、sneaking_inverted、swim、sleeping、holding_left、holding_right、crossbow_hold、crossbow_equipped、bow_equipped、upside_down、tp_attack。
import mod.client.extraClientApi as clientApi
comp = clientApi.GetEngineCompFactory().CreatePlayerAnim(playerId)
comp.PlayTpAnimation("sneaking")
StopAnimation
客户端该接口只能在客户端脚本(mod.client.extraClientApi)中调用。 PlayerAnimCompClient
获取组件:clientApi.GetEngineCompFactory().CreatePlayerAnim(playerId)
停止播放玩家通用动作。
- 说明
- 示例
StopAnimation(anim: str) -> bool
- anim: str,动作名称,如 sneaking。
返回值:bool,是否成功。
import mod.client.extraClientApi as clientApi
comp = clientApi.GetEngineCompFactory().CreatePlayerAnim(playerId)
comp.StopAnimation("sneaking")