Component管理

本节内容将介绍如何获取Component, 添加Component等.


0.0.1. 获取Component

获取根组件:

pComponent = pActor:GetRootComponent();

通过索引获取Component:

---获取可用的组件索引
local nValidIndex = pActor:GetComponentValidIndex()
---通过索引获取组件
pComponent = pActor:GetComponentOfIndex(Index);

0.0.2. 添加Component

添加Component:

pAddComponent = pActor:AddActorComponent(szComponentTypeName);

0.0.3. 设置Component

设置根组件:

pActor:SetRootComponent(pComponent)
@Copyright © cosmos 2019 all right reserved,powered by Gitbook修订时间: 2021-04-12 18:28:14

results matching ""

    No results matching ""