initial commit
This commit is contained in:
63
AGUI.Bases.Button3D.tscn
Normal file
63
AGUI.Bases.Button3D.tscn
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
[gd_scene format=3 uid="uid://icaxptclt0rm"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://dwbx108724v25" path="res://AgainstGravityUI/AGUI.Scripts/AGUI.Bases.Button3D.gd" id="1_1du0n"]
|
||||||
|
[ext_resource type="Script" uid="uid://cbexo34ybb17a" path="res://AgainstGravityUI/AGUI.Scripts/AGUI.Bases.Button3D.Collider.gd" id="2_xjbij"]
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_xeeyd"]
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_1du0n"]
|
||||||
|
length = 0.001
|
||||||
|
tracks/0/type = "position_3d"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("StaticBody3D/MeshRoot")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = PackedFloat32Array(0, 1, 0, 0, 0)
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_xjbij"]
|
||||||
|
resource_name = "interact"
|
||||||
|
length = 0.1
|
||||||
|
tracks/0/type = "position_3d"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("StaticBody3D/MeshRoot")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = PackedFloat32Array(0, 1, 0, 0, 0, 0.03333334, 1, 0, -0.05, 0)
|
||||||
|
|
||||||
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_7pntp"]
|
||||||
|
_data = {
|
||||||
|
&"RESET": SubResource("Animation_1du0n"),
|
||||||
|
&"interact": SubResource("Animation_xjbij")
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="AGUIButtonBase3D" type="Node3D" unique_id=81597797]
|
||||||
|
script = ExtResource("1_1du0n")
|
||||||
|
|
||||||
|
[node name="StaticBody3D" type="StaticBody3D" parent="." unique_id=1473098479]
|
||||||
|
collision_layer = 2
|
||||||
|
collision_mask = 2
|
||||||
|
script = ExtResource("2_xjbij")
|
||||||
|
|
||||||
|
[node name="Collider" type="CollisionShape3D" parent="StaticBody3D" unique_id=335334790]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 0.011110017, 0, 0, 0, 1, 0, 0, 0)
|
||||||
|
shape = SubResource("BoxShape3D_xeeyd")
|
||||||
|
|
||||||
|
[node name="MeshRoot" type="CSGCombiner3D" parent="StaticBody3D" unique_id=1112723183]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 0.024529457, 0, 0, 0, 1, 0, 0, 0)
|
||||||
|
operation = 2
|
||||||
|
|
||||||
|
[node name="MainMesh" type="CSGBox3D" parent="StaticBody3D/MeshRoot" unique_id=1438018078]
|
||||||
|
|
||||||
|
[node name="Subtractor_Box" type="CSGBox3D" parent="StaticBody3D/MeshRoot/MainMesh" unique_id=842962794]
|
||||||
|
operation = 2
|
||||||
|
|
||||||
|
[node name="Subtractor_Cylinder" type="CSGCylinder3D" parent="StaticBody3D/MeshRoot/MainMesh/Subtractor_Box" unique_id=1951089581]
|
||||||
|
transform = Transform3D(0.9, 0, 0, 0, 0.9, 0, 0, 0, 0.9, 0, 0, 0)
|
||||||
|
operation = 2
|
||||||
|
radius = 0.734
|
||||||
|
|
||||||
|
[node name="Animator" type="AnimationPlayer" parent="StaticBody3D" unique_id=53081295]
|
||||||
|
root_node = NodePath("../..")
|
||||||
|
libraries/ = SubResource("AnimationLibrary_7pntp")
|
||||||
2
AGUI.Class.gd
Normal file
2
AGUI.Class.gd
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
extends StaticBody3D
|
||||||
|
class_name AGUIRootNode
|
||||||
1
AGUI.Class.gd.uid
Normal file
1
AGUI.Class.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://bhvtgi1j8wcqq
|
||||||
34
AGUI.Scripts/AGUI.Bases.Button3D.Collider.gd
Normal file
34
AGUI.Scripts/AGUI.Bases.Button3D.Collider.gd
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
extends StaticBody3D
|
||||||
|
|
||||||
|
var baseColor : Color
|
||||||
|
var pressedColor : Color
|
||||||
|
@onready var Animator = $Animator
|
||||||
|
var pressed : bool = false
|
||||||
|
var ButtonMaterial : StandardMaterial3D = StandardMaterial3D.new()
|
||||||
|
|
||||||
|
func _initButton(BaseColor:Color,PressedColor:Color):
|
||||||
|
baseColor=BaseColor
|
||||||
|
pressedColor=PressedColor
|
||||||
|
ButtonMaterial.albedo_color = BaseColor
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
|
||||||
|
$MeshRoot.material_override = ButtonMaterial
|
||||||
|
ButtonMaterial.albedo_color = baseColor
|
||||||
|
Animator.get_animation("interact").loop_mode = Animation.LOOP_NONE
|
||||||
|
|
||||||
|
func press():
|
||||||
|
if !pressed:
|
||||||
|
$"..".buttonPressed.emit()
|
||||||
|
$"..".buttonUpdated.emit()
|
||||||
|
Animator.play("interact")
|
||||||
|
ButtonMaterial.albedo_color = pressedColor
|
||||||
|
pressed=true
|
||||||
|
|
||||||
|
func release():
|
||||||
|
if pressed:
|
||||||
|
$"..".buttonReleased.emit()
|
||||||
|
$"..".buttonUpdated.emit()
|
||||||
|
Animator.play_backwards("interact")
|
||||||
|
ButtonMaterial.albedo_color = baseColor
|
||||||
|
pressed=false
|
||||||
1
AGUI.Scripts/AGUI.Bases.Button3D.Collider.gd.uid
Normal file
1
AGUI.Scripts/AGUI.Bases.Button3D.Collider.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://cbexo34ybb17a
|
||||||
13
AGUI.Scripts/AGUI.Bases.Button3D.gd
Normal file
13
AGUI.Scripts/AGUI.Bases.Button3D.gd
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
extends Node3D
|
||||||
|
|
||||||
|
signal buttonPressed
|
||||||
|
signal buttonReleased
|
||||||
|
signal buttonUpdated
|
||||||
|
|
||||||
|
@export_category("Visuals")
|
||||||
|
@export var baseColor : Color
|
||||||
|
@export var pressedColor : Color
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
$StaticBody3D._initButton(baseColor,pressedColor)
|
||||||
|
print(baseColor,pressedColor)
|
||||||
1
AGUI.Scripts/AGUI.Bases.Button3D.gd.uid
Normal file
1
AGUI.Scripts/AGUI.Bases.Button3D.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://dwbx108724v25
|
||||||
12
AGUI.gd
Normal file
12
AGUI.gd
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
var GUIScreens : Dictionary = {
|
||||||
|
"Main": load("res://Player/AGUI.WatchPanels/AGUI.Watch.Main.tscn"),
|
||||||
|
"Settings": load("res://Player/AGUI.WatchPanels/AGUI.Watch.Settings.tscn")
|
||||||
|
}
|
||||||
|
var CurrentScreen : String = ""
|
||||||
|
|
||||||
|
func freeWatch():
|
||||||
|
if CurrentScreen != "":
|
||||||
|
get_node("/root/" + CurrentScreen).queue_free()
|
||||||
|
CurrentScreen = ""
|
||||||
1
AGUI.gd.uid
Normal file
1
AGUI.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://dtu1iixrydyt
|
||||||
Reference in New Issue
Block a user