some glue code between player and weapon
This commit is contained in:
parent
39fb87f62d
commit
ec7b08812d
6 changed files with 100 additions and 124 deletions
|
@ -1,83 +1,10 @@
|
|||
[gd_scene load_steps=11 format=3 uid="uid://dwx5tcatj35gu"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://dwx5tcatj35gu"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dts8lbivkgsmj" path="res://base/scripts/player/player.gd" id="1_1w3ab"]
|
||||
[ext_resource type="Texture2D" uid="uid://cf7avgppv4kfk" path="res://base/assets/guns/placeholder/static.png" id="1_7s1wv"]
|
||||
[ext_resource type="Texture2D" uid="uid://cfw6p5g680c55" path="res://base/assets/guns/placeholder/shoot1.png" id="2_7ptt8"]
|
||||
[ext_resource type="Texture2D" uid="uid://bwfkjfpk4dwx0" path="res://base/assets/guns/placeholder/shoot2.png" id="3_1w3ab"]
|
||||
[ext_resource type="Texture2D" uid="uid://bp1frp3sm8bic" path="res://base/assets/guns/placeholder/shoot3.png" id="4_gt0rj"]
|
||||
[ext_resource type="PackedScene" uid="uid://bb6ovrbusyxpi" path="res://base/scenes/weapons/weapon_base.tscn" id="2_ma1q3"]
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_jjqxs"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_i1xqq"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:texture")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [null]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_8sdfx"]
|
||||
resource_name = "shoot"
|
||||
length = 0.30001
|
||||
step = 0.1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:texture")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.1, 0.2),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [ExtResource("2_7ptt8"), ExtResource("3_1w3ab"), ExtResource("4_gt0rj")]
|
||||
}
|
||||
tracks/1/type = "method"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("../..")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0.3),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"values": [{
|
||||
"args": [],
|
||||
"method": &"shoot_animation_ended"
|
||||
}]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_ma1q3"]
|
||||
resource_name = "static"
|
||||
length = 0.001
|
||||
step = 0.0
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:texture")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [ExtResource("1_7s1wv")]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_7ptt8"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_i1xqq"),
|
||||
&"shoot": SubResource("Animation_8sdfx"),
|
||||
&"static": SubResource("Animation_ma1q3")
|
||||
}
|
||||
|
||||
[node name="Player" type="CharacterBody3D"]
|
||||
collision_layer = 2
|
||||
collision_mask = 3
|
||||
|
@ -104,7 +31,8 @@ size_flags_vertical = 3
|
|||
stretch_mode = 6
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="HUD/Weapon"]
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_7ptt8")
|
||||
}
|
||||
autoplay = "static"
|
||||
|
||||
[node name="WeaponContainer" type="Node3D" parent="."]
|
||||
|
||||
[node name="Weapon" parent="WeaponContainer" instance=ExtResource("2_ma1q3")]
|
||||
|
|
|
@ -1,13 +1,19 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://bb6ovrbusyxpi"]
|
||||
[gd_scene load_steps=6 format=3 uid="uid://bb6ovrbusyxpi"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bf0q3xe6oavqa" path="res://base/scripts/weapons/weapon_base.gd" id="1_rwatx"]
|
||||
[ext_resource type="Script" path="res://base/scripts/weapons/fire_mode/single_fire_mode.gd" id="2_bt0tf"]
|
||||
[ext_resource type="Script" uid="uid://bvurg687pt06s" path="res://base/scripts/weapons/barrel.gd" id="2_n0n7m"]
|
||||
[ext_resource type="AnimationLibrary" uid="uid://cw8bt4hqxpk55" path="res://base/assets/guns/placeholder/placeholder.tres" id="2_p83j3"]
|
||||
|
||||
[node name="Weapon" type="Node3D" node_paths=PackedStringArray("barrel")]
|
||||
[sub_resource type="Resource" id="Resource_ij06d"]
|
||||
script = ExtResource("2_bt0tf")
|
||||
fire_delay = 0.3
|
||||
metadata/_custom_type_script = "uid://ckexgw71dd5jc"
|
||||
|
||||
[node name="Weapon" type="Node3D"]
|
||||
script = ExtResource("1_rwatx")
|
||||
barrel = NodePath("Barrel")
|
||||
uses_hands = Array[int]([1])
|
||||
fire_mode = SubResource("Resource_ij06d")
|
||||
animation_library = ExtResource("2_p83j3")
|
||||
|
||||
[node name="Barrel" type="Node3D" parent="."]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue