73 lines
1.5 KiB
Markdown
73 lines
1.5 KiB
Markdown
---
|
||
sidebarDepth: 1
|
||
---
|
||
# 动画
|
||
|
||
## PlayTpAnimation
|
||
|
||
<span style="display:inline;color:#7575f9">客户端</span>
|
||
|
||
method in mod.client.component.playerAnimCompClient.PlayerAnimCompClient
|
||
|
||
- 描述
|
||
|
||
第三人称视角播放玩家通用动作
|
||
|
||
- 参数
|
||
|
||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||
| :--- | :--- | :--- |
|
||
| anim | str | 动作名称,如sneaking |
|
||
|
||
- 返回值
|
||
|
||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||
| :--- | :--- |
|
||
| bool | 是否成功 |
|
||
|
||
- 备注
|
||
- 支持的动作包括:sneaking、sneaking_inverted、swim、sleeping、holding_left、holding_right、crossbow_hold、crossbow_equipped、bow_equipped、upside_down、tp_attack
|
||
|
||
- 示例
|
||
|
||
```python
|
||
import mod.client.extraClientApi as clientApi
|
||
comp = clientApi.GetEngineCompFactory().CreatePlayerAnim(playerId)
|
||
comp.PlayTpAnimation("sneaking")
|
||
```
|
||
|
||
|
||
|
||
## StopAnimation
|
||
|
||
<span style="display:inline;color:#7575f9">客户端</span>
|
||
|
||
method in mod.client.component.playerAnimCompClient.PlayerAnimCompClient
|
||
|
||
- 描述
|
||
|
||
停止播放玩家通用动作
|
||
|
||
- 参数
|
||
|
||
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
|
||
| :--- | :--- | :--- |
|
||
| anim | str | 动作名称,如sneaking |
|
||
|
||
- 返回值
|
||
|
||
| <div style="width: 4em">数据类型</div> | 说明 |
|
||
| :--- | :--- |
|
||
| bool | 是否成功 |
|
||
|
||
- 示例
|
||
|
||
```python
|
||
import mod.client.extraClientApi as clientApi
|
||
comp = clientApi.GetEngineCompFactory().CreatePlayerAnim(playerId)
|
||
comp.StopAnimation("sneaking")
|
||
```
|
||
|
||
|
||
|