---
sidebarDepth: 1
---
# 模型特效
## CreateEngineEffectBind
客户端
method in mod.client.system.clientSystem.ClientSystem
- 描述
指用编辑器保存资源包中models/bind/xxx_bind.json生成编辑好的所有挂点的所有特效。生成的特效会自动进行挂接及播放,编辑器中设为不可见的特效也会进行播放。并且使用这种方式创建的特效,开发者不用维护entity进出视野导致的挂接特效被移除,引擎会在entity每次进入视野时自动创建所有特效。
- 参数
| 参数名 |
数据类型
| 说明 |
| :--- | :--- | :--- |
| path | str | 特效配置路径,需要包含json后缀名 |
| bindEntity | str | 绑定实体的Id |
| aniName | str | 选择使用哪个模型动作的特效 |
- 返回值
| 数据类型
| 说明 |
| :--- | :--- |
| 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
客户端
method in mod.client.component.engineEffectBindControlComp.EngineEffectBindControlComp
- 描述
暂停模型特效(即使用CreateEngineEffectBind创建的特效)
- 参数
无
- 返回值
| 数据类型
| 说明 |
| :--- | :--- |
| bool | True表示设置成功 |
- 示例
```python
import mod.client.extraClientApi as clientApi
comp = clientApi.GetEngineCompFactory().CreateEngineEffectBindControl(effectEntityId)
comp.Pause()
```
## Resume
客户端
method in mod.client.component.engineEffectBindControlComp.EngineEffectBindControlComp
- 描述
继续播放模型特效(即使用CreateEngineEffectBind创建的特效)
- 参数
无
- 返回值
| 数据类型
| 说明 |
| :--- | :--- |
| bool | True表示设置成功 |
- 示例
```python
import mod.client.extraClientApi as clientApi
comp = clientApi.GetEngineCompFactory().CreateEngineEffectBindControl(effectEntityId)
comp.Resume()
```