데이터파이프라인 타워 부분 개선

This commit is contained in:
2026-02-01 11:31:50 +09:00
parent 9d870625ce
commit fe046611b0
43 changed files with 2181 additions and 45 deletions

View File

@@ -0,0 +1,52 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8c40fef5ebc37b743a3f225c1ca57c32, type: 3}
m_Name: Tower1
m_EditorClassIdentifier: Assembly-CSharp::Northbound.Data.TowerData
buildingName: "\uD0C0\uC6CC"
prefab: {fileID: 8512676738329978770, guid: 3f7838db2c2fc424d9bd9a0d243b43be, type: 3}
icon: {fileID: 0}
width: 3
length: 3
height: 4
placementOffset: {x: 0, y: 0, z: 0}
allowRotation: 1
requiredWorkAmount: 10
workPerInteraction: 10
interactionCooldown: 1
constructionAnimationTrigger: Build
constructionEquipment:
socketName: RightHand
equipmentPrefab: {fileID: 0}
attachOnStart: 1
detachOnEnd: 1
keepEquipped: 0
attachDelay: 0
detachDelay: 0
maxHealth: 50
isIndestructible: 0
autoRegenerate: 0
regenPerSecond: 1
providesVision: 1
visionRange: 10
id: 1
memo: "\uD0C0\uC6CC"
mana: 25
manpower: 10
sizeX: 3
sizeY: 3
sizeZ: 3
maxHp: 50
atkRange: 10
atkDamage: 5
atkIntervalSec: 2
modelPath: Assets/Models/building_tower_B_blue.fbx

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3e2e145df85a3ee4eb615f87efba4554
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,52 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8c40fef5ebc37b743a3f225c1ca57c32, type: 3}
m_Name: Tower2
m_EditorClassIdentifier: Assembly-CSharp::Northbound.Data.TowerData
buildingName: "\uBCBD"
prefab: {fileID: 3671057791414486316, guid: ae9a9b515e1792a45887f0d967b943d6, type: 3}
icon: {fileID: 0}
width: 2
length: 1
height: 4
placementOffset: {x: 0, y: 0, z: 0}
allowRotation: 1
requiredWorkAmount: 5
workPerInteraction: 10
interactionCooldown: 1
constructionAnimationTrigger: Build
constructionEquipment:
socketName: RightHand
equipmentPrefab: {fileID: 0}
attachOnStart: 1
detachOnEnd: 1
keepEquipped: 0
attachDelay: 0
detachDelay: 0
maxHealth: 30
isIndestructible: 0
autoRegenerate: 0
regenPerSecond: 1
providesVision: 1
visionRange: 0
id: 2
memo: "\uBCBD"
mana: 5
manpower: 5
sizeX: 2
sizeY: 2
sizeZ: 1
maxHp: 30
atkRange: 0
atkDamage: 0
atkIntervalSec: 0
modelPath: Assets/Models/wall_straight.fbx

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 03a521eb1160745439ba2d0efeb12f3c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -3,11 +3,12 @@
using UnityEngine;
using System.Collections.Generic; // 리스트 지원을 위해 추가
using Northbound;
namespace Northbound.Data
{
[CreateAssetMenu(fileName = "TowerData", menuName = "Northbound/Tower Data")]
public class TowerData : ScriptableObject
public class TowerData : BuildingData
{
[Header("기본 정보")]
/// <summary>고유 ID</summary>
@@ -22,6 +23,8 @@ namespace Northbound.Data
public int sizeX;
/// <summary>Y 그리드 차지 공간</summary>
public int sizeY;
/// <summary>Z 차지 공간</summary>
public int sizeZ;
/// <summary>체력</summary>
public int maxHp;
/// <summary>사정거리</summary>
@@ -30,8 +33,40 @@ namespace Northbound.Data
public int atkDamage;
/// <summary>공격 주기</summary>
public float atkIntervalSec;
/// <summary>프리팹/리소스 경로</summary>
public string prefabPath;
/// <summary>모델 경로</summary>
public string modelPath;
private bool fieldsSynced = false;
private void Awake()
{
SyncFields();
}
private void SyncFields()
{
if (fieldsSynced) return;
fieldsSynced = true;
// Map TowerData fields to BuildingData fields
if (string.IsNullOrEmpty(base.buildingName))
{
base.buildingName = memo;
}
base.width = sizeX;
base.length = sizeY;
base.height = sizeZ;
base.maxHealth = maxHp;
base.visionRange = atkRange;
base.requiredWorkAmount = manpower;
base.workPerInteraction = 10f;
base.interactionCooldown =1f;
base.providesVision = true;
}
public void EnsureSynced()
{
SyncFields();
}
}
}

View File

