Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / item / weapon / shell / ShellCase.cs
  1.  
  2. using Godot;
  3.  
  4. /// <summary>
  5. /// 弹壳类
  6. /// </summary>
  7. public class ShellCase : ActivityObject
  8. {
  9. public ShellCase() : base(ResourcePath.prefab_weapon_shell_ShellCase_tscn)
  10. {
  11. ShadowOffset = new Vector2(0, 1);
  12. }
  13.  
  14. protected override void OnThrowOver()
  15. {
  16. AwaitDestroy();
  17. }
  18.  
  19. private async void AwaitDestroy()
  20. {
  21. //30秒后销毁
  22. await ToSignal(GetTree().CreateTimer(30), "timeout");
  23. Destroy();
  24. }
  25. }