Commit facbd426 authored by Gavin An's avatar Gavin An

좀비 몬스터 추가

parent 63afeb5e
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://ccymf4oxw0n0o"
path="res://.godot/imported/zombie.fbx-68cefc3925265829f5d1e7f43c8476e1.scn"
[deps]
source_file="res://assets/models/monsters/zombie/zombie.fbx"
dest_files=["res://.godot/imported/zombie.fbx-68cefc3925265829f5d1e7f43c8476e1.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://7l3pkmvxl4q8"
path.s3tc="res://.godot/imported/zombie_0.png-210634246bdb671c90ddb6d54fb7ca41.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={
"md5": "46eea9448c6458bd031f97a2517cbac0"
}
[deps]
source_file="res://assets/models/monsters/zombie/zombie_0.png"
dest_files=["res://.godot/imported/zombie_0.png-210634246bdb671c90ddb6d54fb7ca41.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -22,7 +22,7 @@ func _ready() -> void:
loop = true
# 자식 노드 중 3D 모델(noble_man 등) 노드 자동 탐색 및 초기화 (base_unit.gd 매커니즘 준수)
var model_names: Array[String] = ["noble_man"]
var model_names: Array[String] = ["noble_man", "zombie"]
var detected_model_node: Node3D = null
var detected_model_name: String = ""
......@@ -36,14 +36,16 @@ func _ready() -> void:
if detected_model_node:
_model_instance = detected_model_node
# GridMap 타일 높이(Y=0.21)에 맞춰 모델 및 충돌 판정 영역 오프셋 보정
_model_instance.position.y = 0.21
#GridMap 타일 높이(Y=0.21)에 맞춰 모델 및 충돌 판정 영역 오프셋 보정
#_model_instance.position.y = 0
var monster_area = get_node_or_null("MonsterArea")
if monster_area and monster_area is Node3D:
monster_area.position.y = 0.71
#if monster_area and monster_area is Node3D:
#monster_area.position.y = 0.71
if detected_model_name == "noble_man":
_apply_noble_man_skin(_model_instance)
elif detected_model_name == "zombie":
_apply_zombie_skin(_model_instance)
_model_anim_player = _find_animation_player(_model_instance)
if _model_anim_player:
......@@ -82,6 +84,21 @@ func _apply_noble_man_skin(node: Node) -> void:
for child: Node in node.get_children():
_apply_noble_man_skin(child)
## 몬스터 자식 메쉬에 zombie_0.png 텍스처를 입히는 재귀 함수
func _apply_zombie_skin(node: Node) -> void:
if node is MeshInstance3D:
var mesh_inst: MeshInstance3D = node as MeshInstance3D
var texture_path: String = "res://assets/models/monsters/zombie/zombie_0.png"
if ResourceLoader.exists(texture_path):
var texture: Texture2D = load(texture_path) as Texture2D
if texture:
var mat: StandardMaterial3D = StandardMaterial3D.new()
mat.albedo_texture = texture
mat.roughness = 0.5
mesh_inst.material_override = mat
for child: Node in node.get_children():
_apply_zombie_skin(child)
func _physics_process(delta: float) -> void:
if GameManager.is_game_over or is_dead:
......
[gd_scene format=3]
[ext_resource type="PackedScene" path="res://assets/models/monsters/zombie/zombie.fbx" id="1_fbx"]
[ext_resource type="AnimationLibrary" path="res://assets/models/monsters/zombie/zombie_animations.tres" id="2_anims"]
[node name="zombie" instance=ExtResource("1_fbx")]
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0, 0, 0)
[node name="AnimationPlayer" parent="." index="1"]
libraries/ = ExtResource("2_anims")
[gd_scene format=3 uid="uid://dfsvswt2g4422"]
[ext_resource type="Script" uid="uid://bj0j32wc3fvkg" path="res://src/entities/monsters/base_monster.gd" id="1_base_monster"]
[ext_resource type="PackedScene" path="res://src/entities/monsters/zombie/zombie.tscn" id="2_zombie"]
[sub_resource type="SphereShape3D" id="SphereShape3D_collision"]
radius = 0.6
[node name="ZombieMonster" type="PathFollow3D" unique_id=2142757208]
script = ExtResource("1_base_monster")
[node name="zombie" parent="." unique_id=1315610678 instance=ExtResource("2_zombie")]
[node name="MonsterArea" type="Area3D" parent="." unique_id=1682849627]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
[node name="CollisionShape3D" type="CollisionShape3D" parent="MonsterArea" unique_id=964107164]
shape = SubResource("SphereShape3D_collision")
[editable path="zombie"]
......@@ -114,9 +114,9 @@ func _on_spawn_pressed() -> void:
# 맵 중앙 스폰 존(0, 0) 기준 분산 스폰 좌표 지정
var spawn_offset: Vector3 = Vector3(
randf_range(-2.0, 2.0),
2.5,
randf_range(-2.0, 2.0)
randf_range(-2.0, 2.0),
1,
randf_range(-2.0, 2.0)
)
new_unit.set("unit_data", chosen_template)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment