完善 colliderTriggerHelper 用于更新碰撞信息
This commit is contained in:
@@ -30,7 +30,7 @@ abstract class Component {
|
||||
}
|
||||
|
||||
public initialize(){
|
||||
|
||||
|
||||
}
|
||||
|
||||
public onAddedToEntity(){
|
||||
|
||||
@@ -212,8 +212,8 @@ class Entity {
|
||||
return this.components.getComponent(type, false) as T;
|
||||
}
|
||||
|
||||
public getComponents<T extends Component>(type): T[]{
|
||||
return this.components.getComponents<T>(type);
|
||||
public getComponents(typeName: string, componentList?){
|
||||
return this.components.getComponents(typeName, componentList);
|
||||
}
|
||||
|
||||
public removeComponentForType<T extends Component>(type){
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user