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. AnimationPlayer.Play("Flicker");
  18. }
  19.  
  20. private async void AwaitDestroy()
  21. {
  22. //2秒后销毁
  23. await ToSignal(GetTree().CreateTimer(2), "timeout");
  24. Destroy();
  25. }
  26. }