完善 colliderTriggerHelper 用于更新碰撞信息

This commit is contained in:
YHH
2020-06-16 09:10:09 +08:00
parent dba43b9773
commit 75301f7776
13 changed files with 471 additions and 41 deletions

View File

@@ -120,18 +120,20 @@ class ComponentList {
return null;
}
public getComponents<T extends Component>(type): T[]{
let components = [];
public getComponents(typeName: string, components?){
if (!components)
components = [];
for (let i = 0; i < this._components.length; i ++){
let component = this._components[i];
if (component instanceof type)
components.push(components);
if (egret.is(component, typeName))
components.push(component);
}
for (let i = 0; i < this._componentsToAdd.length; i ++){
let component = this._componentsToAdd[i];
if (component instanceof type)
components.push(components);
if (egret.is(component, typeName))
components.push(component);
}
return components;