spinpause.tscn 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. [gd_scene load_steps=6 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. [node name="PauseScene" type="Node3D"]
  26. [node name="Cube" type="MeshInstance3D" parent="."]
  27. mesh = SubResource("1")
  28. [node name="Camera3D" type="Camera3D" parent="."]
  29. transform = Transform3D(0.707107, -0.241845, 0.664463, 0, 0.939693, 0.34202, -0.707107, -0.241845, 0.664463, 2, 1, 2)
  30. fov = 74.0
  31. near = 0.1
  32. [node name="AnimationPlayer" type="AnimationPlayer" parent="."]
  33. autoplay = "spin"
  34. libraries = {
  35. "": SubResource("AnimationLibrary_5vmwp")
  36. }
  37. [node name="SpotLight3D" type="SpotLight3D" parent="."]
  38. transform = Transform3D(0.707107, -0.353554, 0.612373, 0, 0.866026, 0.5, -0.707107, -0.353554, 0.612373, 2, 2, 2)
  39. spot_range = 6.0
  40. [node name="PauseButton" type="Button" parent="."]
  41. process_mode = 3
  42. anchors_preset = 8
  43. anchor_left = 0.5
  44. anchor_top = 0.5
  45. anchor_right = 0.5
  46. anchor_bottom = 0.5
  47. offset_left = -125.0
  48. offset_top = 150.0
  49. offset_right = 125.0
  50. offset_bottom = 200.0
  51. grow_horizontal = 2
  52. grow_vertical = 2
  53. toggle_mode = true
  54. text = "Pause"
  55. script = ExtResource("1")
  56. [node name="ProcessMode" type="HBoxContainer" parent="."]
  57. anchors_preset = 8
  58. anchor_left = 0.5
  59. anchor_top = 0.5
  60. anchor_right = 0.5
  61. anchor_bottom = 0.5
  62. offset_left = -185.502
  63. offset_top = -250.0
  64. offset_right = 185.503
  65. offset_bottom = -210.0
  66. grow_horizontal = 2
  67. grow_vertical = 2
  68. theme_override_constants/separation = 12
  69. [node name="Label" type="Label" parent="ProcessMode"]
  70. layout_mode = 2
  71. offset_top = 7.0
  72. offset_right = 151.0
  73. offset_bottom = 33.0
  74. text = "Cube Process Mode"
  75. [node name="OptionButton" type="OptionButton" parent="ProcessMode"]
  76. layout_mode = 2
  77. offset_left = 163.0
  78. offset_right = 334.0
  79. offset_bottom = 40.0
  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"]