@@ -0,0 +1,146 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &7169488976654481418
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4800397361066136527}
- component: {fileID: 4995981673923607444}
- component: {fileID: -5559005308629590716}
- component: {fileID: 8546144977850478548}
- component: {fileID: -4086363217010332088}
- component: {fileID: 4822792797652874450}
m_Layer: 0
m_Name: TowerTemplate
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4800397361066136527
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7169488976654481418}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &4995981673923607444
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7169488976654481418}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Netcode.Runtime::Unity.Netcode.NetworkObject
GlobalObjectIdHash: 4259369348
InScenePlacedSourceGlobalObjectIdHash: 0
DeferredDespawnTick: 0
Ownership: 1
AlwaysReplicateAsRoot: 0
SynchronizeTransform: 1
ActiveSceneSynchronization: 0
SceneMigrationSynchronization: 0
SpawnWithObservers: 1
DontDestroyWithOwner: 0
AutoObjectParentSync: 1
SyncOwnerTransformWhenParented: 1
AllowOwnerToParent: 0
--- !u!65 &-5559005308629590716
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7169488976654481418}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 2, z: 1}
m_Center: {x: 0, y: 1, z: 0}
--- !u!208 &8546144977850478548
NavMeshObstacle:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7169488976654481418}
m_Enabled: 1
serializedVersion: 3
m_Shape: 1
m_Extents: {x: 0.5, y: 1, z: 0.5}
m_MoveThreshold: 0.1
m_Carve: 0
m_CarveOnlyStationary: 1
m_Center: {x: 0, y: 1, z: 0}
m_TimeToStationary: 0.5
--- !u!114 &-4086363217010332088
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7169488976654481418}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0ceedb9b012d848478813136b65738ae, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Northbound.Building
ShowTopMostFoldoutHeaderGroup: 1
buildingData: {fileID: 0}
gridPosition: {x: 0, y: 0, z: 0}
rotation: 0
initialTeam: 1
initialOwnerId: 0
useInitialOwner: 0
showHealthBar: 1
healthBarPrefab: {fileID: 0}
destroyEffectPrefab: {fileID: 0}
damageEffectPrefab: {fileID: 0}
effectSpawnPoint: {fileID: 0}
showGridBounds: 1
gridBoundsColor: {r: 0, g: 1, b: 1, a: 1}
--- !u!114 &4822792797652874450
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7169488976654481418}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 760137a2fd0da7f458ac4b0ee7f485d6, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Northbound.FogOfWarVisibility
showInExploredAreas: 0
updateInterval: 0.2
renderers: []
enableDistantVisibility: 1
heightVisibilityMultiplier: 2
minHeightForDistantVisibility: 3
useExploredMaterial: 0
exploredMaterial: {fileID: 0}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 5cb8ca5552f975e4c88d418d11d28dbc
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -99,3 +99,18 @@ MonoBehaviour:
SourcePrefabToOverride: {fileID: 0}
SourceHashToOverride: 0
OverridingTargetPrefab: {fileID: 0}
- Override: 0
Prefab: {fileID: 7169488976654481418, guid: 5cb8ca5552f975e4c88d418d11d28dbc, type: 3}
SourcePrefabToOverride: {fileID: 0}
SourceHashToOverride: 0
OverridingTargetPrefab: {fileID: 0}
- Override: 0
Prefab: {fileID: 8512676738329978770, guid: 3f7838db2c2fc424d9bd9a0d243b43be, type: 3}
SourcePrefabToOverride: {fileID: 0}
SourceHashToOverride: 0
OverridingTargetPrefab: {fileID: 0}
- Override: 0
Prefab: {fileID: 3671057791414486316, guid: ae9a9b515e1792a45887f0d967b943d6, type: 3}
SourcePrefabToOverride: {fileID: 0}
SourceHashToOverride: 0
OverridingTargetPrefab: {fileID: 0}

Binary file not shown.

View File

@@ -0,0 +1,110 @@
fileFormatVersion: 2
guid: 3dbb43609bf79104da27aad0a7704ed3
ModelImporter:
serializedVersion: 24200
internalIDToNameTable: []
externalObjects: {}
materials:
materialImportMode: 2
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 0
motionNodeName:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importPhysicalCameras: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
nodeNameCollisionStrategy: 1
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
generateMeshLods: 0
meshLodGenerationFlags: 0
maximumMeshLod: -1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
strictVertexDataChecks: 0
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
humanDescription:
serializedVersion: 3
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
importBlendShapeDeformPercent: 1
remapMaterialsIfMaterialImportModeIsNone: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@@ -0,0 +1,110 @@
fileFormatVersion: 2
guid: 0204078ba040180418c65c7f09f3bdb2
ModelImporter:
serializedVersion: 24200
internalIDToNameTable: []
externalObjects: {}
materials:
materialImportMode: 2
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
removeConstantScaleCurves: 0
motionNodeName:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importPhysicalCameras: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
nodeNameCollisionStrategy: 1
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
optimizeBones: 1
generateMeshLods: 0
meshLodGenerationFlags: 0
maximumMeshLod: -1
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
strictVertexDataChecks: 0
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
humanDescription:
serializedVersion: 3
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
importBlendShapeDeformPercent: 1
remapMaterialsIfMaterialImportModeIsNone: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1285,7 +1285,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Netcode.Runtime::Unity.Netcode.NetworkObject
GlobalObjectIdHash: 2991918417
GlobalObjectIdHash: 209349728
InScenePlacedSourceGlobalObjectIdHash: 0
DeferredDespawnTick: 0
Ownership: 1

View File

@@ -964,8 +964,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Netcode.Runtime::Unity.Netcode.NetworkObject
GlobalObjectIdHash: 3377967349
InScenePlacedSourceGlobalObjectIdHash: 2825901034
GlobalObjectIdHash: 209349728
InScenePlacedSourceGlobalObjectIdHash: 0
DeferredDespawnTick: 0
Ownership: 1
AlwaysReplicateAsRoot: 0

View File

@@ -55,7 +55,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Netcode.Runtime::Unity.Netcode.NetworkObject
GlobalObjectIdHash: 4211758632
GlobalObjectIdHash: 1360081626
InScenePlacedSourceGlobalObjectIdHash: 4211758632
DeferredDespawnTick: 0
Ownership: 1

View File

