Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / activity / shell / Shell.cs
  1.  
  2. using Godot;
  3.  
  4. /// <summary>
  5. /// 弹壳类
  6. /// </summary>
  7. [Tool, GlobalClass]
  8. public partial class Shell : ActivityObject
  9. {
  10. public override void OnInit()
  11. {
  12. ShadowOffset = new Vector2(0, 1);
  13. ThrowCollisionSize = new Vector2(5, 5);
  14. }
  15.  
  16. protected override void Process(float delta)
  17. {
  18. //落地后将弹壳变为静态贴图
  19. if (!IsThrowing)
  20. {
  21. if (AffiliationArea != null)
  22. {
  23. BecomesStaticImage();
  24. }
  25. else
  26. {
  27. GD.Print("弹壳投抛到画布外了, 强制消除...");
  28. Destroy();
  29. }
  30. }
  31. }
  32. }