mirror of
https://github.com/kirikayakazuto/CocosCreator_ECS
synced 2025-12-19 10:30:00 +00:00
feat: 修复了找不到comTrans的问题
This commit is contained in:
@@ -6,7 +6,7 @@ import { ComTransform } from "../components/ComTransform";
|
||||
import { ECSSystem } from "../lib/ECSSystem";
|
||||
import { ECSWorld, GenFillterKey } from "../lib/ECSWorld";
|
||||
|
||||
const FILTER_ATTACKABLE = GenFillterKey([ComAttackable]);
|
||||
const FILTER_ATTACKABLE = GenFillterKey([ComTransform, ComAttackable, ComRoleConfig]);
|
||||
const FILTER_BEATTACKED = GenFillterKey([ComBeAttacked]);
|
||||
export class SysAttack extends ECSSystem {
|
||||
/** 连接 */
|
||||
|
||||
@@ -54,8 +54,7 @@ export class SysCocosView extends ECSSystem implements ITouchProcessor {
|
||||
|
||||
let comRoleConfig = world.getComponent(entity, ComRoleConfig);
|
||||
this._loadView(world, entity, comNodeConfig).then((node: cc.Node) => {
|
||||
console.log('load view success');
|
||||
|
||||
console.log('load view success',comNodeConfig.prefabUrl);
|
||||
});
|
||||
return false;
|
||||
});
|
||||
@@ -75,6 +74,15 @@ export class SysCocosView extends ECSSystem implements ITouchProcessor {
|
||||
|
||||
return true;
|
||||
});
|
||||
let layer = cc.find('Canvas/Layers/0');
|
||||
let count1 = 0, count2 = 0;
|
||||
for(const node of layer.children) {
|
||||
node.zIndex = node.y * -1;
|
||||
if(node.name == 'Biker') count1++;
|
||||
if(node.name == 'Cyborg') count2++;
|
||||
}
|
||||
cc.find('Canvas/a_role_count').getComponent(cc.Label).string = '' + count1;
|
||||
cc.find('Canvas/b_role_count').getComponent(cc.Label).string = '' + count2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user