wip: new action prompt and Interactable
This commit is contained in:
parent
d44336241c
commit
d5e23b80a0
|
|
@ -181,8 +181,8 @@ func is_out_of_bounds(card: Card, rect: Rect2):
|
||||||
return true
|
return true
|
||||||
return false
|
return false
|
||||||
|
|
||||||
func get_cards_by_scene_id(id: int) -> Array:
|
func get_cards_by_scene_id(id: int) -> Array[Card]:
|
||||||
var output:Array
|
var output:Array[Card]
|
||||||
|
|
||||||
for card_name in source_dicts[id].keys():
|
for card_name in source_dicts[id].keys():
|
||||||
var card := card_prefab.instantiate() as Card
|
var card := card_prefab.instantiate() as Card
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,42 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="font_data_dynamic"
|
||||||
|
type="FontFile"
|
||||||
|
uid="uid://qalmecrbkxyp"
|
||||||
|
path="res://.godot/imported/icon.ttf-471e3d4049bc0d87ff29f9da68806481.fontdata"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://import/fonts/icon.ttf"
|
||||||
|
dest_files=["res://.godot/imported/icon.ttf-471e3d4049bc0d87ff29f9da68806481.fontdata"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
Rendering=null
|
||||||
|
antialiasing=1
|
||||||
|
generate_mipmaps=false
|
||||||
|
disable_embedded_bitmaps=true
|
||||||
|
multichannel_signed_distance_field=true
|
||||||
|
msdf_pixel_range=8
|
||||||
|
msdf_size=48
|
||||||
|
allow_system_fallback=true
|
||||||
|
force_autohinter=false
|
||||||
|
modulate_color_glyphs=false
|
||||||
|
hinting=1
|
||||||
|
subpixel_positioning=4
|
||||||
|
keep_rounding_remainders=true
|
||||||
|
oversampling=0.0
|
||||||
|
Fallbacks=null
|
||||||
|
fallbacks=[]
|
||||||
|
Compress=null
|
||||||
|
compress=true
|
||||||
|
preload=[{
|
||||||
|
"chars": [],
|
||||||
|
"glyphs": [],
|
||||||
|
"name": "New Configuration",
|
||||||
|
"size": Vector2i(16, 0),
|
||||||
|
&"variation_embolden": 0.0
|
||||||
|
}]
|
||||||
|
language_support={}
|
||||||
|
script_support={}
|
||||||
|
opentype_features={}
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -3,19 +3,21 @@
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://bxpunr1whf5o1"
|
uid="uid://bxpunr1whf5o1"
|
||||||
path="res://.godot/imported/top_corner.png-2131e6fb02a65e1fd9265d84564f46b9.ctex"
|
path.s3tc="res://.godot/imported/top_corner.png-2131e6fb02a65e1fd9265d84564f46b9.s3tc.ctex"
|
||||||
|
path.etc2="res://.godot/imported/top_corner.png-2131e6fb02a65e1fd9265d84564f46b9.etc2.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"imported_formats": ["s3tc_bptc", "etc2_astc"],
|
||||||
|
"vram_texture": true
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://import/interface-elements/top_corner.png"
|
source_file="res://import/interface-elements/top_corner.png"
|
||||||
dest_files=["res://.godot/imported/top_corner.png-2131e6fb02a65e1fd9265d84564f46b9.ctex"]
|
dest_files=["res://.godot/imported/top_corner.png-2131e6fb02a65e1fd9265d84564f46b9.s3tc.ctex", "res://.godot/imported/top_corner.png-2131e6fb02a65e1fd9265d84564f46b9.etc2.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=2
|
||||||
compress/high_quality=false
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/uastc_level=0
|
compress/uastc_level=0
|
||||||
|
|
@ -23,7 +25,7 @@ compress/rdo_quality_loss=0.0
|
||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=false
|
mipmaps/generate=true
|
||||||
mipmaps/limit=-1
|
mipmaps/limit=-1
|
||||||
roughness/mode=0
|
roughness/mode=0
|
||||||
roughness/src_normal=""
|
roughness/src_normal=""
|
||||||
|
|
@ -37,4 +39,4 @@ process/normal_map_invert_y=false
|
||||||
process/hdr_as_srgb=false
|
process/hdr_as_srgb=false
|
||||||
process/hdr_clamp_exposure=false
|
process/hdr_clamp_exposure=false
|
||||||
process/size_limit=0
|
process/size_limit=0
|
||||||
detect_3d/compress_to=1
|
detect_3d/compress_to=0
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ func reset():
|
||||||
for player in anim_players: player.play("reveal")
|
for player in anim_players: player.play("reveal")
|
||||||
|
|
||||||
func fill_card_slots(id: int):
|
func fill_card_slots(id: int):
|
||||||
var new_cards := HardCards.get_cards_by_scene_id(id)
|
var new_cards : Array[Card] = HardCards.get_cards_by_scene_id(id)
|
||||||
|
|
||||||
for i in range(new_cards.size()):
|
for i in range(new_cards.size()):
|
||||||
$cards.get_child(i).remove_child($cards.get_child(i).get_child(1))
|
$cards.get_child(i).remove_child($cards.get_child(i).get_child(1))
|
||||||
|
|
|
||||||
|
|
@ -3,19 +3,21 @@
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://epjksqlw8frf"
|
uid="uid://epjksqlw8frf"
|
||||||
path="res://.godot/imported/decorative_paper.png-25372057da2dbe1a5e49c03959a73421.ctex"
|
path.s3tc="res://.godot/imported/decorative_paper.png-25372057da2dbe1a5e49c03959a73421.s3tc.ctex"
|
||||||
|
path.etc2="res://.godot/imported/decorative_paper.png-25372057da2dbe1a5e49c03959a73421.etc2.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"imported_formats": ["s3tc_bptc", "etc2_astc"],
|
||||||
|
"vram_texture": true
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://logic-scenes/collectable/decorative_paper.png"
|
source_file="res://logic-scenes/collectable/decorative_paper.png"
|
||||||
dest_files=["res://.godot/imported/decorative_paper.png-25372057da2dbe1a5e49c03959a73421.ctex"]
|
dest_files=["res://.godot/imported/decorative_paper.png-25372057da2dbe1a5e49c03959a73421.s3tc.ctex", "res://.godot/imported/decorative_paper.png-25372057da2dbe1a5e49c03959a73421.etc2.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=2
|
||||||
compress/high_quality=false
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/uastc_level=0
|
compress/uastc_level=0
|
||||||
|
|
@ -23,7 +25,7 @@ compress/rdo_quality_loss=0.0
|
||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=false
|
mipmaps/generate=true
|
||||||
mipmaps/limit=-1
|
mipmaps/limit=-1
|
||||||
roughness/mode=0
|
roughness/mode=0
|
||||||
roughness/src_normal=""
|
roughness/src_normal=""
|
||||||
|
|
@ -37,4 +39,4 @@ process/normal_map_invert_y=false
|
||||||
process/hdr_as_srgb=false
|
process/hdr_as_srgb=false
|
||||||
process/hdr_clamp_exposure=false
|
process/hdr_clamp_exposure=false
|
||||||
process/size_limit=0
|
process/size_limit=0
|
||||||
detect_3d/compress_to=1
|
detect_3d/compress_to=0
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
class_name Interactable extends Node3D
|
||||||
|
|
||||||
|
@export var interaction_ui: PackedScene = null
|
||||||
|
|
||||||
|
@onready var view: Node3D = $View
|
||||||
|
@onready var frame: Sprite3D = $Frame
|
||||||
|
|
||||||
|
var shown : bool = false
|
||||||
|
var hover : bool = false
|
||||||
|
var collected : bool = false
|
||||||
|
|
||||||
|
var tween: Tween = null
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
view.scale = Vector3.ZERO
|
||||||
|
frame.modulate.a = 0
|
||||||
|
|
||||||
|
func _process(_delta: float) -> void:
|
||||||
|
_process_hover()
|
||||||
|
_process_billboard()
|
||||||
|
|
||||||
|
func _process_billboard() -> void:
|
||||||
|
if shown:
|
||||||
|
var player_view := State.player_view
|
||||||
|
look_at(player_view.global_position, Vector3.UP, true)
|
||||||
|
|
||||||
|
func _process_hover() -> void:
|
||||||
|
if hover and not shown:
|
||||||
|
shown = true
|
||||||
|
view.scale = Vector3.ZERO
|
||||||
|
frame.modulate = Color.TRANSPARENT
|
||||||
|
view.rotation.z = -PI*0.5 # Godot angle wrapping is ... something
|
||||||
|
if tween: tween.kill()
|
||||||
|
tween = create_tween().set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_BACK)
|
||||||
|
tween.parallel().tween_property(view, "scale", Vector3.ONE, 1.0).set_delay(0.5)
|
||||||
|
tween.parallel().tween_property(view, "rotation:z", 0, 0.8).set_delay(0.5)
|
||||||
|
tween.parallel().tween_property(frame, "modulate:a", 1.0, 2.0)
|
||||||
|
|
||||||
|
elif not hover and shown:
|
||||||
|
shown = false
|
||||||
|
if tween: tween.kill()
|
||||||
|
tween = create_tween().set_ease(Tween.EASE_IN).set_trans(Tween.TRANS_BACK)
|
||||||
|
tween.parallel().tween_property(view, "scale", Vector3.ZERO, 0.3)
|
||||||
|
tween.parallel().tween_property(frame, "modulate:a", 0, 0.6)
|
||||||
|
|
||||||
|
func _input(event: InputEvent) -> void:
|
||||||
|
if hover and shown and event is InputEventMouseButton and event.is_action_pressed("ui_select"):
|
||||||
|
collected = true
|
||||||
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
uid://bp6s7vhdd6btk
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
[gd_scene load_steps=8 format=3 uid="uid://dreokijo757l1"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://bp6s7vhdd6btk" path="res://logic-scenes/interactable/interactable.gd" id="1_ih54h"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://d0ucjqi8tx6vt" path="res://import/interface-elements/frame.png" id="2_khok5"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://epjksqlw8frf" path="res://logic-scenes/collectable/decorative_paper.png" id="3_cjk23"]
|
||||||
|
[ext_resource type="FontFile" uid="uid://c084lmfai0iig" path="res://import/fonts/ArchitectsDaughter-Regular.ttf" id="4_dujq2"]
|
||||||
|
[ext_resource type="FontFile" uid="uid://qalmecrbkxyp" path="res://import/fonts/icon.ttf" id="5_wl31y"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bdnesuqroi7ss" path="res://vfx/collectable_particles.tscn" id="6_a6wx8"]
|
||||||
|
|
||||||
|
[sub_resource type="SphereShape3D" id="SphereShape3D_3rbj1"]
|
||||||
|
radius = 0.3
|
||||||
|
|
||||||
|
[node name="Interactable" type="Node3D"]
|
||||||
|
transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0, 0, 0)
|
||||||
|
script = ExtResource("1_ih54h")
|
||||||
|
metadata/_custom_type_script = "uid://bp6s7vhdd6btk"
|
||||||
|
|
||||||
|
[node name="Frame" type="Sprite3D" parent="."]
|
||||||
|
transform = Transform3D(0.9928179, -0.11963433, 6.278711e-10, 0.11963433, 0.9928179, -1.04587645e-08, 6.27864e-10, 1.0458765e-08, 1, -0.15, 0.05, 0.1)
|
||||||
|
pixel_size = 0.0005
|
||||||
|
no_depth_test = true
|
||||||
|
render_priority = 100
|
||||||
|
texture = ExtResource("2_khok5")
|
||||||
|
|
||||||
|
[node name="View" type="Node3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1, 0)
|
||||||
|
|
||||||
|
[node name="Sprite3D" type="Sprite3D" parent="View"]
|
||||||
|
pixel_size = 0.0007
|
||||||
|
no_depth_test = true
|
||||||
|
render_priority = 50
|
||||||
|
texture = ExtResource("3_cjk23")
|
||||||
|
|
||||||
|
[node name="Caption" type="Label3D" parent="View"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.03170359, 0)
|
||||||
|
double_sided = false
|
||||||
|
no_depth_test = true
|
||||||
|
render_priority = 75
|
||||||
|
modulate = Color(0.21239993, 0.12440842, 0.055158928, 1)
|
||||||
|
text = "lorem ipsum
|
||||||
|
dolor git amend"
|
||||||
|
font = ExtResource("4_dujq2")
|
||||||
|
font_size = 10
|
||||||
|
outline_size = 0
|
||||||
|
|
||||||
|
[node name="Icon" type="Label3D" parent="View"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.13325092, -0.084207475, 0)
|
||||||
|
double_sided = false
|
||||||
|
no_depth_test = true
|
||||||
|
render_priority = 75
|
||||||
|
modulate = Color(0.21239993, 0.12440842, 0.055158928, 1)
|
||||||
|
text = "xbox_button_a "
|
||||||
|
font = ExtResource("5_wl31y")
|
||||||
|
font_size = 10
|
||||||
|
outline_size = 0
|
||||||
|
|
||||||
|
[node name="Prompt" type="Label3D" parent="View/Icon"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0353532, 0, 0)
|
||||||
|
double_sided = false
|
||||||
|
no_depth_test = true
|
||||||
|
render_priority = 75
|
||||||
|
modulate = Color(0.2901961, 0.18039216, 0.08627451, 0.8901961)
|
||||||
|
text = "Action Prompt"
|
||||||
|
font = ExtResource("4_dujq2")
|
||||||
|
font_size = 8
|
||||||
|
outline_size = 0
|
||||||
|
horizontal_alignment = 0
|
||||||
|
|
||||||
|
[node name="Area3D" type="Area3D" parent="."]
|
||||||
|
collision_layer = 16
|
||||||
|
collision_mask = 16
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
|
||||||
|
shape = SubResource("SphereShape3D_3rbj1")
|
||||||
|
|
||||||
|
[node name="collectable_particles" parent="." instance=ExtResource("6_a6wx8")]
|
||||||
|
|
||||||
|
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||||
|
|
@ -103,6 +103,9 @@ signal ui_entered
|
||||||
signal ui_exited
|
signal ui_exited
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
|
State.player = self
|
||||||
|
State.player_view = %Camera3D
|
||||||
|
|
||||||
_handle_jitter(0)
|
_handle_jitter(0)
|
||||||
|
|
||||||
pitch.rotation_degrees.x = initial_pitch
|
pitch.rotation_degrees.x = initial_pitch
|
||||||
|
|
@ -145,23 +148,17 @@ var has_entered:bool = false:
|
||||||
var delay_passed:bool = false
|
var delay_passed:bool = false
|
||||||
|
|
||||||
func _on_ray_entered(_area):
|
func _on_ray_entered(_area):
|
||||||
if not has_entered:
|
var parent := _area.get_parent() as Interactable
|
||||||
var collision_object := focus_ray.get_collider()
|
assert(parent != null, "Ray entered non-interactable area!")
|
||||||
if collision_object is InteractiveSprite:
|
printt("ray entered", parent.name, parent)
|
||||||
|
parent.hover = true
|
||||||
|
Input.set_default_cursor_shape(Input.CURSOR_POINTING_HAND)
|
||||||
|
|
||||||
has_entered = collision_object.try_reveal(self)
|
func _on_ray_exited(_area):
|
||||||
|
var parent := _area.get_parent() as Interactable
|
||||||
await get_tree().create_timer(1.0).timeout
|
printt("ray exited", parent.name, parent)
|
||||||
if focus_ray.get_collider() is InteractiveSprite:
|
parent.hover = false
|
||||||
delay_passed = true
|
Input.set_default_cursor_shape(Input.CURSOR_ARROW)
|
||||||
else:
|
|
||||||
has_entered = false
|
|
||||||
else:
|
|
||||||
print_debug("You are standing in front of a wall")
|
|
||||||
|
|
||||||
func _on_ray_exited(area):
|
|
||||||
if delay_passed and area is InteractiveSprite:
|
|
||||||
has_entered = false
|
|
||||||
|
|
||||||
|
|
||||||
func _physics_process(delta: float):
|
func _physics_process(delta: float):
|
||||||
|
|
|
||||||
|
|
@ -624,13 +624,14 @@ transform = Transform3D(1, 0, 0, 0, 0.642787, -0.766044, 0, 0.766044, 0.642787,
|
||||||
[node name="Mount" type="Node3D" parent="Yaw/Pitch"]
|
[node name="Mount" type="Node3D" parent="Yaw/Pitch"]
|
||||||
|
|
||||||
[node name="Camera3D" type="Camera3D" parent="Yaw/Pitch/Mount"]
|
[node name="Camera3D" type="Camera3D" parent="Yaw/Pitch/Mount"]
|
||||||
|
unique_name_in_owner = true
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.202, 0.157)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.202, 0.157)
|
||||||
cull_mask = 3
|
cull_mask = 3
|
||||||
current = true
|
current = true
|
||||||
|
|
||||||
[node name="RayCast3D" type="RayCast3D" parent="Yaw/Pitch/Mount/Camera3D"]
|
[node name="RayCast3D" type="RayCast3D" parent="Yaw/Pitch/Mount/Camera3D"]
|
||||||
target_position = Vector3(0, 0, -1.5)
|
target_position = Vector3(0, 0, -1.5)
|
||||||
collision_mask = 17
|
collision_mask = 16
|
||||||
collide_with_areas = true
|
collide_with_areas = true
|
||||||
|
|
||||||
[node name="UiProber" type="Area3D" parent="Yaw/Pitch/Mount/Camera3D"]
|
[node name="UiProber" type="Area3D" parent="Yaw/Pitch/Mount/Camera3D"]
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,9 @@ signal environment_settings_changed
|
||||||
signal theme_changed
|
signal theme_changed
|
||||||
var current_main_theme:Theme = preload("res://logic-scenes/themes/handwriting.theme")
|
var current_main_theme:Theme = preload("res://logic-scenes/themes/handwriting.theme")
|
||||||
|
|
||||||
|
var player : PlayerController
|
||||||
|
var player_view : Camera3D
|
||||||
|
|
||||||
func set_theme(new_theme:Theme):
|
func set_theme(new_theme:Theme):
|
||||||
current_main_theme = new_theme
|
current_main_theme = new_theme
|
||||||
theme_changed.emit(new_theme)
|
theme_changed.emit(new_theme)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,344 @@
|
||||||
|
[gd_scene load_steps=16 format=3 uid="uid://d0x27tf7y5keu"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://mkccbig41bqb" path="res://logic-scenes/player_controller/player_controller.tscn" id="1_oayv8"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dreokijo757l1" path="res://logic-scenes/interactable/interactable.tscn" id="2_nl0nc"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bw47g00bi710i" path="res://base-environments/youth_room/youth_room_visuals.tscn" id="5_3rbj1"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dwtxjvprjyx8p" path="res://base-environments/youth_room/lava-lamp.tscn" id="6_ggen3"]
|
||||||
|
|
||||||
|
[sub_resource type="PlaneMesh" id="PlaneMesh_cv7g8"]
|
||||||
|
size = Vector2(50, 50)
|
||||||
|
|
||||||
|
[sub_resource type="SphereMesh" id="SphereMesh_7dqkp"]
|
||||||
|
radius = 5.0
|
||||||
|
height = 10.0
|
||||||
|
|
||||||
|
[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_nl0nc"]
|
||||||
|
|
||||||
|
[sub_resource type="GDScript" id="GDScript_06xif"]
|
||||||
|
script/source = "extends SpotLight3D
|
||||||
|
|
||||||
|
@export var strength:float = 0.3
|
||||||
|
@export var speed:float = 5
|
||||||
|
var noise = FastNoiseLite.new()
|
||||||
|
var spot:float = randf()
|
||||||
|
var base_energy = light_energy
|
||||||
|
@export var lit: bool = false
|
||||||
|
|
||||||
|
@onready var secondary_light: OmniLight3D = $desk_secondary
|
||||||
|
|
||||||
|
var litnes: float = float(lit)
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
if not lit: light_energy = 0
|
||||||
|
|
||||||
|
func _process(delta):
|
||||||
|
spot += speed*delta
|
||||||
|
light_energy = base_energy * (1 + noise.get_noise_1d(spot) * strength) * litnes
|
||||||
|
secondary_light.light_energy = light_energy/16
|
||||||
|
|
||||||
|
func switch_on():
|
||||||
|
var tween:Tween = create_tween()
|
||||||
|
tween.tween_property(self, \"litnes\", 1, 10)
|
||||||
|
|
||||||
|
func switch_off():
|
||||||
|
var tween:Tween = create_tween()
|
||||||
|
tween.tween_property(self, \"litnes\", 0, 1)
|
||||||
|
"
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_hqls1"]
|
||||||
|
length = 0.001
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("OmniLight3D2:light_energy")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [1.0]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_hxk3n"]
|
||||||
|
resource_name = "light_up"
|
||||||
|
length = 10.0
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("OmniLight3D2:light_energy")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 10),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [0.0, 1.0]
|
||||||
|
}
|
||||||
|
tracks/1/type = "method"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("desk_light")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"values": [{
|
||||||
|
"args": [],
|
||||||
|
"method": &"switch_on"
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_wa80i"]
|
||||||
|
resource_name = "lights_out"
|
||||||
|
length = 2.0
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("OmniLight3D2:light_energy")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 2),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [1.0, 0.0]
|
||||||
|
}
|
||||||
|
tracks/1/type = "method"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("desk_light")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"values": [{
|
||||||
|
"args": [],
|
||||||
|
"method": &"switch_off"
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_upogh"]
|
||||||
|
resource_name = "menu"
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("OmniLight3D2:light_energy")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [0.0]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_k8op5"]
|
||||||
|
_data = {
|
||||||
|
&"RESET": SubResource("Animation_hqls1"),
|
||||||
|
&"light_up": SubResource("Animation_hxk3n"),
|
||||||
|
&"lights_out": SubResource("Animation_wa80i"),
|
||||||
|
&"menu": SubResource("Animation_upogh")
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="GDScript" id="GDScript_dwmnt"]
|
||||||
|
script/source = "extends AnimationPlayer
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
Scenes.scene_finished.connect(lights_on)
|
||||||
|
Scenes.scene_starting.connect(lights_off)
|
||||||
|
|
||||||
|
func lights_off(id: int = -1, _repeat: bool = false):
|
||||||
|
if id == Scenes.id.YOUTH_VOICE_TRAINING:
|
||||||
|
await get_tree().create_timer(10).timeout
|
||||||
|
queue(\"lights_out\")
|
||||||
|
|
||||||
|
func lights_on(_id: int = -1, _repeat: bool = false):
|
||||||
|
queue(\"light_up\")
|
||||||
|
"
|
||||||
|
|
||||||
|
[sub_resource type="GDScript" id="GDScript_2qjvc"]
|
||||||
|
script/source = "extends SpotLight3D
|
||||||
|
|
||||||
|
@export var flicker_strength:float = 0.7
|
||||||
|
@export var speed:float = 4
|
||||||
|
var noise = FastNoiseLite.new()
|
||||||
|
var light_spot:float = randf()
|
||||||
|
var base_energy = light_energy
|
||||||
|
|
||||||
|
func _process(delta):
|
||||||
|
light_spot += speed*delta
|
||||||
|
light_energy = base_energy * (1 + noise.get_noise_1d(light_spot) * flicker_strength)
|
||||||
|
"
|
||||||
|
|
||||||
|
[node name="InteractableTests" type="Node"]
|
||||||
|
|
||||||
|
[node name="PlayerController" parent="." groups=["camera_owner"] instance=ExtResource("1_oayv8")]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
transform = Transform3D(0.686123, 0, 0.727485, 0, 1, 0, -0.727485, 0, 0.686123, 0.63, 0, 0.925)
|
||||||
|
enabled = true
|
||||||
|
|
||||||
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0049040318, -0.36189413, 0.003689289)
|
||||||
|
mesh = SubResource("PlaneMesh_cv7g8")
|
||||||
|
|
||||||
|
[node name="OmniLight3D" type="OmniLight3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4.221635, 0)
|
||||||
|
omni_range = 9.435307
|
||||||
|
|
||||||
|
[node name="MeshInstance3D2" type="MeshInstance3D" parent="."]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.5455923, 4.7683716e-07, -5.57273)
|
||||||
|
mesh = SubResource("SphereMesh_7dqkp")
|
||||||
|
|
||||||
|
[node name="StaticBody3D" type="StaticBody3D" parent="."]
|
||||||
|
|
||||||
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D"]
|
||||||
|
shape = SubResource("WorldBoundaryShape3D_nl0nc")
|
||||||
|
|
||||||
|
[node name="Interactable" parent="." instance=ExtResource("2_nl0nc")]
|
||||||
|
transform = Transform3D(-1, 0, 1.509958e-07, 0, 1, 0, -1.509958e-07, 0, -1, 0.0017054975, 0.59263134, 2.5304449)
|
||||||
|
|
||||||
|
[node name="visuals" parent="." instance=ExtResource("5_3rbj1")]
|
||||||
|
|
||||||
|
[node name="Shadow" type="CSGCombiner3D" parent="visuals"]
|
||||||
|
cast_shadow = 3
|
||||||
|
calculate_tangents = false
|
||||||
|
|
||||||
|
[node name="CSGBox3D" type="CSGBox3D" parent="visuals/Shadow"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.34613, 1.23087, 2.97923)
|
||||||
|
size = Vector3(5.26758, 2.69583, 0.137207)
|
||||||
|
|
||||||
|
[node name="CSGBox3D2" type="CSGBox3D" parent="visuals/Shadow"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.441227, 2.48778, 0.766643)
|
||||||
|
size = Vector3(3.47876, 0.182022, 4.56238)
|
||||||
|
|
||||||
|
[node name="CSGBox3D6" type="CSGBox3D" parent="visuals/Shadow"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.21313, 1.23861, 0.766643)
|
||||||
|
size = Vector3(0.170044, 2.68037, 4.56238)
|
||||||
|
|
||||||
|
[node name="CSGBox3D4" type="CSGBox3D" parent="visuals/Shadow"]
|
||||||
|
transform = Transform3D(0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 0, 0, 1, 3.1589, 1.73312, 0.766643)
|
||||||
|
size = Vector3(2.57013, 0.182022, 4.56238)
|
||||||
|
|
||||||
|
[node name="CSGBox3D5" type="CSGBox3D" parent="visuals/Shadow"]
|
||||||
|
transform = Transform3D(0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 0, 0, 1, 3.09781, 1.7764, -0.332882)
|
||||||
|
operation = 2
|
||||||
|
size = Vector3(1.25306, 0.312046, 0.893661)
|
||||||
|
|
||||||
|
[node name="CSGBox3D3" type="CSGBox3D" parent="visuals/Shadow"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.977913, 1.52551, 2.97298)
|
||||||
|
operation = 2
|
||||||
|
calculate_tangents = false
|
||||||
|
flip_faces = true
|
||||||
|
size = Vector3(1.74371, 1.18614, 0.271545)
|
||||||
|
|
||||||
|
[node name="OmniLight3D" type="OmniLight3D" parent="visuals"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.73188, 2.33544, 4.04756)
|
||||||
|
visible = false
|
||||||
|
light_energy = 3.0
|
||||||
|
light_size = 2.0
|
||||||
|
light_specular = 0.2
|
||||||
|
light_bake_mode = 0
|
||||||
|
shadow_enabled = true
|
||||||
|
shadow_caster_mask = 4293918721
|
||||||
|
|
||||||
|
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="visuals"]
|
||||||
|
transform = Transform3D(0.82167387, 0.44718716, -0.35337743, -0.41379577, 0.8944143, 0.16969287, 0.39195043, 0.0067938697, 0.9199613, 0.866179, 2.88055, 4.51936)
|
||||||
|
visible = false
|
||||||
|
light_color = Color(0.81982, 0.935491, 0.980381, 1)
|
||||||
|
light_energy = 20.0
|
||||||
|
light_angular_distance = 2.0
|
||||||
|
light_bake_mode = 0
|
||||||
|
shadow_enabled = true
|
||||||
|
directional_shadow_mode = 1
|
||||||
|
sky_mode = 1
|
||||||
|
|
||||||
|
[node name="lights" type="Node3D" parent="visuals"]
|
||||||
|
|
||||||
|
[node name="desk_light" type="SpotLight3D" parent="visuals/lights"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 0.30009, 0.953911, 0, -0.953911, 0.30009, -0.599038, 1.39757, 1.64821)
|
||||||
|
layers = 2
|
||||||
|
light_color = Color(0.94902, 0.737255, 0.627451, 1)
|
||||||
|
light_energy = 8.0
|
||||||
|
light_size = 0.1
|
||||||
|
shadow_enabled = true
|
||||||
|
shadow_bias = 0.002
|
||||||
|
spot_range = 2.47523
|
||||||
|
spot_angle = 58.1539
|
||||||
|
spot_angle_attenuation = 0.812252
|
||||||
|
script = SubResource("GDScript_06xif")
|
||||||
|
|
||||||
|
[node name="desk_secondary" type="OmniLight3D" parent="visuals/lights/desk_light"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 2.98023e-08, 1, 0.221273, 0.0654936, -0.292101)
|
||||||
|
light_color = Color(0.952941, 0.662745, 0.54902, 1)
|
||||||
|
light_energy = 0.5
|
||||||
|
light_size = 0.499
|
||||||
|
light_specular = 0.0
|
||||||
|
light_cull_mask = 4293918721
|
||||||
|
shadow_enabled = true
|
||||||
|
shadow_bias = 0.01
|
||||||
|
shadow_normal_bias = 5.78
|
||||||
|
omni_attenuation = 1.51572
|
||||||
|
|
||||||
|
[node name="shade_light" type="OmniLight3D" parent="visuals/lights/desk_light"]
|
||||||
|
light_color = Color(0.94902, 0.737255, 0.627451, 1)
|
||||||
|
light_energy = 0.5
|
||||||
|
light_cull_mask = 4293918721
|
||||||
|
omni_range = 0.147682
|
||||||
|
|
||||||
|
[node name="OmniLight3D2" type="OmniLight3D" parent="visuals/lights"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.10614, 0.582081, 0.161548)
|
||||||
|
light_color = Color(0.894118, 0.87451, 0.686275, 1)
|
||||||
|
light_size = 0.2
|
||||||
|
light_specular = 0.1
|
||||||
|
light_bake_mode = 1
|
||||||
|
light_cull_mask = 4293918721
|
||||||
|
shadow_enabled = true
|
||||||
|
omni_range = 2.0
|
||||||
|
omni_attenuation = 0.450626
|
||||||
|
|
||||||
|
[node name="OmniLight3D4" type="OmniLight3D" parent="visuals/lights"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.47143, 1.6968, -0.548992)
|
||||||
|
layers = 32769
|
||||||
|
light_color = Color(0.894118, 0.87451, 0.686275, 1)
|
||||||
|
light_energy = 0.1
|
||||||
|
light_size = 0.3
|
||||||
|
light_specular = 0.0
|
||||||
|
light_cull_mask = 4293918721
|
||||||
|
shadow_enabled = true
|
||||||
|
omni_range = 1.3534
|
||||||
|
omni_attenuation = 1.41421
|
||||||
|
|
||||||
|
[node name="LightAnimation" type="AnimationPlayer" parent="visuals/lights" groups=["scene_actors"]]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
libraries = {
|
||||||
|
&"": SubResource("AnimationLibrary_k8op5")
|
||||||
|
}
|
||||||
|
autoplay = "menu"
|
||||||
|
script = SubResource("GDScript_dwmnt")
|
||||||
|
|
||||||
|
[node name="vfx" type="Node3D" parent="visuals"]
|
||||||
|
|
||||||
|
[node name="lava-lamp" parent="visuals/vfx" instance=ExtResource("6_ggen3")]
|
||||||
|
transform = Transform3D(0.488743, 0, -0.872428, 0, 1, 0, 0.872428, 0, 0.488743, 3.1041, 0.962981, 2.21157)
|
||||||
|
skeleton = NodePath("")
|
||||||
|
|
||||||
|
[node name="ReflectionProbe" type="ReflectionProbe" parent="visuals/vfx/lava-lamp"]
|
||||||
|
transform = Transform3D(0.866853, 0, -0.498563, 0, 1, 0, 0.498563, 0, 0.866853, -0.0356357, 0.0416123, 0.020328)
|
||||||
|
max_distance = 7.0
|
||||||
|
size = Vector3(2, 2, 2)
|
||||||
|
|
||||||
|
[node name="OmniLight3D" type="SpotLight3D" parent="visuals/vfx/lava-lamp"]
|
||||||
|
transform = Transform3D(0.9999999, 0, 0, 0, -4.3711395e-08, -1, 0, 0.9999999, -4.3711385e-08, 0.011304617, 0.187006, -0.0021249056)
|
||||||
|
light_color = Color(0.21945003, 0.45, 0.189, 1)
|
||||||
|
light_size = 0.05
|
||||||
|
light_specular = 0.3
|
||||||
|
light_bake_mode = 1
|
||||||
|
light_cull_mask = 4293918721
|
||||||
|
spot_range = 1.5
|
||||||
|
spot_attenuation = 1.2
|
||||||
|
spot_angle = 137.58
|
||||||
|
spot_angle_attenuation = 1.6358016
|
||||||
|
script = SubResource("GDScript_2qjvc")
|
||||||
Loading…
Reference in New Issue