Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / item / weapon / shell / ShellCase.cs
  1.  
  2. public class ShellCase : ActivityObject
  3. {
  4. public ShellCase() : base("res://prefab/weapon/shell/ShellCase.tscn")
  5. {
  6. Thickness = 1;
  7. }
  8.  
  9. public override void OnThrowOver()
  10. {
  11. AwaitDestroy();
  12. }
  13.  
  14. private async void AwaitDestroy()
  15. {
  16. //30秒后销毁
  17. await ToSignal(GetTree().CreateTimer(30), "timeout");
  18. QueueFree();
  19. }
  20. }