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