跳到主要内容

动画

适用版本:中国版 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。

StopAnimation​

客户端

该接口只能在客户端脚本(mod.client.extraClientApi)中调用。
PlayerAnimCompClient

获取组件:clientApi.GetEngineCompFactory().CreatePlayerAnim(playerId)

停止播放玩家通用动作。

StopAnimation(anim: str) -> bool
  • anim: str,动作名称,如 sneaking。

返回值:bool,是否成功。