space_object.tscn 2,6 КБ
Newer Older
Vladimir Levadnij's avatar
Vladimir Levadnij включено в состав коммита
1
2
[gd_scene load_steps=6 format=2]

magcourier's avatar
magcourier включено в состав коммита
3
[ext_resource path="res://blokoj/kosmo/resursoj/space station.obj" type="ArrayMesh" id=1]
Vladimir Levadnij's avatar
Vladimir Levadnij включено в состав коммита
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[ext_resource path="res://blokoj/kosmo/tactical_label.tscn" type="PackedScene" id=2]

[sub_resource type="SpatialMaterial" id=1]
metallic = 0.53
emission_enabled = true
emission = Color( 0, 0, 0, 1 )
emission_energy = 1.0
emission_operator = 0
emission_on_uv2 = false

[sub_resource type="GDScript" id=2]
script/source = "extends MeshInstance

signal new_way_point(position)
# Called when the node enters the scene tree for the first time.
var dock = Quat()
func _ready():
	$tactical_label.connect(\"new_way_point\",self,\"set_way_point\")
	pass

func set_way_point(position):
	emit_signal(\"new_way_point\",position,dock)

func _on_Area_input_event(camera, event, click_position, click_normal, shape_idx):
28
29
30
31
	if Input.is_action_just_pressed(\"left_click\"):
		$menu.popup()
		if event is InputEventMouseButton and event.doubleclick:
			set_way_point($tactical_label.get_global_transform().origin)
Vladimir Levadnij's avatar
Vladimir Levadnij включено в состав коммита
32
33
34
35
36
37
38
39

func _on_Area_mouse_entered():
	var mat = get_surface_material(0)
	mat.flags_unshaded = true

func _on_Area_mouse_exited():
	var mat = get_surface_material(0)
	mat.flags_unshaded = false
40

Vladimir Levadnij's avatar
Vladimir Levadnij включено в состав коммита
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"

[sub_resource type="BoxShape" id=3]
extents = Vector3( 43.0109, 32.3148, 36.7482 )

[node name="space_object" type="MeshInstance"]
transform = Transform( 10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 10.01, 0 )
mesh = ExtResource( 1 )
material/0 = SubResource( 1 )
material/1 = null
script = SubResource( 2 )

[node name="tactical_label" parent="." instance=ExtResource( 2 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.91048, -0.313731, 0 )

[node name="Area" type="Area" parent="."]
transform = Transform( 0.1, 0, 0, 0, 0.1, 0, 0, 0, 0.1, 0, 1.5532, 0.216571 )

[node name="CollisionShape" type="CollisionShape" parent="Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.145429, 8.51342, 0 )
shape = SubResource( 3 )
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81

[node name="menu" type="WindowDialog" parent="."]
margin_left = 846.0
margin_top = 133.0
margin_right = 1021.0
margin_bottom = 508.0
__meta__ = {
"_edit_use_anchors_": false
}

[node name="RichTextLabel" type="RichTextLabel" parent="menu"]
margin_left = 25.0231
margin_top = 17.239
margin_right = 161.023
margin_bottom = 340.239
bbcode_text = "space_station_menu"
text = "space_station_menu"
__meta__ = {
"_edit_use_anchors_": false
}
Vladimir Levadnij's avatar
Vladimir Levadnij включено в состав коммита
82
83
84
[connection signal="input_event" from="Area" to="." method="_on_Area_input_event"]
[connection signal="mouse_entered" from="Area" to="." method="_on_Area_mouse_entered"]
[connection signal="mouse_exited" from="Area" to="." method="_on_Area_mouse_exited"]