Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / activity / shell / Shell.cs
@小李xl 小李xl on 3 Nov 2023 842 bytes 优化可互动物体
  1.  
  2. using Godot;
  3.  
  4. /// <summary>
  5. /// 弹壳类
  6. /// </summary>
  7. [Tool]
  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. protected override void OnThrowOver()
  16. {
  17. if (AffiliationArea != null)
  18. {
  19. Freeze();
  20. }
  21. }
  22.  
  23. // protected override void Process(float delta)
  24. // {
  25. // //落地后将弹壳变为静态贴图
  26. // if (!IsThrowing)
  27. // {
  28. // if (AffiliationArea != null)
  29. // {
  30. // BecomesStaticImage();
  31. // }
  32. // else
  33. // {
  34. // Debug.Log("弹壳投抛到画布外了, 强制消除...");
  35. // Destroy();
  36. // }
  37. // }
  38. // }
  39. }