main.gd 668 B

123456789101112131415161718192021222324252627
  1. extends Node3D
  2. # Note, the code here just adds some control to our effects.
  3. # Check res://water_plane/water_plane.gd for the real implementation.
  4. var y = 0.0
  5. @onready var water_plane = $WaterPlane
  6. func _ready():
  7. $Container/RainSize/HSlider.value = $WaterPlane.rain_size
  8. $Container/MouseSize/HSlider.value = $WaterPlane.mouse_size
  9. # Called every frame. 'delta' is the elapsed time since the previous frame.
  10. func _process(delta):
  11. if $Container/Rotate.button_pressed:
  12. y += delta
  13. water_plane.basis = Basis(Vector3.UP, y)
  14. func _on_rain_size_changed(value):
  15. $WaterPlane.rain_size = value
  16. func _on_mouse_size_changed(value):
  17. $WaterPlane.mouse_size = value