Newer
Older
DungeonShooting / DungeonShooting_Godot / src / test / TestActivity.cs
  1. using Godot;
  2.  
  3. [RegisterActivity(ActivityIdPrefix.Test + "0001", ResourcePath.prefab_test_TestActivity_tscn)]
  4. public partial class TestActivity : ActivityObject
  5. {
  6. public override void OnInit()
  7. {
  8. EnableVerticalMotion = false;
  9. }
  10.  
  11. protected override void Process(float delta)
  12. {
  13. if (Input.IsActionJustPressed("fire"))
  14. {
  15. Altitude = 100;
  16. }
  17.  
  18. if (Input.IsActionJustPressed("interactive"))
  19. {
  20. EnableVerticalMotion = !EnableVerticalMotion;
  21. }
  22. }
  23.  
  24. protected override void OnFallToGround()
  25. {
  26. GD.Print("OnFallToGround");
  27. }
  28.  
  29. protected override void OnFirstFallToGround()
  30. {
  31. GD.Print("OnFirstFallToGround");
  32. }
  33.  
  34. protected override void OnThrowStart()
  35. {
  36. GD.Print("OnThrowStart");
  37. }
  38.  
  39. protected override void OnThrowMaxHeight(float height)
  40. {
  41. GD.Print("OnThrowMaxHeight: " + height);
  42. }
  43.  
  44. protected override void OnThrowOver()
  45. {
  46. GD.Print("OnThrowOver");
  47. }
  48. }