Files
2025-03-18 14:46:12 +08:00

110 lines
2.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
sidebarDepth: 1
---
# 模型特效
## CreateEngineEffectBind
<span style="display:inline;color:#7575f9">客户端</span>
method in mod.client.system.clientSystem.ClientSystem
- 描述
指用编辑器保存资源包中models/bind/xxx_bind.json生成编辑好的所有挂点的所有特效。生成的特效会自动进行挂接及播放编辑器中设为不可见的特效也会进行播放。并且使用这种方式创建的特效开发者不用维护entity进出视野导致的挂接特效被移除引擎会在entity每次进入视野时自动创建所有特效。
- 参数
| 参数名 | <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- | :--- |
| path | str | 特效配置路径需要包含json后缀名 |
| bindEntity | str | 绑定实体的Id |
| aniName | str | 选择使用哪个模型动作的特效 |
- 返回值
| <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- |
| int或None | effectEntityId或者None |
- 备注
- 创建特效前需要将entity的骨骼模型替换为编辑器中的一致或者其他骨骼相同的模型否则将挂接失败替换模型见服务端和客户端的model组件的SetModel接口。
- 示例
```python
import mod.client.extraClientApi as clientApi
class MyClientSystem(ClientSystem):
# 创建
def createEffect(self):
# 绑定在本地玩家身上的模型特效
effectEntityId = self.CreateEngineEffectBind("models/bind/xuenv_bind.json", clientApi.GetLocalPlayerId(), 'idle')
# 删除
def removeEffect(self, effectEntityId):
self.DestroyEntity(effectEntityId)
```
## Pause
<span style="display:inline;color:#7575f9">客户端</span>
method in mod.client.component.engineEffectBindControlComp.EngineEffectBindControlComp
- 描述
暂停模型特效即使用CreateEngineEffectBind创建的特效
- 参数
- 返回值
| <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- |
| bool | True表示设置成功 |
- 示例
```python
import mod.client.extraClientApi as clientApi
comp = clientApi.GetEngineCompFactory().CreateEngineEffectBindControl(effectEntityId)
comp.Pause()
```
## Resume
<span style="display:inline;color:#7575f9">客户端</span>
method in mod.client.component.engineEffectBindControlComp.EngineEffectBindControlComp
- 描述
继续播放模型特效即使用CreateEngineEffectBind创建的特效
- 参数
- 返回值
| <div style="width: 4em">数据类型</div> | 说明 |
| :--- | :--- |
| bool | True表示设置成功 |
- 示例
```python
import mod.client.extraClientApi as clientApi
comp = clientApi.GetEngineCompFactory().CreateEngineEffectBindControl(effectEntityId)
comp.Resume()
```