Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / effects / enemy / EnemyBlood0002.cs
@小李xl 小李xl on 11 Apr 2024 546 bytes 更新敌人效果
  1. using Godot;
  2. using System;
  3.  
  4. public partial class EnemyBlood0002 : Sprite2D
  5. {
  6. private RoomInfo _roomInfo;
  7. public void InitRoom(RoomInfo roomInfo)
  8. {
  9. _roomInfo = roomInfo;
  10. }
  11.  
  12. private void DoDestory()
  13. {
  14. var position = _roomInfo.ToCanvasPosition(GlobalPosition);
  15. _roomInfo.StaticImageCanvas.DrawImageInCanvas(Texture, Modulate, null, position.X, position.Y, RotationDegrees,
  16. (int)-Offset.X, (int)-Offset.Y, false, () =>
  17. {
  18. QueueFree();
  19. });
  20. }
  21. }