@@ -0,0 +1,342 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1289760089446993883
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6062607789191353382}
- component: {fileID: 7470654452104141725}
- component: {fileID: 6347255101590433954}
m_Layer: 0
m_Name: building_tower_B_top_blue
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6062607789191353382
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1289760089446993883}
serializedVersion: 2
m_LocalRotation: {x: 0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1872842023463012809}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &7470654452104141725
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1289760089446993883}
m_Mesh: {fileID: -2975848345017946836, guid: 3dbb43609bf79104da27aad0a7704ed3, type: 3}
--- !u!23 &6347255101590433954
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1289760089446993883}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: -6545801570897300931, guid: 3dbb43609bf79104da27aad0a7704ed3, type: 3}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_MaskInteraction: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &7757785777080043176
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1872842023463012809}
- component: {fileID: 7668707206409267505}
- component: {fileID: 2906673092929627781}
m_Layer: 0
m_Name: Model
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1872842023463012809
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7757785777080043176}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 3, y: 3, z: 3}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6062607789191353382}
m_Father: {fileID: 5446357005769341236}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &7668707206409267505
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7757785777080043176}
m_Mesh: {fileID: -1867165846391908481, guid: 3dbb43609bf79104da27aad0a7704ed3, type: 3}
--- !u!23 &2906673092929627781
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7757785777080043176}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: -6545801570897300931, guid: 3dbb43609bf79104da27aad0a7704ed3, type: 3}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_MaskInteraction: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &8512676738329978770
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5446357005769341236}
- component: {fileID: 6253727954874418700}
- component: {fileID: 1804512144580361968}
- component: {fileID: 100877884298911200}
- component: {fileID: 8485093670801034058}
- component: {fileID: 7262612124217315611}
- component: {fileID: 3089566480349729}
m_Layer: 0
m_Name: Tower1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5446357005769341236
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8512676738329978770}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1872842023463012809}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &6253727954874418700
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8512676738329978770}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Netcode.Runtime::Unity.Netcode.NetworkObject
GlobalObjectIdHash: 4259369348
InScenePlacedSourceGlobalObjectIdHash: 0
DeferredDespawnTick: 0
Ownership: 1
AlwaysReplicateAsRoot: 0
SynchronizeTransform: 1
ActiveSceneSynchronization: 0
SceneMigrationSynchronization: 0
SpawnWithObservers: 1
DontDestroyWithOwner: 0
AutoObjectParentSync: 1
SyncOwnerTransformWhenParented: 1
AllowOwnerToParent: 0
--- !u!65 &1804512144580361968
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8512676738329978770}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 3, y: 3, z: 3}
m_Center: {x: 0, y: 1.5, z: 0}
--- !u!208 &100877884298911200
NavMeshObstacle:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8512676738329978770}
m_Enabled: 1
serializedVersion: 3
m_Shape: 1
m_Extents: {x: 1.5, y: 1.5, z: 1.5}
m_MoveThreshold: 0.1
m_Carve: 0
m_CarveOnlyStationary: 1
m_Center: {x: 0, y: 1.5, z: 0}
m_TimeToStationary: 0.5
--- !u!114 &8485093670801034058
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8512676738329978770}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0ceedb9b012d848478813136b65738ae, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Northbound.Building
ShowTopMostFoldoutHeaderGroup: 1
buildingData: {fileID: 0}
gridPosition: {x: 0, y: 0, z: 0}
rotation: 0
initialTeam: 1
initialOwnerId: 0
useInitialOwner: 0
showHealthBar: 1
healthBarPrefab: {fileID: 0}
destroyEffectPrefab: {fileID: 0}
damageEffectPrefab: {fileID: 0}
effectSpawnPoint: {fileID: 0}
showGridBounds: 1
gridBoundsColor: {r: 0, g: 1, b: 1, a: 1}
--- !u!114 &7262612124217315611
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8512676738329978770}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 760137a2fd0da7f458ac4b0ee7f485d6, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Northbound.FogOfWarVisibility
showInExploredAreas: 0
updateInterval: 0.2
renderers: []
enableDistantVisibility: 1
heightVisibilityMultiplier: 2
minHeightForDistantVisibility: 3
useExploredMaterial: 0
exploredMaterial: {fileID: 0}
--- !u!114 &3089566480349729
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8512676738329978770}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 56c4536effc49fe47af593bf9d17e979, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Northbound.TowerDataComponent
towerData: {fileID: 11400000, guid: 3e2e145df85a3ee4eb615f87efba4554, type: 2}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 3f7838db2c2fc424d9bd9a0d243b43be
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,251 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3671057791414486316
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1657799771882240}
- component: {fileID: 3850164934046790335}
- component: {fileID: 7724449748843190139}
- component: {fileID: 2615519446934682856}
- component: {fileID: 3203720634638459019}
- component: {fileID: 3906797260079127802}
- component: {fileID: 3692219876976097854}
m_Layer: 0
m_Name: Tower2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1657799771882240
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3671057791414486316}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8553397989698296005}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &3850164934046790335
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3671057791414486316}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.Netcode.Runtime::Unity.Netcode.NetworkObject
GlobalObjectIdHash: 4259369348
InScenePlacedSourceGlobalObjectIdHash: 0
DeferredDespawnTick: 0
Ownership: 1
AlwaysReplicateAsRoot: 0
SynchronizeTransform: 1
ActiveSceneSynchronization: 0
SceneMigrationSynchronization: 0
SpawnWithObservers: 1
DontDestroyWithOwner: 0
AutoObjectParentSync: 1
SyncOwnerTransformWhenParented: 1
AllowOwnerToParent: 0
--- !u!65 &7724449748843190139
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3671057791414486316}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 2, y: 1, z: 2}
m_Center: {x: 0, y: 0.5, z: 0}
--- !u!208 &2615519446934682856
NavMeshObstacle:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3671057791414486316}
m_Enabled: 1
serializedVersion: 3
m_Shape: 1
m_Extents: {x: 1, y: 0.5, z: 1}
m_MoveThreshold: 0.1
m_Carve: 0
m_CarveOnlyStationary: 1
m_Center: {x: 0, y: 0.5, z: 0}
m_TimeToStationary: 0.5
--- !u!114 &3203720634638459019
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3671057791414486316}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0ceedb9b012d848478813136b65738ae, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Northbound.Building
ShowTopMostFoldoutHeaderGroup: 1
buildingData: {fileID: 0}
gridPosition: {x: 0, y: 0, z: 0}
rotation: 0
initialTeam: 1
initialOwnerId: 0
useInitialOwner: 0
showHealthBar: 1
healthBarPrefab: {fileID: 0}
destroyEffectPrefab: {fileID: 0}
damageEffectPrefab: {fileID: 0}
effectSpawnPoint: {fileID: 0}
showGridBounds: 1
gridBoundsColor: {r: 0, g: 1, b: 1, a: 1}
--- !u!114 &3906797260079127802
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3671057791414486316}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 760137a2fd0da7f458ac4b0ee7f485d6, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Northbound.FogOfWarVisibility
showInExploredAreas: 0
updateInterval: 0.2
renderers: []
enableDistantVisibility: 1
heightVisibilityMultiplier: 2
minHeightForDistantVisibility: 3
useExploredMaterial: 0
exploredMaterial: {fileID: 0}
--- !u!114 &3692219876976097854
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3671057791414486316}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 56c4536effc49fe47af593bf9d17e979, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Northbound.TowerDataComponent
towerData: {fileID: 11400000, guid: 03a521eb1160745439ba2d0efeb12f3c, type: 2}
--- !u!1 &8947776510381915047
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8553397989698296005}
- component: {fileID: 5020570213282043347}
- component: {fileID: 3242347197691888434}
m_Layer: 0
m_Name: Model
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8553397989698296005
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8947776510381915047}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 2, y: 1, z: 2}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1657799771882240}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &5020570213282043347
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8947776510381915047}
m_Mesh: {fileID: -4423419886561025764, guid: 0204078ba040180418c65c7f09f3bdb2, type: 3}
--- !u!23 &3242347197691888434
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8947776510381915047}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: -6545801570897300931, guid: 0204078ba040180418c65c7f09f3bdb2, type: 3}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_MaskInteraction: 0
m_AdditionalVertexStreams: {fileID: 0}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: ae9a9b515e1792a45887f0d967b943d6
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1712,6 +1712,7 @@ MonoBehaviour:
enableHeightBlocking: 1
viewerEyeHeight: 1.5
minBlockingHeight: 2
disableInEditor: 1
--- !u!4 &946527919
Transform:
m_ObjectHideFlags: 0
@@ -1962,16 +1963,28 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.size
value: 0
value: 5
objectReference: {fileID: 0}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.data[0].prefab
value:
objectReference: {fileID: 8774623643640324048, guid: c92c9f1bf0ae6364f85409ecdc4aeaf3, type: 3}
objectReference: {fileID: 7146441246397375875, guid: eccdace7a7b21a446891da5739b1549f, type: 3}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.data[1].prefab
value:
objectReference: {fileID: 5176576196123937037, guid: 951b69041a2ace947afd721fefb3eaba, type: 3}
objectReference: {fileID: 9065146123892903723, guid: 4ee9b364dfe9d0949a23374e660d3e13, type: 3}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.data[2].prefab
value:
objectReference: {fileID: 2347008446492047424, guid: 9cac250ebe8d420469bd4da3ab8cfd86, type: 3}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.data[3].prefab
value:
objectReference: {fileID: 4973514444862586119, guid: ff2924ffa397a8e44925625790831d25, type: 3}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.data[4].prefab
value:
objectReference: {fileID: 5710477988932221578, guid: e8d09b814275ad745a427433c28dd53f, type: 3}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.data[0].monsterData
value:
@@ -3315,16 +3328,28 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.size
value: 0
value: 5
objectReference: {fileID: 0}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.data[0].prefab
value:
objectReference: {fileID: 8774623643640324048, guid: c92c9f1bf0ae6364f85409ecdc4aeaf3, type: 3}
objectReference: {fileID: 7146441246397375875, guid: eccdace7a7b21a446891da5739b1549f, type: 3}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.data[1].prefab
value:
objectReference: {fileID: 5176576196123937037, guid: 951b69041a2ace947afd721fefb3eaba, type: 3}
objectReference: {fileID: 9065146123892903723, guid: 4ee9b364dfe9d0949a23374e660d3e13, type: 3}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.data[2].prefab
value:
objectReference: {fileID: 2347008446492047424, guid: 9cac250ebe8d420469bd4da3ab8cfd86, type: 3}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.data[3].prefab
value:
objectReference: {fileID: 4973514444862586119, guid: ff2924ffa397a8e44925625790831d25, type: 3}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.data[4].prefab
value:
objectReference: {fileID: 5710477988932221578, guid: e8d09b814275ad745a427433c28dd53f, type: 3}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.data[0].monsterData
value:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b5e2a173b42c98746a251ef1dcb4f1a4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: def17a694f320ed4a80ff136df2b01b7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 32bffeae31a205549b9fb32d3674b199
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -189,6 +189,13 @@ namespace Northbound
}
Debug.Log($"[BuildingPlacement] 건설 모드 {(isBuildModeActive ? "" : "")}");
Debug.Log($"[BuildingPlacement] Preview object: {(previewObject != null ? "CREATED" : "NULL")}");
if (previewObject != null)
{
Debug.Log($"[BuildingPlacement] Preview position: {previewObject.transform.position}");
Debug.Log($"[BuildingPlacement] Preview scale: {previewObject.transform.localScale}");
Debug.Log($"[BuildingPlacement] Preview active: {previewObject.activeSelf}");
}
}
/// <summary>
@@ -231,6 +238,10 @@ namespace Northbound
return;
}
Debug.Log($"<color=cyan>[BuildingPlacement] Creating preview...</color>");
Debug.Log($"<color=cyan>[BuildingPlacement] BuildingManager.availableBuildings.Count: {BuildingManager.Instance.availableBuildings.Count}</color>");
Debug.Log($"<color=cyan>[BuildingPlacement] selectedBuildingIndex: {selectedBuildingIndex}</color>");
if (selectedBuildingIndex < 0 || selectedBuildingIndex >= BuildingManager.Instance.availableBuildings.Count)
{
Debug.LogWarning($"[BuildingPlacement] 유효하지 않은 건물 인덱스: {selectedBuildingIndex}");
@@ -238,12 +249,21 @@ namespace Northbound
}
BuildingData data = BuildingManager.Instance.availableBuildings[selectedBuildingIndex];
if (data == null || data.prefab == null)
if (data == null)
{
Debug.LogWarning("[BuildingPlacement] BuildingData 또는 Prefab이 없습니다.");
Debug.LogError($"[BuildingPlacement] BuildingData is NULL at index {selectedBuildingIndex}");
return;
}
if (data.prefab == null)
{
Debug.LogError($"[BuildingPlacement] BuildingData.prefab is NULL at index {selectedBuildingIndex}. Run 'Northbound > Diagnose Tower System'");
return;
}
Debug.Log($"<color=green>[BuildingPlacement] BuildingData: {data.buildingName}, Prefab: {data.prefab.name}</color>");
Debug.Log($"<color=green>[BuildingPlacement] Prefab scale: {data.prefab.transform.localScale}</color>");
// 완성 건물 프리팹으로 프리뷰 생성 (사용자가 완성 모습을 볼 수 있도록)
previewObject = Instantiate(data.prefab);
@@ -296,11 +316,17 @@ namespace Northbound
if (previewObject == null || BuildingManager.Instance == null)
return;
if (selectedBuildingIndex < 0 || selectedBuildingIndex >= BuildingManager.Instance.availableBuildings.Count)
return;
BuildingData data = BuildingManager.Instance.availableBuildings[selectedBuildingIndex];
if (data == null || data.prefab == null)
return;
Ray ray = Camera.main.ScreenPointToRay(Mouse.current.position.ReadValue());
if (Physics.Raycast(ray, out RaycastHit hit, maxPlacementDistance, groundLayer))
{
BuildingData data = BuildingManager.Instance.availableBuildings[selectedBuildingIndex];
// Check if placement is valid
bool isValid = BuildingManager.Instance.IsValidPlacement(data, hit.point, currentRotation, out Vector3 snappedPosition);
@@ -412,13 +438,24 @@ namespace Northbound
{
if (BuildingManager.Instance == null) return;
if (selectedBuildingIndex < 0 || selectedBuildingIndex >= BuildingManager.Instance.availableBuildings.Count)
{
Debug.LogWarning($"[BuildingPlacement] Invalid building index: {selectedBuildingIndex}");
return;
}
BuildingData data = BuildingManager.Instance.availableBuildings[selectedBuildingIndex];
if (data == null || data.prefab == null)
{
Debug.LogError($"[BuildingPlacement] BuildingData or prefab is null at index {selectedBuildingIndex}. Please run 'Northbound > Populate Towers from Prefabs' and update BuildingManager.");
return;
}
Ray ray = Camera.main.ScreenPointToRay(Mouse.current.position.ReadValue());
if (!Physics.Raycast(ray, out RaycastHit hit, maxPlacementDistance, groundLayer))
{
return;
}
BuildingData data = BuildingManager.Instance.availableBuildings[selectedBuildingIndex];
// 드래그 영역 계산
Vector3 dragEndPosition = hit.point;

View File

@@ -99,6 +99,8 @@ namespace Northbound
Debug.LogWarning($"[BuildingQuickslotUI] QuickSlot{i + 1} 액션이 null입니다. Input Actions 에셋을 확인하세요.");
}
}
Debug.Log($"[BuildingQuickslotUI] {_quickslotActions.Length}개의 퀵슬롯 액션 초기화됨 (최대 8개 키 바인딩)");
}
/// <summary>
@@ -155,6 +157,10 @@ namespace Northbound
{
SelectBuilding(slotIndex);
}
else if (slotIndex >= slotButtons.Count && quickslotPanel != null && quickslotPanel.activeSelf)
{
Debug.LogWarning($"[BuildingQuickslotUI] 슬롯 {slotIndex + 1}은 존재하지 않습니다. 마우스로 클릭하여 선택하세요.");
}
}
/// <summary>
@@ -176,11 +182,10 @@ namespace Northbound
}
slotButtons.Clear();
// 건물 목록으로 슬롯 생성 (최대 maxSlots개)
// 모든 건물 슬롯 생성 (제한 없음)
var buildings = BuildingManager.Instance.availableBuildings;
int slotCount = Mathf.Min(buildings.Count, maxSlots);
for (int i = 0; i < slotCount; i++)
for (int i = 0; i < buildings.Count; i++)
{
CreateSlot(buildings[i], i);
}

