Newer
Older
DungeonShooting / DungeonShooting_Godot / src / test / TestActivity.cs
@小李xl 小李xl on 11 Oct 2023 791 bytes 日志系统
  1. using Godot;
  2.  
  3. public partial class TestActivity : ActivityObject
  4. {
  5. public override void OnInit()
  6. {
  7. EnableVerticalMotion = false;
  8. }
  9.  
  10. protected override void Process(float delta)
  11. {
  12. if (Input.IsActionJustPressed("fire"))
  13. {
  14. Altitude = 100;
  15. }
  16.  
  17. if (Input.IsActionJustPressed("interactive"))
  18. {
  19. EnableVerticalMotion = !EnableVerticalMotion;
  20. }
  21. }
  22.  
  23. protected override void OnFallToGround()
  24. {
  25. Debug.Log("OnFallToGround");
  26. }
  27.  
  28. protected override void OnFirstFallToGround()
  29. {
  30. Debug.Log("OnFirstFallToGround");
  31. }
  32.  
  33. protected override void OnThrowStart()
  34. {
  35. Debug.Log("OnThrowStart");
  36. }
  37.  
  38. protected override void OnThrowMaxHeight(float height)
  39. {
  40. Debug.Log("OnThrowMaxHeight: " + height);
  41. }
  42.  
  43. protected override void OnThrowOver()
  44. {
  45. Debug.Log("OnThrowOver");
  46. }
  47. }