mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-30 23:32:29 +08:00
feat(战斗): 添加剑砍特效并重构火山子弹碰撞检测
- 新增剑砍音效及特效资源 - 为火山子弹添加命中时触发剑砍特效 - 使用FollowPosition组件重构碰撞检测逻辑 - 简化动画轨道和碰撞体配置
This commit is contained in:
+53
-165
@@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=15 format=3 uid="uid://8uepi7uql314"]
|
[gd_scene load_steps=13 format=3 uid="uid://8uepi7uql314"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_gd3m7"]
|
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_gd3m7"]
|
||||||
[ext_resource type="Script" uid="uid://ci5hswfhck5as" path="res://scripts/Contents/Bullets/Volcano.gd" id="2_w1utg"]
|
[ext_resource type="Script" uid="uid://ci5hswfhck5as" path="res://scripts/Contents/Bullets/Volcano.gd" id="2_w1utg"]
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
[ext_resource type="AudioStream" uid="uid://cer3lxbxqw5pq" path="res://resources/sounds/effect/sword1.mp3" id="3_6sp0s"]
|
[ext_resource type="AudioStream" uid="uid://cer3lxbxqw5pq" path="res://resources/sounds/effect/sword1.mp3" id="3_6sp0s"]
|
||||||
[ext_resource type="AudioStream" uid="uid://cfwu55dfgs4bl" path="res://resources/sounds/effect/sword2.mp3" id="4_1sgli"]
|
[ext_resource type="AudioStream" uid="uid://cfwu55dfgs4bl" path="res://resources/sounds/effect/sword2.mp3" id="4_1sgli"]
|
||||||
[ext_resource type="AudioStream" uid="uid://bm2o8hu7nyqh1" path="res://resources/sounds/effect/sword3.mp3" id="5_b5nxd"]
|
[ext_resource type="AudioStream" uid="uid://bm2o8hu7nyqh1" path="res://resources/sounds/effect/sword3.mp3" id="5_b5nxd"]
|
||||||
|
[ext_resource type="Script" uid="uid://ckc6guqib3rno" path="res://scripts/Statemachine/FollowPosition.gd" id="7_1sgli"]
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_w1utg"]
|
[sub_resource type="Animation" id="Animation_w1utg"]
|
||||||
length = 0.001
|
length = 0.001
|
||||||
@@ -20,88 +21,40 @@ tracks/0/keys = {
|
|||||||
"points": PackedFloat32Array(150, -0.25, 0, 0.25, 0),
|
"points": PackedFloat32Array(150, -0.25, 0, 0.25, 0),
|
||||||
"times": PackedFloat32Array(0)
|
"times": PackedFloat32Array(0)
|
||||||
}
|
}
|
||||||
tracks/1/type = "value"
|
tracks/1/type = "bezier"
|
||||||
tracks/1/imported = false
|
tracks/1/imported = false
|
||||||
tracks/1/enabled = true
|
tracks/1/enabled = true
|
||||||
tracks/1/path = NodePath("%hitbox:disabled")
|
tracks/1/path = NodePath("anchor:rotation")
|
||||||
tracks/1/interp = 1
|
tracks/1/interp = 1
|
||||||
tracks/1/loop_wrap = true
|
tracks/1/loop_wrap = true
|
||||||
tracks/1/keys = {
|
tracks/1/keys = {
|
||||||
"times": PackedFloat32Array(0),
|
"handle_modes": PackedInt32Array(0),
|
||||||
"transitions": PackedFloat32Array(1),
|
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
|
||||||
"update": 1,
|
"times": PackedFloat32Array(0)
|
||||||
"values": [false]
|
|
||||||
}
|
}
|
||||||
tracks/2/type = "bezier"
|
tracks/2/type = "bezier"
|
||||||
tracks/2/imported = false
|
tracks/2/imported = false
|
||||||
tracks/2/enabled = true
|
tracks/2/enabled = true
|
||||||
tracks/2/path = NodePath("anchor:rotation")
|
tracks/2/path = NodePath("anchor:scale:x")
|
||||||
tracks/2/interp = 1
|
tracks/2/interp = 1
|
||||||
tracks/2/loop_wrap = true
|
tracks/2/loop_wrap = true
|
||||||
tracks/2/keys = {
|
tracks/2/keys = {
|
||||||
"handle_modes": PackedInt32Array(0),
|
"handle_modes": PackedInt32Array(0),
|
||||||
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
|
"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0),
|
||||||
"times": PackedFloat32Array(0)
|
"times": PackedFloat32Array(0)
|
||||||
}
|
}
|
||||||
tracks/3/type = "value"
|
tracks/3/type = "value"
|
||||||
tracks/3/imported = false
|
tracks/3/imported = false
|
||||||
tracks/3/enabled = true
|
tracks/3/enabled = true
|
||||||
tracks/3/path = NodePath("%texture/../hitbox2:disabled")
|
tracks/3/path = NodePath("%texture/..:usingDamageMultiplier")
|
||||||
tracks/3/interp = 1
|
tracks/3/interp = 1
|
||||||
tracks/3/loop_wrap = true
|
tracks/3/loop_wrap = true
|
||||||
tracks/3/keys = {
|
tracks/3/keys = {
|
||||||
"times": PackedFloat32Array(0),
|
"times": PackedFloat32Array(0),
|
||||||
"transitions": PackedFloat32Array(1),
|
"transitions": PackedFloat32Array(1),
|
||||||
"update": 1,
|
"update": 1,
|
||||||
"values": [true]
|
|
||||||
}
|
|
||||||
tracks/4/type = "value"
|
|
||||||
tracks/4/imported = false
|
|
||||||
tracks/4/enabled = true
|
|
||||||
tracks/4/path = NodePath("%texture/../hitbox3:disabled")
|
|
||||||
tracks/4/interp = 1
|
|
||||||
tracks/4/loop_wrap = true
|
|
||||||
tracks/4/keys = {
|
|
||||||
"times": PackedFloat32Array(0),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 1,
|
|
||||||
"values": [true]
|
|
||||||
}
|
|
||||||
tracks/5/type = "bezier"
|
|
||||||
tracks/5/imported = false
|
|
||||||
tracks/5/enabled = true
|
|
||||||
tracks/5/path = NodePath("anchor:scale:x")
|
|
||||||
tracks/5/interp = 1
|
|
||||||
tracks/5/loop_wrap = true
|
|
||||||
tracks/5/keys = {
|
|
||||||
"handle_modes": PackedInt32Array(0),
|
|
||||||
"points": PackedFloat32Array(1, -0.25, 0, 0.25, 0),
|
|
||||||
"times": PackedFloat32Array(0)
|
|
||||||
}
|
|
||||||
tracks/6/type = "value"
|
|
||||||
tracks/6/imported = false
|
|
||||||
tracks/6/enabled = true
|
|
||||||
tracks/6/path = NodePath("%texture/..:usingDamageMultiplier")
|
|
||||||
tracks/6/interp = 1
|
|
||||||
tracks/6/loop_wrap = true
|
|
||||||
tracks/6/keys = {
|
|
||||||
"times": PackedFloat32Array(0),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 1,
|
|
||||||
"values": [0]
|
"values": [0]
|
||||||
}
|
}
|
||||||
tracks/7/type = "value"
|
|
||||||
tracks/7/imported = false
|
|
||||||
tracks/7/enabled = true
|
|
||||||
tracks/7/path = NodePath("%texture/../hitbox4:disabled")
|
|
||||||
tracks/7/interp = 1
|
|
||||||
tracks/7/loop_wrap = true
|
|
||||||
tracks/7/keys = {
|
|
||||||
"times": PackedFloat32Array(0),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 1,
|
|
||||||
"values": [true]
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_oinqg"]
|
[sub_resource type="Animation" id="Animation_oinqg"]
|
||||||
resource_name = "destroy"
|
resource_name = "destroy"
|
||||||
@@ -123,83 +76,47 @@ tracks/0/keys = {
|
|||||||
"points": PackedFloat32Array(150, -0.25, 0, 0.25, 0, 500, -0.083333336, -8.333334, 0, 0, 300, -0.01666667, 83.333336, 0, 0),
|
"points": PackedFloat32Array(150, -0.25, 0, 0.25, 0, 500, -0.083333336, -8.333334, 0, 0, 300, -0.01666667, 83.333336, 0, 0),
|
||||||
"times": PackedFloat32Array(0, 0.2, 0.3)
|
"times": PackedFloat32Array(0, 0.2, 0.3)
|
||||||
}
|
}
|
||||||
tracks/1/type = "value"
|
tracks/1/type = "bezier"
|
||||||
tracks/1/imported = false
|
tracks/1/imported = false
|
||||||
tracks/1/enabled = true
|
tracks/1/enabled = true
|
||||||
tracks/1/path = NodePath("%hitbox:disabled")
|
tracks/1/path = NodePath("anchor:rotation")
|
||||||
tracks/1/interp = 1
|
tracks/1/interp = 1
|
||||||
tracks/1/loop_wrap = true
|
tracks/1/loop_wrap = true
|
||||||
tracks/1/keys = {
|
tracks/1/keys = {
|
||||||
"times": PackedFloat32Array(0, 0.4),
|
|
||||||
"transitions": PackedFloat32Array(1, 1),
|
|
||||||
"update": 1,
|
|
||||||
"values": [false, true]
|
|
||||||
}
|
|
||||||
tracks/2/type = "bezier"
|
|
||||||
tracks/2/imported = false
|
|
||||||
tracks/2/enabled = true
|
|
||||||
tracks/2/path = NodePath("anchor:rotation")
|
|
||||||
tracks/2/interp = 1
|
|
||||||
tracks/2/loop_wrap = true
|
|
||||||
tracks/2/keys = {
|
|
||||||
"handle_modes": PackedInt32Array(0, 0, 0, 0, 0, 0),
|
"handle_modes": PackedInt32Array(0, 0, 0, 0, 0, 0),
|
||||||
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0, 0.7853982, -0.06585455, -0.14365458, 0.2, 0, -0.7853982, -0.06666666, 0.2617994, 0, 0, -0.7853982, -0.033333343, 0, 0, 0, 3.142, -0.041666668, 0.91629785, 0, 0),
|
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0, 0.7853982, -0.06585455, -0.14365458, 0.2, 0, -0.7853982, -0.06666666, 0.2617994, 0, 0, -0.7853982, -0.033333343, 0, 0, 0, 3.142, -0.041666668, 0.91629785, 0, 0),
|
||||||
"times": PackedFloat32Array(0, 0.3, 0.6, 0.888264, 1.2, 1.45)
|
"times": PackedFloat32Array(0, 0.3, 0.6, 0.888264, 1.2, 1.45)
|
||||||
}
|
}
|
||||||
tracks/3/type = "value"
|
tracks/2/type = "bezier"
|
||||||
tracks/3/imported = false
|
tracks/2/imported = false
|
||||||
tracks/3/enabled = true
|
tracks/2/enabled = true
|
||||||
tracks/3/path = NodePath("%texture/../hitbox2:disabled")
|
tracks/2/path = NodePath("anchor:scale:x")
|
||||||
tracks/3/interp = 1
|
tracks/2/interp = 1
|
||||||
tracks/3/loop_wrap = true
|
tracks/2/loop_wrap = true
|
||||||
tracks/3/keys = {
|
tracks/2/keys = {
|
||||||
"times": PackedFloat32Array(0, 0.8, 1),
|
|
||||||
"transitions": PackedFloat32Array(1, 1, 1),
|
|
||||||
"update": 1,
|
|
||||||
"values": [true, false, true]
|
|
||||||
}
|
|
||||||
tracks/4/type = "value"
|
|
||||||
tracks/4/imported = false
|
|
||||||
tracks/4/enabled = true
|
|
||||||
tracks/4/path = NodePath("%texture/../hitbox3:disabled")
|
|
||||||
tracks/4/interp = 1
|
|
||||||
tracks/4/loop_wrap = true
|
|
||||||
tracks/4/keys = {
|
|
||||||
"times": PackedFloat32Array(0, 1.2, 1.4, 1.45, 1.5),
|
|
||||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
|
|
||||||
"update": 1,
|
|
||||||
"values": [true, false, true, false, true]
|
|
||||||
}
|
|
||||||
tracks/5/type = "bezier"
|
|
||||||
tracks/5/imported = false
|
|
||||||
tracks/5/enabled = true
|
|
||||||
tracks/5/path = NodePath("anchor:scale:x")
|
|
||||||
tracks/5/interp = 1
|
|
||||||
tracks/5/loop_wrap = true
|
|
||||||
tracks/5/keys = {
|
|
||||||
"handle_modes": PackedInt32Array(0, 0),
|
"handle_modes": PackedInt32Array(0, 0),
|
||||||
"points": PackedFloat32Array(1, 0, 0, 0.2, 0, -1, 0, 0, 0, 0),
|
"points": PackedFloat32Array(1, 0, 0, 0.2, 0, -1, 0, 0, 0, 0),
|
||||||
"times": PackedFloat32Array(1.45, 1.7)
|
"times": PackedFloat32Array(1.45, 1.7)
|
||||||
}
|
}
|
||||||
tracks/6/type = "value"
|
tracks/3/type = "value"
|
||||||
tracks/6/imported = false
|
tracks/3/imported = false
|
||||||
tracks/6/enabled = true
|
tracks/3/enabled = true
|
||||||
tracks/6/path = NodePath("%texture/..:usingDamageMultiplier")
|
tracks/3/path = NodePath("%texture/..:usingDamageMultiplier")
|
||||||
tracks/6/interp = 1
|
tracks/3/interp = 1
|
||||||
tracks/6/loop_wrap = true
|
tracks/3/loop_wrap = true
|
||||||
tracks/6/keys = {
|
tracks/3/keys = {
|
||||||
"times": PackedFloat32Array(0, 0.6, 1.2, 1.45),
|
"times": PackedFloat32Array(0, 0.6, 1.2, 1.45),
|
||||||
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
||||||
"update": 1,
|
"update": 1,
|
||||||
"values": [0, 1, 2, 3]
|
"values": [0, 1, 2, 3]
|
||||||
}
|
}
|
||||||
tracks/7/type = "audio"
|
tracks/4/type = "audio"
|
||||||
tracks/7/imported = false
|
tracks/4/imported = false
|
||||||
tracks/7/enabled = true
|
tracks/4/enabled = true
|
||||||
tracks/7/path = NodePath("%textureSword/audio")
|
tracks/4/path = NodePath("%textureSword/audio")
|
||||||
tracks/7/interp = 1
|
tracks/4/interp = 1
|
||||||
tracks/7/loop_wrap = true
|
tracks/4/loop_wrap = true
|
||||||
tracks/7/keys = {
|
tracks/4/keys = {
|
||||||
"clips": [{
|
"clips": [{
|
||||||
"end_offset": 0.0,
|
"end_offset": 0.0,
|
||||||
"start_offset": 0.0,
|
"start_offset": 0.0,
|
||||||
@@ -219,14 +136,14 @@ tracks/7/keys = {
|
|||||||
}],
|
}],
|
||||||
"times": PackedFloat32Array(0, 0.6, 1.2, 1.45)
|
"times": PackedFloat32Array(0, 0.6, 1.2, 1.45)
|
||||||
}
|
}
|
||||||
tracks/7/use_blend = true
|
tracks/4/use_blend = true
|
||||||
tracks/8/type = "method"
|
tracks/5/type = "method"
|
||||||
tracks/8/imported = false
|
tracks/5/imported = false
|
||||||
tracks/8/enabled = true
|
tracks/5/enabled = true
|
||||||
tracks/8/path = NodePath("%texture/..")
|
tracks/5/path = NodePath("%texture/..")
|
||||||
tracks/8/interp = 1
|
tracks/5/interp = 1
|
||||||
tracks/8/loop_wrap = true
|
tracks/5/loop_wrap = true
|
||||||
tracks/8/keys = {
|
tracks/5/keys = {
|
||||||
"times": PackedFloat32Array(1.65),
|
"times": PackedFloat32Array(1.65),
|
||||||
"transitions": PackedFloat32Array(1),
|
"transitions": PackedFloat32Array(1),
|
||||||
"values": [{
|
"values": [{
|
||||||
@@ -234,18 +151,6 @@ tracks/8/keys = {
|
|||||||
"method": &"generateShadow"
|
"method": &"generateShadow"
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
tracks/9/type = "value"
|
|
||||||
tracks/9/imported = false
|
|
||||||
tracks/9/enabled = true
|
|
||||||
tracks/9/path = NodePath("%texture/../hitbox4:disabled")
|
|
||||||
tracks/9/interp = 1
|
|
||||||
tracks/9/loop_wrap = true
|
|
||||||
tracks/9/keys = {
|
|
||||||
"times": PackedFloat32Array(0, 1.7),
|
|
||||||
"transitions": PackedFloat32Array(1, 1),
|
|
||||||
"update": 1,
|
|
||||||
"values": [true, false]
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_w1utg"]
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_w1utg"]
|
||||||
_data = {
|
_data = {
|
||||||
@@ -254,18 +159,8 @@ _data = {
|
|||||||
&"spawn": SubResource("Animation_o5h0y")
|
&"spawn": SubResource("Animation_o5h0y")
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_w1utg"]
|
[sub_resource type="CircleShape2D" id="CircleShape2D_1sgli"]
|
||||||
size = Vector2(328, 34)
|
radius = 78.05767
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_w1utg"]
|
|
||||||
radius = 66.75
|
|
||||||
height = 322.0
|
|
||||||
|
|
||||||
[sub_resource type="CircleShape2D" id="CircleShape2D_w1utg"]
|
|
||||||
radius = 390.2512
|
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_6sp0s"]
|
|
||||||
size = Vector2(191, 66)
|
|
||||||
|
|
||||||
[node name="Volcano" instance=ExtResource("1_gd3m7")]
|
[node name="Volcano" instance=ExtResource("1_gd3m7")]
|
||||||
script = ExtResource("2_w1utg")
|
script = ExtResource("2_w1utg")
|
||||||
@@ -291,20 +186,13 @@ texture = ExtResource("2_wwxm2")
|
|||||||
|
|
||||||
[node name="audio" type="AudioStreamPlayer2D" parent="texture/anchor/textureSword" index="0"]
|
[node name="audio" type="AudioStreamPlayer2D" parent="texture/anchor/textureSword" index="0"]
|
||||||
|
|
||||||
[node name="hitbox" parent="." index="1"]
|
[node name="hitbox" parent="." index="1" node_paths=PackedStringArray("target")]
|
||||||
position = Vector2(412, 0)
|
position = Vector2(150, 0)
|
||||||
shape = SubResource("RectangleShape2D_w1utg")
|
rotation = 1.5707964
|
||||||
|
shape = SubResource("CircleShape2D_1sgli")
|
||||||
[node name="hitbox2" type="CollisionShape2D" parent="." index="2"]
|
script = ExtResource("7_1sgli")
|
||||||
position = Vector2(314, 0)
|
target = NodePath("../texture/anchor/textureSword")
|
||||||
shape = SubResource("CapsuleShape2D_w1utg")
|
offsetPosition = null
|
||||||
disabled = true
|
offsetRotation = 45.0
|
||||||
|
enablePosition = true
|
||||||
[node name="hitbox3" type="CollisionShape2D" parent="." index="3"]
|
enableRotation = true
|
||||||
shape = SubResource("CircleShape2D_w1utg")
|
|
||||||
disabled = true
|
|
||||||
|
|
||||||
[node name="hitbox4" type="CollisionShape2D" parent="." index="4"]
|
|
||||||
position = Vector2(308.5, -1)
|
|
||||||
shape = SubResource("RectangleShape2D_6sp0s")
|
|
||||||
disabled = true
|
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
[gd_scene load_steps=3 format=3 uid="uid://bjr2xwsjlka3l"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bcvuuy2m0pke0" path="res://components/Abstracts/EffectBase.tscn" id="1_ncu2n"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://bj0nwb3nxmtot" path="res://resources/sounds/effect/cut.mp3" id="2_8pjoy"]
|
||||||
|
|
||||||
|
[node name="SwordCut" instance=ExtResource("1_ncu2n")]
|
||||||
|
spawnSound = "spawn"
|
||||||
|
|
||||||
|
[node name="spawn" parent="sounds" index="0"]
|
||||||
|
stream = ExtResource("2_8pjoy")
|
||||||
Binary file not shown.
@@ -0,0 +1,19 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="mp3"
|
||||||
|
type="AudioStreamMP3"
|
||||||
|
uid="uid://bj0nwb3nxmtot"
|
||||||
|
path="res://.godot/imported/cut.mp3-1bfbc1fc5e5c87ac6972a4334d51c8c8.mp3str"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://resources/sounds/effect/cut.mp3"
|
||||||
|
dest_files=["res://.godot/imported/cut.mp3-1bfbc1fc5e5c87ac6972a4334d51c8c8.mp3str"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
loop=false
|
||||||
|
loop_offset=0
|
||||||
|
bpm=0
|
||||||
|
beat_count=0
|
||||||
|
bar_beats=4
|
||||||
@@ -9,16 +9,15 @@ var count: int = 0
|
|||||||
var dmg5: float = 0
|
var dmg5: float = 0
|
||||||
var splitAngle: float = 10
|
var splitAngle: float = 10
|
||||||
|
|
||||||
func register():
|
|
||||||
setupCuttable(0.7)
|
|
||||||
func ai():
|
func ai():
|
||||||
animator.speed_scale = launcher.fields.get(FieldStore.Entity.ATTACK_SPEED) * speedScale
|
|
||||||
PresetBulletAI.lockLauncher(self, launcher, true)
|
PresetBulletAI.lockLauncher(self, launcher, true)
|
||||||
rotation = lerp_angle(
|
rotation = lerp_angle(
|
||||||
rotation,
|
rotation,
|
||||||
position.angle_to_point(get_global_mouse_position()),
|
position.angle_to_point(get_global_mouse_position()),
|
||||||
rotates
|
rotates
|
||||||
)
|
)
|
||||||
|
func succeedToHit(_dmg: float, _entity: EntityBase):
|
||||||
|
EffectController.create(ComponentManager.getEffect("SwordCut"), textureSword.global_position).shot()
|
||||||
|
|
||||||
func generateShadow():
|
func generateShadow():
|
||||||
var startAngle = rotation - deg_to_rad(count * splitAngle / 2)
|
var startAngle = rotation - deg_to_rad(count * splitAngle / 2)
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
@tool
|
||||||
|
extends Node2D
|
||||||
|
|
||||||
|
@export var target: Node2D
|
||||||
|
@export var offsetPosition: Vector2 = Vector2.ZERO
|
||||||
|
@export var offsetRotation: float = 0.0
|
||||||
|
@export var enablePosition: bool = false
|
||||||
|
@export var enableRotation: bool = false
|
||||||
|
|
||||||
|
func _process(_delta):
|
||||||
|
if is_instance_valid(target):
|
||||||
|
if enablePosition:
|
||||||
|
global_position = target.global_position + offsetPosition
|
||||||
|
if enableRotation:
|
||||||
|
global_rotation = target.global_rotation + deg_to_rad(offsetRotation)
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://ckc6guqib3rno
|
||||||
Reference in New Issue
Block a user