Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / role / Enemy.cs
@小李xl 小李xl on 7 Nov 2022 429 bytes 敌人锁定玩家并自动开火
  1.  
  2. public class Enemy : Role
  3. {
  4. public Enemy() : base(ResourcePath.prefab_role_Enemy_tscn)
  5. {
  6. AttackLayer = PhysicsLayer.Wall | PhysicsLayer.Props | PhysicsLayer.Player;
  7. Camp = CampEnum.Camp2;
  8. }
  9.  
  10. public override void _Process(float delta)
  11. {
  12. base._Process(delta);
  13. if (Holster.ActiveWeapon != null)
  14. {
  15. Holster.ActiveWeapon.Trigger();
  16. }
  17. }
  18. }