diff --git a/assets/Script/ECS/lib/ECSFillter.ts b/assets/Script/ECS/lib/ECSFilter.ts similarity index 90% rename from assets/Script/ECS/lib/ECSFillter.ts rename to assets/Script/ECS/lib/ECSFilter.ts index 4426f67..6be870d 100755 --- a/assets/Script/ECS/lib/ECSFillter.ts +++ b/assets/Script/ECS/lib/ECSFilter.ts @@ -1,7 +1,7 @@ import { ComType, EntityIndex } from "./Const"; import { ECSWorld } from "./ECSWorld"; -export class ECSFillter { +export class ECSFilter { private _world: ECSWorld = null; private _entitiesMap = new Map(); @@ -21,7 +21,7 @@ export class ECSFillter { public onEntityEnter(entity: EntityIndex) { if(this._entitiesMap.has(entity)) { - console.warn(`[ECSFillter]: addEntity entity is had ${entity}`); + console.warn(`[ECSFilter]: addEntity entity is had ${entity}`); return true; } this._entitiesMap.set(entity, true); @@ -30,7 +30,7 @@ export class ECSFillter { public onEntityLeave(entity: EntityIndex) { if(!this._entitiesMap.has(entity)) { - console.warn(`[ECSFillter]: removeEntity entity not had ${entity}`); + console.warn(`[ECSFilter]: removeEntity entity not had ${entity}`); return true; } this._entitiesMap.delete(entity); diff --git a/assets/Script/ECS/lib/ECSFillter.ts.meta b/assets/Script/ECS/lib/ECSFilter.ts.meta old mode 100755 new mode 100644 similarity index 77% rename from assets/Script/ECS/lib/ECSFillter.ts.meta rename to assets/Script/ECS/lib/ECSFilter.ts.meta index 5875a47..f24957d --- a/assets/Script/ECS/lib/ECSFillter.ts.meta +++ b/assets/Script/ECS/lib/ECSFilter.ts.meta @@ -1,6 +1,6 @@ { "ver": "1.1.0", - "uuid": "a2265ecd-3751-461b-9d2f-755ccc56c3da", + "uuid": "9d20cc25-61b9-4be8-9e89-47bdcac35a5b", "importer": "typescript", "isPlugin": false, "loadPluginInWeb": true, diff --git a/assets/Script/ECS/lib/ECSWorld.ts b/assets/Script/ECS/lib/ECSWorld.ts index 2e19f32..6abf904 100755 --- a/assets/Script/ECS/lib/ECSWorld.ts +++ b/assets/Script/ECS/lib/ECSWorld.ts @@ -1,4 +1,4 @@ -import { ECSFillter } from "./ECSFillter" +import { ECSFilter } from "./ECSFilter" import { ECSComConstructor, GetComConstructor as GetComConstructor, GetComConstructorType } from "./ECSComponent"; import { ECSSystem } from "./ECSSystem"; import { ComPoolIndex, ComType, EntityIndex } from "./Const"; @@ -12,7 +12,7 @@ export class ECSWorld { private _reservedIds: number[] = []; // 缓存 private _entityToComponents: number[][] = []; private _componentPools: ECSComponentPool[] = []; - private _fillters = new Map(); + private _fillters = new Map(); private _entitiesToDelete: Set = new Set(); /** 获取ComponentPool */ @@ -148,14 +148,15 @@ export class ECSWorld { }); } - public getFilter(fillterKey: string): ECSFillter { + + public getFilter(fillterKey: string): ECSFilter { if(this._fillters.has(fillterKey)) { return this._fillters.get(fillterKey); } let [acceptStr, rejectStr] = fillterKey.split("-"); let accept = acceptStr && acceptStr.length > 0 ? acceptStr.split(',').map(Number) : null; let reject = rejectStr && rejectStr.length > 0 ? rejectStr.split(',').map(Number) : null; - let fillter = new ECSFillter(this, accept, reject); + let fillter = new ECSFilter(this, accept, reject); this._fillters.set(fillterKey, fillter); // 将当期的entity放入fillter for(let i=1; i