spinpause.tscn 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. [gd_scene load_steps=8 format=3 uid="uid://cwa8rglnrg4yb"]
  2. [ext_resource type="Script" path="res://pause_button.gd" id="1"]
  3. [ext_resource type="Script" path="res://process_mode.gd" id="2_0dpmq"]
  4. [sub_resource type="BoxMesh" id="1"]
  5. size = Vector3(1.5, 1.5, 1.5)
  6. [sub_resource type="Animation" id="2"]
  7. length = 10.0
  8. loop_mode = 1
  9. tracks/0/type = "value"
  10. tracks/0/imported = false
  11. tracks/0/enabled = true
  12. tracks/0/path = NodePath("Cube:rotation")
  13. tracks/0/interp = 1
  14. tracks/0/loop_wrap = true
  15. tracks/0/keys = {
  16. "times": PackedFloat32Array(0, 10),
  17. "transitions": PackedFloat32Array(1, 1),
  18. "update": 0,
  19. "values": [Vector3(0, 0, 0), Vector3(0, -6.28319, 0)]
  20. }
  21. [sub_resource type="AnimationLibrary" id="AnimationLibrary_5vmwp"]
  22. _data = {
  23. "spin": SubResource("2")
  24. }
  25. [sub_resource type="InputEventAction" id="InputEventAction_6y126"]
  26. action = &"toggle_pause"
  27. [sub_resource type="Shortcut" id="Shortcut_mmc83"]
  28. events = [SubResource("InputEventAction_6y126")]
  29. [node name="PauseScene" type="Node3D"]
  30. [node name="Cube" type="MeshInstance3D" parent="."]
  31. mesh = SubResource("1")
  32. [node name="Camera3D" type="Camera3D" parent="."]
  33. transform = Transform3D(0.707107, -0.241845, 0.664463, 0, 0.939693, 0.34202, -0.707107, -0.241845, 0.664463, 2, 1, 2)
  34. fov = 74.0
  35. near = 0.1
  36. [node name="AnimationPlayer" type="AnimationPlayer" parent="."]
  37. libraries = {
  38. "": SubResource("AnimationLibrary_5vmwp")
  39. }
  40. autoplay = "spin"
  41. [node name="SpotLight3D" type="SpotLight3D" parent="."]
  42. transform = Transform3D(0.707107, -0.353554, 0.612373, 0, 0.866026, 0.5, -0.707107, -0.353554, 0.612373, 2, 2, 2)
  43. spot_range = 6.0
  44. [node name="PauseButton" type="Button" parent="."]
  45. process_mode = 3
  46. anchors_preset = 8
  47. anchor_left = 0.5
  48. anchor_top = 0.5
  49. anchor_right = 0.5
  50. anchor_bottom = 0.5
  51. offset_left = -125.0
  52. offset_top = 150.0
  53. offset_right = 125.0
  54. offset_bottom = 200.0
  55. grow_horizontal = 2
  56. grow_vertical = 2
  57. toggle_mode = true
  58. shortcut = SubResource("Shortcut_mmc83")
  59. text = "Pause"
  60. script = ExtResource("1")
  61. [node name="ProcessMode" type="HBoxContainer" parent="."]
  62. anchors_preset = 8
  63. anchor_left = 0.5
  64. anchor_top = 0.5
  65. anchor_right = 0.5
  66. anchor_bottom = 0.5
  67. offset_left = -185.502
  68. offset_top = -250.0
  69. offset_right = 185.503
  70. offset_bottom = -210.0
  71. grow_horizontal = 2
  72. grow_vertical = 2
  73. theme_override_constants/separation = 12
  74. [node name="Label" type="Label" parent="ProcessMode"]
  75. layout_mode = 2
  76. text = "Cube Process Mode"
  77. [node name="OptionButton" type="OptionButton" parent="ProcessMode"]
  78. process_mode = 3
  79. layout_mode = 2
  80. item_count = 5
  81. selected = 0
  82. popup/item_0/text = "Inherit"
  83. popup/item_0/id = 0
  84. popup/item_1/text = "Pausable"
  85. popup/item_1/id = 1
  86. popup/item_2/text = "When Paused"
  87. popup/item_2/id = 2
  88. popup/item_3/text = "Always"
  89. popup/item_3/id = 3
  90. popup/item_4/text = "Disabled (Never)"
  91. popup/item_4/id = 4
  92. script = ExtResource("2_0dpmq")
  93. [connection signal="item_selected" from="ProcessMode/OptionButton" to="ProcessMode/OptionButton" method="_on_option_button_item_selected"]