mirror of
				https://github.com/kirikayakazuto/CocosCreator_ECS
				synced 2025-10-31 19:35:55 +00:00 
			
		
		
		
	feat: upadte readme
Change-Id: I995be2b19fec8107ba5df6a04fb1f0e7b3fcae7f
This commit is contained in:
		| @@ -35,11 +35,14 @@ export class SysAttack extends ECSSystem { | ||||
|     public onUpdate(world: ECSWorld, dt: number): void { | ||||
|         let filter = world.getFilter(FILTER_ATTACKABLE); | ||||
|         filter.walk((entity: number) => { | ||||
|              | ||||
|             let comTransSelf = world.getComponent(entity, ComTransform); | ||||
|             let comAttackable = world.getComponent(entity, ComAttackable); | ||||
|             let comRoleConfigSelf = world.getComponent(entity, ComRoleConfig); | ||||
|             if(!comAttackable.dirty) return ; | ||||
|  | ||||
|             comAttackable.debugInfo = null; | ||||
|  | ||||
|             comAttackable.countDown -= dt; | ||||
|             if(comAttackable.countDown <= 0) { | ||||
|                 comAttackable.dirty = false; | ||||
| @@ -67,10 +70,7 @@ export class SysAttack extends ECSSystem { | ||||
|                 return true | ||||
|             } | ||||
|  | ||||
|             comAttackable.debugInfo = { | ||||
|                 points: [cc.v2(minX, minY), cc.v2(maxX, minY), cc.v2(maxX, maxY), cc.v2(minX, maxY)], | ||||
|                 color: cc.Color.RED, | ||||
|             }; | ||||
|              | ||||
|  | ||||
|             // 即将攻击未完成, 并且处于即将攻击时间段 | ||||
|             if(!comAttackable.willHurtFrameCompleted && comAttackable.countDown <= comAttackable.willHurtFrame) { | ||||
| @@ -84,6 +84,11 @@ export class SysAttack extends ECSSystem { | ||||
|                     return false; | ||||
|                 }) | ||||
|             } | ||||
|              | ||||
|             comAttackable.debugInfo = { | ||||
|                 points: [cc.v2(minX, minY), cc.v2(maxX, minY), cc.v2(maxX, maxY), cc.v2(minX, maxY)], | ||||
|                 color: cc.Color.RED, | ||||
|             }; | ||||
|  | ||||
|             if(!comAttackable.hurtFrameCompleted && comAttackable.countDown <= comAttackable.hurtFrame) { | ||||
|                 comAttackable.hurtFrameCompleted = true; | ||||
|   | ||||
| @@ -47,8 +47,6 @@ export class SysRoleState extends ECSSystem { | ||||
|                 comCocosNode.events.push(new EventGraphicsDraw(comAttackable.debugInfo.points, comAttackable.debugInfo.color)); | ||||
|             } | ||||
|  | ||||
|  | ||||
|  | ||||
|             if(comMovable && comMovable.speedDirty) { | ||||
|                 comMovable.speedDirty = false; | ||||
|                 if(comMovable.speed > 0) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user