View File

@@ -0,0 +1,353 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using Northbound.Data;
namespace Northbound.Editor
{
public class CSVToSOImporter : EditorWindow
{
private static Dictionary<string, IPrefabSetup> prefabSetups;
[MenuItem("Tools/Data/Import All CSV")]
public static void ImportAllCSV()
{
InitializePrefabSetups();
string dataPath = Path.Combine(Application.dataPath, "../GameData");
if (!Directory.Exists(dataPath))
{
Debug.LogError("[CSVToSOImporter] GameData folder not found!");
return;
}
string[] csvFiles = Directory.GetFiles(dataPath, "*.csv");
int successCount = 0;
int failCount = 0;
bool towerImported = false;
foreach (string csvFile in csvFiles)
{
string fileName = Path.GetFileNameWithoutExtension(csvFile);
if (ImportCSV(fileName))
{
successCount++;
if (fileName == "Tower")
towerImported = true;
}
else
{
failCount++;
}
}
Debug.Log($"<color=green>[CSVToSOImporter] Import complete: {successCount} succeeded, {failCount} failed</color>");
if (towerImported)
{
AutoConfigureBuildingManager();
}
AssetDatabase.Refresh();
}
private static void InitializePrefabSetups()
{
prefabSetups = new Dictionary<string, IPrefabSetup>
{
{ "Monster", new MonsterPrefabSetup() },
{ "Tower", new TowerPrefabSetup() }
};
}
private static bool ImportCSV(string typeName)
{
string csvPath = Path.Combine(Application.dataPath, "../GameData", $"{typeName}.csv");
if (!File.Exists(csvPath))
{
Debug.LogWarning($"[CSVToSOImporter] CSV file not found: {csvPath}");
return false;
}
if (!prefabSetups.ContainsKey(typeName))
{
Debug.LogWarning($"[CSVToSOImporter] No prefab setup found for type: {typeName}");
return false;
}
IPrefabSetup prefabSetup = prefabSetups[typeName];
string templateName = prefabSetup.GetTemplateName();
string templatePath = $"Assets/Data/Templates/{templateName}.prefab";
GameObject template = AssetDatabase.LoadAssetAtPath<GameObject>(templatePath);
if (template == null)
{
Debug.LogError($"[CSVToSOImporter] Template not found: {templatePath}");
return false;
}
string[] csvLines = File.ReadAllLines(csvPath);
if (csvLines.Length < 2)
{
Debug.LogWarning($"[CSVToSOImporter] CSV file is empty or has no data: {csvPath}");
return false;
}
string[] headers = ParseCSVLine(csvLines[0]);
int successCount = 0;
for (int i = 1; i < csvLines.Length; i++)
{
if (string.IsNullOrWhiteSpace(csvLines[i]))
continue;
string[] values = ParseCSVLine(csvLines[i]);
if (CreatePrefabFromRow(typeName, headers, values, template, prefabSetup))
{
successCount++;
}
}
Debug.Log($"[CSVToSOImporter] {typeName}: {successCount} prefabs created/updated");
// If towers were imported, auto-configure BuildingManager
// TowerData now extends BuildingData, so it can be used directly!
if (typeName == "Tower")
{
Debug.Log($"<color=cyan>[CSVToSOImporter] Tower import complete, TowerData extends BuildingData now!</color>");
}
return true;
}
private static bool CreatePrefabFromRow(string typeName, string[] headers, string[] values, GameObject template, IPrefabSetup prefabSetup)
{
string soPath = $"Assets/Data/ScriptableObjects/{typeName}";
Directory.CreateDirectory(Path.Combine(Application.dataPath, $"ScriptableObjects/{typeName}"));
int id = 0;
for (int i = 0; i < headers.Length && i < values.Length; i++)
{
if (headers[i].ToLower() == "id")
{
int.TryParse(values[i], out id);
break;
}
}
if (id == 0)
{
Debug.LogWarning($"[CSVToSOImporter] No valid ID found in row");
return false;
}
ScriptableObject data;
string soAssetPath = $"{soPath}/{typeName}{id}.asset";
data = AssetDatabase.LoadAssetAtPath<ScriptableObject>(soAssetPath);
bool isNew = false;
if (data == null)
{
data = CreateInstance(typeName + "Data");
isNew = true;
}
for (int i = 0; i < headers.Length && i < values.Length; i++)
{
string fieldName = CSVToCamelCase(headers[i]);
var field = data.GetType().GetField(fieldName);
if (field != null)
{
try
{
object value = ParseValue(values[i], field.FieldType);
field.SetValue(data, value);
}
catch (System.Exception e)
{
Debug.LogWarning($"[CSVToSOImporter] Failed to set {fieldName}: {e.Message}");
}
}
}
string prefabPath = $"Assets/Prefabs/{typeName}/{typeName}{id}.prefab";
Directory.CreateDirectory(Path.Combine(Application.dataPath, $"Prefabs/{typeName}"));
GameObject prefabInstance = GameObject.Instantiate(template);
prefabInstance.name = $"{typeName}{id}";
prefabSetup.SetupPrefab(prefabInstance, data);
GameObject prefabObj = PrefabUtility.SaveAsPrefabAsset(prefabInstance, prefabPath);
GameObject.DestroyImmediate(prefabInstance);
// Now set the prefab reference on data
if (data is BuildingData buildingData)
{
buildingData.prefab = prefabObj;
Debug.Log($"[CSVToSOImporter] Set prefab reference: {buildingData.name} -> {prefabObj.name}");
}
// Save data asset
if (isNew)
{
AssetDatabase.CreateAsset(data, soAssetPath);
}
else
{
EditorUtility.SetDirty(data);
}
// Force save assets to disk
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
return true;
}
private static void AutoConfigureBuildingManager()
{
BuildingManager buildingManager = GameObject.FindObjectOfType<BuildingManager>();
if (buildingManager == null)
{
Debug.LogError("<color=red>[CSVToSOImporter] BuildingManager not found in scene! Please add a BuildingManager component to a GameObject in your scene.</color>");
return;
}
// Load TowerData (which extends BuildingData)
string[] towerDataGuids = AssetDatabase.FindAssets("t:TowerData", new[] { "Assets/Data/ScriptableObjects" });
List<BuildingData> allTowers = new List<BuildingData>();
Debug.Log($"<color=cyan>[CSVToSOImporter] Found {towerDataGuids.Length} TowerData assets</color>");
foreach (string guid in towerDataGuids)
{
string assetPath = AssetDatabase.GUIDToAssetPath(guid);
TowerData towerData = AssetDatabase.LoadAssetAtPath<TowerData>(assetPath);
if (towerData == null)
{
Debug.LogWarning($"[CSVToSOImporter] Failed to load TowerData: {assetPath}");
continue;
}
if (towerData.prefab == null)
{
Debug.LogWarning($"<color=yellow>[CSVToSOImporter] TowerData {towerData.name} has no prefab reference - skipping</color>");
continue;
}
allTowers.Add(towerData);
Debug.Log($"<color=green>[CSVToSOImporter] Added tower: {towerData.buildingName}</color>");
}
if (allTowers.Count == 0)
{
Debug.LogWarning("<color=yellow>[CSVToSOImporter] No TowerData with valid prefabs found!</color>");
Debug.LogWarning("<color=yellow>Run 'Northbound > Diagnose Tower System' to see what's wrong</color>");
return;
}
allTowers.Sort((a, b) => string.Compare(a.buildingName, b.buildingName));
buildingManager.availableBuildings.Clear();
foreach (var towerData in allTowers)
{
buildingManager.availableBuildings.Add(towerData);
}
EditorUtility.SetDirty(buildingManager);
EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
Debug.Log($"<color=cyan>========================================</color>");
Debug.Log($"<color=cyan>🏗️ TOWER IMPORT COMPLETE!</color>");
Debug.Log($"<color=cyan>========================================</color>");
Debug.Log($"<color=green>✓ BuildingManager automatically configured!</color>");
Debug.Log($"<color=green>✓ Added {allTowers.Count} TowerData to availableBuildings list</color>");
Debug.Log($"<color=green>✓ Ready to play - all towers will appear in quickslot!</color>");
Debug.Log($"<color=cyan>========================================</color>");
foreach (var towerData in allTowers)
{
Debug.Log($"<color=green> - {towerData.buildingName}</color>");
}
Debug.Log($"<color=cyan>========================================</color>");
}
private static object ParseValue(string value, System.Type type)
{
if (string.IsNullOrEmpty(value))
{
return type.IsValueType ? System.Activator.CreateInstance(type) : null;
}
if (type == typeof(int))
{
int result;
if (int.TryParse(value, out result)) return result;
}
else if (type == typeof(float))
{
float result;
if (float.TryParse(value, out result)) return result;
}
else if (type == typeof(bool))
{
bool result;
if (bool.TryParse(value, out result)) return result;
}
else if (type == typeof(string))
{
return value;
}
return type.IsValueType ? System.Activator.CreateInstance(type) : null;
}
private static string CSVToCamelCase(string csvName)
{
if (string.IsNullOrEmpty(csvName))
return csvName;
string[] parts = csvName.Split('_');
for (int i = 1; i < parts.Length; i++)
{
if (!string.IsNullOrEmpty(parts[i]))
{
parts[i] = char.ToUpper(parts[i][0]) + parts[i].Substring(1);
}
}
return string.Join("", parts);
}
private static string[] ParseCSVLine(string line)
{
List<string> result = new List<string>();
bool inQuotes = false;
string current = "";
foreach (char c in line)
{
if (c == '"')
{
inQuotes = !inQuotes;
}
else if (c == ',' && !inQuotes)
{
result.Add(current);
current = "";
}
else
{
current += c;
}
}
result.Add(current);
return result.ToArray();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: c00f900c9a822184dbb4dc85440d40dd

View File

@@ -2,6 +2,7 @@ using Unity.Netcode;
using UnityEditor;
using UnityEngine;
using UnityEngine.AI;
using Northbound;
namespace Northbound.Editor
{
@@ -147,9 +148,35 @@ namespace Northbound.Editor
private static void SetupTowerComponents(GameObject go)
{
Transform t = go.transform;
t.localPosition = Vector3.zero;
t.localRotation = Quaternion.identity;
t.localScale = Vector3.one;
if (go.GetComponent<NetworkObject>() == null)
go.AddComponent<NetworkObject>();
if (go.GetComponent<Building>() == null)
go.AddComponent<Building>();
if (go.GetComponent<TowerDataComponent>() == null)
go.AddComponent<TowerDataComponent>();
if (go.GetComponent<BoxCollider>() == null)
{
BoxCollider collider = go.AddComponent<BoxCollider>();
collider.size = new Vector3(1f, 2f, 1f);
collider.center = new Vector3(0f, 1f, 0f);
}
if (go.GetComponent<NavMeshObstacle>() == null)
{
NavMeshObstacle obstacle = go.AddComponent<NavMeshObstacle>();
obstacle.shape = NavMeshObstacleShape.Box;
obstacle.size = new Vector3(1f, 1f, 1f);
obstacle.center = new Vector3(0f, 0.5f, 0f);
}
int defaultLayer = LayerMask.NameToLayer("Default");
if (defaultLayer >= 0)
{

View File

@@ -0,0 +1,80 @@
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using Northbound;
using Northbound.Data;
namespace Northbound.Editor
{
public class TowerPopulator
{
private const string TOWER_PREFAB_PATH = "Assets/Prefabs/Tower";
private const string TOWER_DATA_PATH = "Assets/Data/ScriptableObjects";
[MenuItem("Northbound/Diagnose Tower System")]
public static void DiagnoseTowerSystem()
{
Debug.Log($"<color=cyan>========================================</color>");
Debug.Log($"<color=cyan>[TowerPopulator] DIAGNOSING TOWER SYSTEM</color>");
Debug.Log($"<color=cyan>========================================</color>");
string[] prefabGuids = AssetDatabase.FindAssets("t:Tower", new[] { TOWER_PREFAB_PATH });
Debug.Log($"<color=cyan>Tower Prefabs in Assets/Prefabs/Tower/:</color>");
if (prefabGuids.Length == 0)
{
Debug.Log($"<color=red>✗ No tower prefabs found!</color>");
}
else
{
foreach (string guid in prefabGuids)
{
string assetPath = AssetDatabase.GUIDToAssetPath(guid);
GameObject prefab = AssetDatabase.LoadAssetAtPath<GameObject>(assetPath);
TowerDataComponent tower = prefab?.GetComponent<TowerDataComponent>();
string towerStatus = tower != null && tower.towerData != null ? "<color=green>✓</color>" : "<color=red>✗</color>";
string towerDataName = tower?.towerData?.name ?? "MISSING";
Debug.Log($" {towerStatus} {prefab.name} - TowerDataComponent: {tower != null}, TowerData: {towerDataName}");
}
}
string[] towerDataGuids = AssetDatabase.FindAssets("t:TowerData", new[] { TOWER_DATA_PATH });
Debug.Log($"<color=cyan>TowerData assets in Assets/Data/ScriptableObjects/:</color>");
if (towerDataGuids.Length == 0)
{
Debug.Log($"<color=yellow>⚠ No TowerData assets found - Run 'Tools > Data > Import All CSV' first!</color>");
}
else
{
foreach (string guid in towerDataGuids)
{
string assetPath = AssetDatabase.GUIDToAssetPath(guid);
TowerData data = AssetDatabase.LoadAssetAtPath<TowerData>(assetPath);
string prefabStatus = data?.prefab != null ? "<color=green>✓</color>" : "<color=red>✗</color>";
Debug.Log($" {prefabStatus} {data.name} - Prefab: {data?.prefab?.name ?? "MISSING"}, BuildingName: {data?.buildingName}");
}
}
BuildingManager buildingManager = GameObject.FindObjectOfType<BuildingManager>();
Debug.Log($"<color=cyan>BuildingManager in Scene:</color>");
if (buildingManager == null)
{
Debug.Log($"<color=red>✗ BuildingManager not found in scene!</color>");
}
else
{
Debug.Log($"<color=green>✓ BuildingManager found: {buildingManager.gameObject.name}</color>");
Debug.Log($"<color=cyan> Available Buildings: {buildingManager.availableBuildings.Count}</color>");
foreach (var building in buildingManager.availableBuildings)
{
string status = building?.prefab != null ? "<color=green>✓</color>" : "<color=red>✗</color>";
string isTower = building is TowerData ? "<color=green>[Tower]</color>" : "<color>yellow>[Building]</color>";
Debug.Log($" {status} {isTower} {building?.name ?? "MISSING"} - {building?.buildingName}");
}
}
Debug.Log($"<color=cyan>========================================</color>");
Debug.Log($"<color=cyan>[TowerPopulator] DIAGNOSIS COMPLETE</color>");
Debug.Log($"<color=cyan>========================================</color>");
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 069a105319ca9cf4a8323e1d5357960f

View File

@@ -0,0 +1,128 @@
using Northbound.Data;
using UnityEditor;
using UnityEngine;
using UnityEngine.AI;
namespace Northbound.Editor
{
public class TowerPrefabSetup : IPrefabSetup
{
public string GetTemplateName()
{
return "TowerTemplate";
}
public void SetupPrefab(GameObject prefab, ScriptableObject data)
{
if (!(data is TowerData towerData))
{
Debug.LogWarning($"[TowerPrefabSetup] Expected TowerData, got {data.GetType().Name}");
return;
}
var towerDataComponent = prefab.GetComponent<TowerDataComponent>();
if (towerDataComponent == null)
{
towerDataComponent = prefab.AddComponent<TowerDataComponent>();
Debug.Log($"[TowerPrefabSetup] Added TowerDataComponent component");
}
if (towerDataComponent != null)
{
towerDataComponent.towerData = towerData;
}
// TowerData now extends BuildingData, so set prefab reference
towerData.prefab = prefab;
// Ensure TowerData fields are synced to BuildingData
towerData.EnsureSynced();
Transform modelTransform = null;
if (!string.IsNullOrEmpty(towerData.modelPath))
{
RemoveOldModel(prefab);
if (towerData.modelPath.ToLower().EndsWith(".fbx"))
{
GameObject fbxModel = AssetDatabase.LoadAssetAtPath<GameObject>(towerData.modelPath);
if (fbxModel != null)
{
GameObject fbxInstance = GameObject.Instantiate(fbxModel);
fbxInstance.name = "Model";
fbxInstance.transform.SetParent(prefab.transform, false);
fbxInstance.transform.localPosition = Vector3.zero;
fbxInstance.transform.localRotation = Quaternion.identity;
// Set model scale based on sizeX/sizeY/sizeZ
fbxInstance.transform.localScale = new Vector3(towerData.sizeX, towerData.sizeZ, towerData.sizeY);
modelTransform = fbxInstance.transform;
Debug.Log($"[TowerPrefabSetup] Applied FBX model: {towerData.modelPath} with scale {towerData.sizeX}x{towerData.sizeZ}x{towerData.sizeY}");
}
else
{
Debug.LogWarning($"[TowerPrefabSetup] Could not load FBX model: {towerData.modelPath}");
}
}
else
{
var meshFilter = prefab.GetComponent<MeshFilter>();
if (meshFilter == null)
{
meshFilter = prefab.AddComponent<MeshFilter>();
}
var renderer = prefab.GetComponent<MeshRenderer>();
if (renderer == null)
{
renderer = prefab.AddComponent<MeshRenderer>();
}
Mesh mesh = AssetDatabase.LoadAssetAtPath<Mesh>(towerData.modelPath);
if (mesh != null)
{
meshFilter.sharedMesh = mesh;
modelTransform = renderer.transform;
modelTransform.localScale = new Vector3(towerData.sizeX, towerData.sizeZ, towerData.sizeY);
Debug.Log($"[TowerPrefabSetup] Applied mesh: {towerData.modelPath} with scale {towerData.sizeX}x{towerData.sizeZ}x{towerData.sizeY}");
}
else
{
Debug.LogWarning($"[TowerPrefabSetup] Could not load mesh: {towerData.modelPath}");
}
}
}
var collider = prefab.GetComponent<BoxCollider>();
if (collider == null)
{
collider = prefab.AddComponent<BoxCollider>();
}
collider.size = new Vector3(towerData.sizeX, towerData.sizeZ, towerData.sizeY);
collider.center = new Vector3(0f, towerData.sizeZ / 2f, 0f);
var navObstacle = prefab.GetComponent<NavMeshObstacle>();
if (navObstacle == null)
{
navObstacle = prefab.AddComponent<NavMeshObstacle>();
navObstacle.shape = NavMeshObstacleShape.Box;
}
navObstacle.size = new Vector3(towerData.sizeX, towerData.sizeZ, towerData.sizeY);
navObstacle.center = new Vector3(0f, towerData.sizeZ / 2f, 0f);
}
private void RemoveOldModel(GameObject prefab)
{
Transform oldModel = prefab.transform.Find("Model");
if (oldModel != null)
{
GameObject.DestroyImmediate(oldModel.gameObject);
}
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: ea17487cde4842d45baf5eb92943142a

View File

@@ -0,0 +1,26 @@
using Northbound.Data;
using Unity.Netcode;
using UnityEngine;
namespace Northbound
{
[RequireComponent(typeof(Building))]
[RequireComponent(typeof(NetworkObject))]
public class TowerDataComponent : MonoBehaviour
{
[Header("Data Reference")]
[Tooltip("ScriptableObject containing tower data")]
public TowerData towerData;
private void Awake()
{
// TowerData now extends BuildingData, so just pass it directly
Building building = GetComponent<Building>();
if (building != null && towerData != null)
{
building.buildingData = towerData;
building.initialTeam = TeamType.Player;
}
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 56c4536effc49fe47af593bf9d17e979