Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
L
ldefense
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gavin An
ldefense
Commits
231d5a4f
Commit
231d5a4f
authored
Jul 21, 2026
by
Gavin An
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
데이터 정리 작업 전
parent
ce5387dc
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
135 additions
and
166 deletions
+135
-166
assets/models/items/weapons/rapier/rapier.tscn
assets/models/items/weapons/rapier/rapier.tscn
+1
-1
sandbox/units/warrior_fit_test.tscn
sandbox/units/warrior_fit_test.tscn
+3
-27
src/entities/units/base/base_unit.gd
src/entities/units/base/base_unit.gd
+53
-0
src/entities/units/base/unit_helper.gd
src/entities/units/base/unit_helper.gd
+0
-85
src/entities/units/guardian/guardian_unit.gd
src/entities/units/guardian/guardian_unit.gd
+9
-1
src/entities/units/guardian/guardian_unit.tscn
src/entities/units/guardian/guardian_unit.tscn
+0
-24
src/entities/units/hero/dwarf/dwarf_hero.gd
src/entities/units/hero/dwarf/dwarf_hero.gd
+11
-1
src/entities/units/mage/mage_unit.gd
src/entities/units/mage/mage_unit.gd
+4
-1
src/entities/units/ranger/ranger_unit.gd
src/entities/units/ranger/ranger_unit.gd
+11
-1
src/entities/units/striker/striker_unit.gd
src/entities/units/striker/striker_unit.gd
+9
-1
src/entities/units/warrior/lv1/warrior.tscn
src/entities/units/warrior/lv1/warrior.tscn
+24
-23
src/entities/units/warrior/warrior_unit.gd
src/entities/units/warrior/warrior_unit.gd
+10
-1
No files found.
assets/models/items/weapons/rapier/rapier.tscn
View file @
231d5a4f
...
...
@@ -3,7 +3,7 @@
[ext_resource type="PackedScene" uid="uid://chmkj4cj2pc1v" path="res://assets/models/items/weapons/rapier/rapier.glb" id="1_e4kwr"]
[node name="rapier" unique_id=795567087 instance=ExtResource("1_e4kwr")]
transform = Transform3D(-
25, 0, -2.1855694e-06, 0, 25, 0, 2.1855694e-06, 0, -25
, 0, 15, 0)
transform = Transform3D(-
30, 0, -2.6226833e-06, 0, 30, 0, 2.6226833e-06, 0, -30
, 0, 15, 0)
[node name="Mesh1_0" parent="." index="0" unique_id=609425921]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.08045673, 0)
sandbox/units/warrior_fit_test.tscn
View file @
231d5a4f
...
...
@@ -41,36 +41,12 @@ mesh = SubResource("TorusMesh_dx6da")
[node name="warrior" parent="." unique_id=1583845935 instance=ExtResource("1_gy7ce")]
[node name="Skeleton3D" parent="warrior/Armature" parent_id_path=PackedInt32Array(1583845935, 1364558243) index="0" unique_id=869110456]
bones/0/position = Vector3(-1.910276, 33.06552, 3.5636556)
bones/0/rotation = Quaternion(0.28815937, -0.48399922, 0.004976633, 0.8262471)
bones/1/rotation = Quaternion(0.5620965, 0.24640833, -0.5738231, 0.54227066)
bones/2/rotation = Quaternion(0.42321578, 0.052586436, 0.06714515, 0.9020059)
bones/3/rotation = Quaternion(-0.42186385, -0.18076968, -0.09782138, 0.8830539)
bones/4/rotation = Quaternion(-0.3672295, -0.11379034, -0.009377396, 0.92309606)
bones/5/rotation = Quaternion(0.87915325, -0.055501558, 0.15420589, 0.44747052)
bones/6/rotation = Quaternion(0.4259057, -0.05401285, -0.062089335, 0.9010171)
bones/7/rotation = Quaternion(-0.55740386, 0.19286433, -0.07460873, 0.8040759)
bones/8/rotation = Quaternion(-0.37955156, 0.10612711, 0.006433723, 0.919041)
bones/9/rotation = Quaternion(-0.04820835, 0.035868984, 0.03551153, 0.9975612)
bones/10/rotation = Quaternion(0.063555084, -0.005556316, -0.021568177, 0.9977298)
bones/11/rotation = Quaternion(-0.026126284, 0.00060771336, -0.0020700088, 0.9996564)
bones/12/rotation = Quaternion(0.594939, 0.51989836, -0.41137588, 0.45444834)
bones/13/rotation = Quaternion(0.3044257, 0.07226572, -0.02087591, 0.9495615)
bones/14/rotation = Quaternion(-0.34638062, -0.15226349, 0.21833093, 0.8995377)
bones/15/rotation = Quaternion(0.022922574, -0.27042493, 0.27432233, 0.92254657)
bones/16/rotation = Quaternion(-0.6291889, 0.48313388, -0.41592285, -0.4446473)
bones/17/rotation = Quaternion(0.36964628, -0.18361838, -0.21041645, 0.8862115)
bones/18/rotation = Quaternion(-0.22914784, 0.13075422, -0.07788659, 0.96142)
bones/19/rotation = Quaternion(-0.008124485, -0.44720575, 0.055150583, 0.8926922)
bones/20/rotation = Quaternion(-0.11569695, 0.18120818, -0.018436808, 0.97644156)
bones/21/rotation = Quaternion(0.25444955, 0.262842, -0.117302336, 0.9232604)
[node name="BoneAttachment3D" type="BoneAttachment3D" parent="warrior/Armature/Skeleton3D" index="1" unique_id=275485168]
transform = Transform3D(0.41003728, -0.62528366, 0.66399515, -0.86364996, -0.5002318, 0.062262803, 0.2932194, -0.59899, -0.74513996, -18.67469, 37.884716, -12.241171)
[node name="BoneAttachment3D" type="BoneAttachment3D" parent="warrior/Armature/Skeleton3D" parent_id_path=PackedInt32Array(1583845935, 869110456) index="1" unique_id=275485168]
transform = Transform3D(0.4100439, -0.6252991, 0.6639764, -0.86364293, -0.5002463, 0.06224379, 0.2932307, -0.5989617, -0.7451581, -18.670631, 37.889347, -12.24264)
bone_name = "RightHand"
bone_idx = 19
[node name="rapier" parent="warrior/Armature/Skeleton3D/BoneAttachment3D" unique_id=795567087 instance=ExtResource("2_gy7ce")]
transform = Transform3D(-30, 0, -4.529874e-06, 0, 40, 0, 4.529874e-06, 0, -30, 0, 25, 0)
[editable path="warrior"]
src/entities/units/base/base_unit.gd
View file @
231d5a4f
...
...
@@ -447,6 +447,59 @@ func _update_animations() -> void:
func
_setup_unit_visuals
()
->
void
:
pass
## 자식 클래스가 제공한 무기 설정에 따라 해당 본에 무기 모델을 런타임 장착합니다.
func
attach_weapon
(
model_instance
:
Node3D
)
->
void
:
if
not
model_instance
:
return
var
skeleton
:
Skeleton3D
=
UnitHelper
.
find_skeleton
(
model_instance
)
if
not
skeleton
:
return
var
weapon_config
:
Dictionary
=
_get_weapon_config
()
if
weapon_config
.
is_empty
():
return
var
bone_name
:
String
=
weapon_config
.
get
(
"bone_name"
,
"RightHand"
)
var
attachment_name
:
String
=
weapon_config
.
get
(
"attachment_name"
,
"RightHandAttachment"
)
var
weapon_scene_path
:
String
=
weapon_config
.
get
(
"weapon_scene_path"
,
""
)
var
texture_path
:
String
=
weapon_config
.
get
(
"texture_path"
,
""
)
var
weapon_scale
:
Vector3
=
weapon_config
.
get
(
"weapon_scale"
,
Vector3
.
ONE
)
var
weapon_rotation
:
Vector3
=
weapon_config
.
get
(
"weapon_rotation"
,
Vector3
.
ZERO
)
var
weapon_position
:
Vector3
=
weapon_config
.
get
(
"weapon_position"
,
Vector3
.
ZERO
)
var
preserve_scene_transform
:
bool
=
weapon_config
.
get
(
"preserve_scene_transform"
,
false
)
if
weapon_scene_path
==
""
:
return
var
bone_idx
:
int
=
skeleton
.
find_bone
(
bone_name
)
if
bone_idx
==
-
1
:
return
var
existing_attachment
:
Node
=
skeleton
.
get_node_or_null
(
attachment_name
)
if
existing_attachment
:
existing_attachment
.
queue_free
()
var
bone_attachment
:
BoneAttachment3D
=
BoneAttachment3D
.
new
()
bone_attachment
.
name
=
attachment_name
bone_attachment
.
bone_name
=
bone_name
skeleton
.
add_child
(
bone_attachment
)
if
ResourceLoader
.
exists
(
weapon_scene_path
):
var
weapon_scene
:
PackedScene
=
load
(
weapon_scene_path
)
as
PackedScene
if
weapon_scene
:
var
weapon_inst
:
Node3D
=
weapon_scene
.
instantiate
()
as
Node3D
if
not
preserve_scene_transform
:
weapon_inst
.
scale
=
weapon_scale
weapon_inst
.
rotation_degrees
=
weapon_rotation
weapon_inst
.
position
=
weapon_position
UnitHelper
.
apply_skin
(
weapon_inst
,
texture_path
)
bone_attachment
.
add_child
(
weapon_inst
)
## 자식 클래스에서 무기 본/씬/텍스처/오프셋을 반환합니다.
func
_get_weapon_config
()
->
Dictionary
:
return
{}
## 원거리 유닛의 발사체 생성을 처리하는 가상 함수
func
_spawn_projectile
(
_fire_position
:
Vector3
)
->
void
:
pass
...
...
src/entities/units/base/unit_helper.gd
View file @
231d5a4f
...
...
@@ -44,91 +44,6 @@ static func find_skeleton(node: Node) -> Skeleton3D:
return
res
return
null
## 유닛 종류에 따라 해당 본에 무기 모델을 런타임 장착
static
func
attach_weapon
(
model_instance
:
Node3D
,
unit_data
:
UnitData
)
->
void
:
if
not
model_instance
or
not
unit_data
:
return
# 스켈레톤 노드 탐색
var
skeleton
:
Skeleton3D
=
find_skeleton
(
model_instance
)
if
not
skeleton
:
return
# 유닛 종류에 따른 무기 설정 분기
var
bone_name
:
String
=
"RightHand"
var
attachment_name
:
String
=
"RightHandAttachment"
var
weapon_scene_path
:
String
=
""
var
weapon_scale
:
Vector3
=
Vector3
.
ONE
var
weapon_rotation
:
Vector3
=
Vector3
.
ZERO
var
weapon_position
:
Vector3
=
Vector3
.
ZERO
var
texture_path
:
String
=
""
var
unit_id
=
unit_data
.
unit_id
if
unit_id
==
"Unit_Guardian"
:
# 가디언: 오른손에 창 (azure_spear)
bone_name
=
"RightHand"
attachment_name
=
"RightHandAttachment"
weapon_scene_path
=
"res://assets/models/items/weapons/azure_spear/azure_spear.glb"
texture_path
=
"res://assets/models/items/weapons/azure_spear/azure_spear_0.png"
elif
unit_id
==
"Unit_Striker"
:
# 스트라이커: 오른손에 검 (azure_blade)
bone_name
=
"RightHand"
attachment_name
=
"RightHandAttachment"
weapon_scene_path
=
"res://assets/models/items/weapons/azure_blade/azure_blade.glb"
texture_path
=
"res://assets/models/items/weapons/azure_blade/azure_blade_0.png"
elif
unit_id
==
"Unit_Warrior_Lv1"
:
# 워리어 Lv1: 오른손에 검 (azure_blade)
bone_name
=
"RightHand"
attachment_name
=
"RightHandAttachment"
weapon_scene_path
=
"res://assets/models/items/weapons/azure_blade/azure_blade.glb"
texture_path
=
"res://assets/models/items/weapons/azure_blade/azure_blade_0.png"
elif
unit_id
==
"Unit_Ranger"
:
# 레인저: 왼손에 활 (azure_bow/bow)
bone_name
=
"LeftHand"
attachment_name
=
"LeftHandAttachment"
weapon_scene_path
=
"res://assets/models/items/weapons/azure_bow/bow.glb"
texture_path
=
"res://assets/models/items/weapons/azure_bow/bow_0.jpg"
# 활을 왼손에 자연스럽게 맞추는 회전/위치 오프셋
weapon_rotation
=
Vector3
(
0.0
,
90.0
,
0.0
)
weapon_scale
=
Vector3
(
0.8
,
0.8
,
0.8
)
elif
unit_id
==
"Hero_Dwarf"
:
# 드워프: 오른손에 도끼 (orcish_axe)
bone_name
=
"RightHand"
attachment_name
=
"RightHandAttachment"
weapon_scene_path
=
"res://assets/models/items/weapons/orcish_axe/orcish_axe.glb"
texture_path
=
"res://assets/models/items/weapons/orcish_axe/orcish_axe_Baked_BaseColor.png"
# 도끼를 오른손에 자연스럽게 맞추는 회전/위치 오프셋
weapon_position
=
Vector3
(
-
0.05
,
0.085
,
-
0.75
)
weapon_rotation
=
Vector3
(
31
,
165
,
135
)
# 지정된 본이 존재하는지 확인
var
bone_idx
:
int
=
skeleton
.
find_bone
(
bone_name
)
if
bone_idx
==
-
1
:
return
# 이미 장착된 무기가 있는지 확인하여 제거 (중복 장착 방지)
var
existing_attachment
:
Node
=
skeleton
.
get_node_or_null
(
attachment_name
)
if
existing_attachment
:
existing_attachment
.
queue_free
()
# BoneAttachment3D 노드 동적 생성 및 본 동기화 설정
var
bone_attachment
:
BoneAttachment3D
=
BoneAttachment3D
.
new
()
bone_attachment
.
name
=
attachment_name
bone_attachment
.
bone_name
=
bone_name
skeleton
.
add_child
(
bone_attachment
)
# 무기 로드 및 인스턴스화
if
ResourceLoader
.
exists
(
weapon_scene_path
):
var
weapon_scene
:
PackedScene
=
load
(
weapon_scene_path
)
as
PackedScene
if
weapon_scene
:
var
weapon_inst
:
Node3D
=
weapon_scene
.
instantiate
()
as
Node3D
weapon_inst
.
scale
=
weapon_scale
weapon_inst
.
rotation_degrees
=
weapon_rotation
weapon_inst
.
position
=
weapon_position
# 무기 텍스처 매핑
apply_skin
(
weapon_inst
,
texture_path
)
bone_attachment
.
add_child
(
weapon_inst
)
## 모델 스켈레톤에서 특정 BoneAttachment3D 노드를 반환 (발사 위치 계산 등 외부 활용)
static
func
get_bone_attachment
(
model_instance
:
Node3D
,
attachment_name
:
String
)
->
BoneAttachment3D
:
var
skeleton
:
Skeleton3D
=
find_skeleton
(
model_instance
)
...
...
src/entities/units/guardian/guardian_unit.gd
View file @
231d5a4f
...
...
@@ -18,7 +18,7 @@ func _setup_unit_visuals() -> void:
# 가디언 스킨 및 무기 결합
UnitHelper
.
apply_skin
(
_model_instance
,
"res://assets/models/units/guardian/guardian_0.png"
)
UnitHelper
.
attach_weapon
(
_model_instance
,
unit_data
)
attach_weapon
(
_model_instance
)
# 애니메이션 플레이어 및 라이브러리 연동
_model_anim_player
=
UnitHelper
.
find_animation_player
(
_model_instance
)
...
...
@@ -37,6 +37,14 @@ func _setup_unit_visuals() -> void:
func
_get_attack_animation_name
(
_model_name
:
String
)
->
String
:
return
_model_name
+
"/"
+
GUARDIAN_ATTACK_ANIM
func
_get_weapon_config
()
->
Dictionary
:
return
{
"bone_name"
:
"RightHand"
,
"attachment_name"
:
"RightHandAttachment"
,
"weapon_scene_path"
:
"res://assets/models/items/weapons/azure_spear/azure_spear.glb"
,
"texture_path"
:
"res://assets/models/items/weapons/azure_spear/azure_spear_0.png"
}
## 가디언 애니메이션 갱신 제어
func
_update_animations
()
->
void
:
if
not
_model_anim_player
:
...
...
src/entities/units/guardian/guardian_unit.tscn
View file @
231d5a4f
...
...
@@ -42,28 +42,4 @@ mesh = SubResource("TorusMesh_selection")
[node name="guardian" parent="." unique_id=1303946976 instance=ExtResource("2_y84tp")]
[node name="Skeleton3D" parent="guardian/Armature" parent_id_path=PackedInt32Array(1303946976, 1897227020) index="0" unique_id=693633454]
bones/0/position = Vector3(0.007254056, -0.031982094, 0.8454071)
bones/0/rotation = Quaternion(0.16432424, 0.019133193, 0.87338674, -0.45806903)
bones/1/rotation = Quaternion(-0.12092076, -0.7872979, 0.4819965, 0.36499256)
bones/2/rotation = Quaternion(0.33750388, 0.025897268, 0.017135011, 0.9408119)
bones/3/rotation = Quaternion(-0.5022115, -0.02807892, 0.08618891, 0.8599806)
bones/4/rotation = Quaternion(-0.44314563, -0.035939246, 0.0013848549, 0.89572793)
bones/5/rotation = Quaternion(-0.5774472, -0.36547333, 0.5146526, 0.5178)
bones/6/rotation = Quaternion(0.3062435, -0.047538485, -0.037762463, 0.9500153)
bones/7/rotation = Quaternion(-0.5316294, -0.011670036, -0.10949787, 0.8397882)
bones/9/rotation = Quaternion(0.5004455, 0.5472967, 0.57435375, 0.34660998)
bones/10/rotation = Quaternion(0.054661293, 0.03426229, 0.026580319, 0.9975629)
bones/11/rotation = Quaternion(-0.04221783, -0.0024180731, 0.0061295675, 0.99908674)
bones/12/rotation = Quaternion(0.47379175, 0.6155848, -0.45582765, 0.43450877)
bones/13/rotation = Quaternion(0.50110704, 0.44870365, 0.113574795, 0.7312028)
bones/14/rotation = Quaternion(-0.13031836, -0.12740694, 0.12649705, 0.97508115)
bones/15/rotation = Quaternion(-0.028026814, -0.05217199, 0.03683791, 0.9975649)
bones/16/rotation = Quaternion(-0.48288807, 0.6040217, -0.4048437, -0.48793295)
bones/17/rotation = Quaternion(0.53795695, -0.1486786, -0.09833834, 0.82390934)
bones/18/rotation = Quaternion(-0.20201011, 0.2213894, -0.45648777, 0.8377337)
bones/19/rotation = Quaternion(0.04524021, -0.32150194, 0.08227339, 0.94224256)
bones/20/rotation = Quaternion(0.036245007, 0.071046256, 0.024107164, 0.9965228)
bones/21/rotation = Quaternion(0.37537965, 0.030331533, -0.03659956, 0.9256515)
[editable path="guardian"]
src/entities/units/hero/dwarf/dwarf_hero.gd
View file @
231d5a4f
...
...
@@ -43,7 +43,7 @@ func _setup_unit_visuals() -> void:
# 드워프 영웅 전용 스킨 이미지와 무기 메쉬를 결합합니다.
UnitHelper
.
apply_skin
(
_model_instance
,
"res://assets/models/hero/dwarf/dwarf_0.png"
)
UnitHelper
.
attach_weapon
(
_model_instance
,
unit_data
)
attach_weapon
(
_model_instance
)
# dwarf.fbx 내에 내장된 AnimationPlayer 노드를 캐싱합니다.
_model_anim_player
=
UnitHelper
.
find_animation_player
(
_model_instance
)
...
...
@@ -52,6 +52,16 @@ func _setup_unit_visuals() -> void:
func
_get_attack_animation_name
(
_model_name
:
String
)
->
String
:
return
DWARF_ATTACK_ANIM
func
_get_weapon_config
()
->
Dictionary
:
return
{
"bone_name"
:
"RightHand"
,
"attachment_name"
:
"RightHandAttachment"
,
"weapon_scene_path"
:
"res://assets/models/items/weapons/orcish_axe/orcish_axe.glb"
,
"texture_path"
:
"res://assets/models/items/weapons/orcish_axe/orcish_axe_Baked_BaseColor.png"
,
"weapon_position"
:
Vector3
(
-
0.05
,
0.085
,
-
0.75
),
"weapon_rotation"
:
Vector3
(
31
,
165
,
135
)
}
## 드워프 Attack 클립은 길이가 길어 공통 계산보다 짧은 락 비율로 보정합니다.
func
_get_attack_lock_duration
(
_anim_length
:
float
,
_play_speed
:
float
)
->
float
:
return
_get_dwarf_attack_lock_duration
()
...
...
src/entities/units/mage/mage_unit.gd
View file @
231d5a4f
...
...
@@ -24,7 +24,7 @@ func _setup_unit_visuals() -> void:
# UnitHelper를 활용해 마법사 전용 스킨 이미지와 무기 메쉬를 결합합니다.
UnitHelper
.
apply_skin
(
_model_instance
,
"res://assets/models/units/mage/mage_0.png"
)
UnitHelper
.
attach_weapon
(
_model_instance
,
unit_data
)
attach_weapon
(
_model_instance
)
# 모델 씬 내부에 구성되어 있는 AnimationPlayer 노드를 탐색하여 변수에 캐싱합니다.
_model_anim_player
=
UnitHelper
.
find_animation_player
(
_model_instance
)
...
...
@@ -48,6 +48,9 @@ func _setup_unit_visuals() -> void:
func
_get_attack_animation_name
(
_model_name
:
String
)
->
String
:
return
_model_name
+
"/"
+
MAGE_ATTACK_ANIM
func
_get_weapon_config
()
->
Dictionary
:
return
{}
## 매 프레임 물리에 맞추어 마법사 유닛의 애니메이션 상태를 제어하는 함수
func
_update_animations
()
->
void
:
if
not
_model_anim_player
:
...
...
src/entities/units/ranger/ranger_unit.gd
View file @
231d5a4f
...
...
@@ -18,7 +18,7 @@ func _setup_unit_visuals() -> void:
# 레인저 스킨 및 무기 결합
UnitHelper
.
apply_skin
(
_model_instance
,
"res://assets/models/units/ranger/ranger_0.png"
)
UnitHelper
.
attach_weapon
(
_model_instance
,
unit_data
)
attach_weapon
(
_model_instance
)
# 애니메이션 플레이어 및 라이브러리 연동
_model_anim_player
=
UnitHelper
.
find_animation_player
(
_model_instance
)
...
...
@@ -37,6 +37,16 @@ func _setup_unit_visuals() -> void:
func
_get_attack_animation_name
(
_model_name
:
String
)
->
String
:
return
_model_name
+
"/"
+
RANGER_ATTACK_ANIM
func
_get_weapon_config
()
->
Dictionary
:
return
{
"bone_name"
:
"LeftHand"
,
"attachment_name"
:
"LeftHandAttachment"
,
"weapon_scene_path"
:
"res://assets/models/items/weapons/azure_bow/bow.glb"
,
"texture_path"
:
"res://assets/models/items/weapons/azure_bow/bow_0.jpg"
,
"weapon_rotation"
:
Vector3
(
0.0
,
90.0
,
0.0
),
"weapon_scale"
:
Vector3
(
0.8
,
0.8
,
0.8
)
}
## 레인저 애니메이션 갱신 제어 (Draw 애니메이션 적용)
func
_update_animations
()
->
void
:
if
not
_model_anim_player
:
...
...
src/entities/units/striker/striker_unit.gd
View file @
231d5a4f
...
...
@@ -18,7 +18,7 @@ func _setup_unit_visuals() -> void:
# 스트라이커 스킨 및 무기 결합 (원래 striker 스킨 경로는 units/striker_0.png 이었음)
UnitHelper
.
apply_skin
(
_model_instance
,
"res://assets/models/units/striker_0.png"
)
UnitHelper
.
attach_weapon
(
_model_instance
,
unit_data
)
attach_weapon
(
_model_instance
)
# 애니메이션 플레이어 및 라이브러리 연동
_model_anim_player
=
UnitHelper
.
find_animation_player
(
_model_instance
)
...
...
@@ -37,6 +37,14 @@ func _setup_unit_visuals() -> void:
func
_get_attack_animation_name
(
_model_name
:
String
)
->
String
:
return
_model_name
+
"/"
+
STRIKER_ATTACK_ANIM
func
_get_weapon_config
()
->
Dictionary
:
return
{
"bone_name"
:
"RightHand"
,
"attachment_name"
:
"RightHandAttachment"
,
"weapon_scene_path"
:
"res://assets/models/items/weapons/azure_blade/azure_blade.glb"
,
"texture_path"
:
"res://assets/models/items/weapons/azure_blade/azure_blade_0.png"
}
## 스트라이커 애니메이션 갱신 제어
func
_update_animations
()
->
void
:
if
not
_model_anim_player
:
...
...
src/entities/units/warrior/lv1/warrior.tscn
View file @
231d5a4f
...
...
@@ -4,35 +4,36 @@
[ext_resource type="AnimationLibrary" uid="uid://bfq5qy0qjjddl" path="res://assets/models/units/warrior/warrior_anim.tres" id="2_warrior_anim"]
[node name="warrior" unique_id=1583845935 instance=ExtResource("1_warrior_glb")]
transform = Transform3D(-1.5, 0, -1.3113416e-07, 0, 1.5, 0, 1.3113416e-07, 0, -1.5, 0, 0, 0)
[node name="Skeleton3D" parent="Armature" parent_id_path=PackedInt32Array(1364558243) index="0" unique_id=869110456]
bones/0/position = Vector3(-1.
8957187, 33.07651, 3.5549679
)
bones/0/rotation = Quaternion(0.288
40318, -0.48382437, 0.0051577403, 0.82626325
)
bones/1/rotation = Quaternion(0.56
08467, 0.25128442, -0.5771154, 0.5378151
)
bones/2/rotation = Quaternion(0.42
508098, 0.055743374, 0.069278166, 0.90077716
)
bones/3/rotation = Quaternion(-0.42
340666, -0.18196306, -0.092208266, 0.8826742
)
bones/4/rotation = Quaternion(-0.3672
0493, -0.1137675, -0.009153196, 0.9231109
)
bones/5/rotation = Quaternion(0.8
800668, -0.053816516, 0.15393856, 0.44597006
)
bones/6/rotation = Quaternion(0.4259
996, -0.053426526, -0.061801143, 0.90102756
)
bones/7/rotation = Quaternion(-0.55
9434, 0.19220398, -0.073773555, 0.80290025
)
bones/8/rotation = Quaternion(-0.3795
891, 0.10611948, 0.006425505, 0.9190264
)
bones/9/rotation = Quaternion(-0.048
394125, 0.035671085, 0.035490535, 0.99756
)
bones/10/rotation = Quaternion(0.0635
35295, -0.0055522784, -0.021565579, 0.9977311
)
bones/11/rotation = Quaternion(-0.0261
43814, 0.0006061874, -0.002062838, 0.9996559
)
bones/12/rotation = Quaternion(0.59
51339, 0.5195713, -0.41118684, 0.45473802
)
bones/13/rotation = Quaternion(0.304
53014, 0.072075136, -0.021144342, 0.949536
5)
bones/0/position = Vector3(-1.
910276, 33.06552, 3.5636556
)
bones/0/rotation = Quaternion(0.288
15937, -0.48399922, 0.004976633, 0.8262471
)
bones/1/rotation = Quaternion(0.56
20965, 0.24640833, -0.5738231, 0.54227066
)
bones/2/rotation = Quaternion(0.42
321578, 0.052586436, 0.06714515, 0.9020059
)
bones/3/rotation = Quaternion(-0.42
186385, -0.18076968, -0.09782138, 0.8830539
)
bones/4/rotation = Quaternion(-0.3672
295, -0.11379034, -0.009377396, 0.92309606
)
bones/5/rotation = Quaternion(0.8
7915325, -0.055501558, 0.15420589, 0.44747052
)
bones/6/rotation = Quaternion(0.4259
057, -0.05401285, -0.062089335, 0.9010171
)
bones/7/rotation = Quaternion(-0.55
740386, 0.19286433, -0.07460873, 0.8040759
)
bones/8/rotation = Quaternion(-0.3795
5156, 0.10612711, 0.006433723, 0.919041
)
bones/9/rotation = Quaternion(-0.048
20835, 0.035868984, 0.03551153, 0.9975612
)
bones/10/rotation = Quaternion(0.0635
55084, -0.005556316, -0.021568177, 0.9977298
)
bones/11/rotation = Quaternion(-0.0261
26284, 0.00060771336, -0.0020700088, 0.9996564
)
bones/12/rotation = Quaternion(0.59
4939, 0.51989836, -0.41137588, 0.45444834
)
bones/13/rotation = Quaternion(0.304
4257, 0.07226572, -0.02087591, 0.949561
5)
bones/14/position = Vector3(5.990729e-06, 11.568957, 2.0486332e-06)
bones/14/rotation = Quaternion(-0.346
40756, -0.15221387, 0.21824688, 0.89955604
)
bones/15/rotation = Quaternion(0.0229
10133, -0.27039415, 0.27428424, 0.92256725
)
bones/14/rotation = Quaternion(-0.346
38062, -0.15226349, 0.21833093, 0.8995377
)
bones/15/rotation = Quaternion(0.0229
22574, -0.27042493, 0.27432233, 0.92254657
)
bones/16/position = Vector3(-2.2237325, 1.1260277, -0.28097144)
bones/16/rotation = Quaternion(-0.629
3668, 0.4828456, -0.4157187, -0.4448994
)
bones/17/rotation = Quaternion(0.369
76418, -0.1834297, -0.21005684, 0.88628674
)
bones/16/rotation = Quaternion(-0.629
1889, 0.48313388, -0.41592285, -0.4446473
)
bones/17/rotation = Quaternion(0.369
64628, -0.18361838, -0.21041645, 0.8862115
)
bones/18/position = Vector3(7.0502997e-06, 11.568421, -2.0685693e-06)
bones/18/rotation = Quaternion(-0.22914
876, 0.13075821, -0.077887446, 0.9614191
)
bones/18/rotation = Quaternion(-0.22914
784, 0.13075422, -0.07788659, 0.96142
)
bones/19/position = Vector3(1.6717445e-07, 8.329648, 1.0820704e-06)
bones/19/rotation = Quaternion(-0.008124
578, -0.447201, 0.055160116, 0.8926941
)
bones/20/rotation = Quaternion(-0.115
765184, 0.18120801, -0.018444315, 0.9764332
)
bones/21/rotation = Quaternion(0.2544
9044, 0.26282075, -0.11730443, 0.9232549
)
bones/19/rotation = Quaternion(-0.008124
485, -0.44720575, 0.055150583, 0.8926922
)
bones/20/rotation = Quaternion(-0.115
69695, 0.18120818, -0.018436808, 0.97644156
)
bones/21/rotation = Quaternion(0.2544
4955, 0.262842, -0.117302336, 0.9232604
)
bones/22/rotation = Quaternion(-0.17588644, 9.691889e-06, 2.6466496e-05, 0.9844105)
bones/23/rotation = Quaternion(0.5060229, -6.436132e-06, 7.619528e-05, 0.86252004)
...
...
src/entities/units/warrior/warrior_unit.gd
View file @
231d5a4f
...
...
@@ -15,7 +15,7 @@ func _setup_unit_visuals() -> void:
_model_instance
=
node
UnitHelper
.
apply_skin
(
_model_instance
,
"res://assets/models/units/warrior/lv1/warrior_texture_0.png"
)
UnitHelper
.
attach_weapon
(
_model_instance
,
unit_data
)
attach_weapon
(
_model_instance
)
_model_anim_player
=
UnitHelper
.
find_animation_player
(
_model_instance
)
if
_model_anim_player
:
...
...
@@ -32,6 +32,15 @@ func _setup_unit_visuals() -> void:
func
_get_attack_animation_name
(
_model_name
:
String
)
->
String
:
return
MODEL_NAME
+
"/"
+
WARRIOR_ATTACK_ANIM
func
_get_weapon_config
()
->
Dictionary
:
return
{
"bone_name"
:
"RightHand"
,
"attachment_name"
:
"RightHandAttachment"
,
"weapon_scene_path"
:
"res://assets/models/items/weapons/rapier/rapier.tscn"
,
"texture_path"
:
"res://assets/models/items/weapons/rapier/rapier_Baked_BaseColor.png"
,
"preserve_scene_transform"
:
true
}
func
_update_animations
()
->
void
:
if
not
_model_anim_player
:
return
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment