meta파일 추가 및 gitignore에서 제거
This commit is contained in:
8
Assets/Scripts/Enemy.meta
Normal file
8
Assets/Scripts/Enemy.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 82c73fe0e94ffbc4fb630f82b216056b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
2
Assets/Scripts/Enemy/EnemyAttack.cs.meta
Normal file
2
Assets/Scripts/Enemy/EnemyAttack.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1c203980d40e2bf4392783aade147dca
|
||||
2
Assets/Scripts/Enemy/EnemyHealth.cs.meta
Normal file
2
Assets/Scripts/Enemy/EnemyHealth.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b2ce198f9f66bbe41a739abb07974082
|
||||
2
Assets/Scripts/Enemy/EnemyMoveDefault.cs.meta
Normal file
2
Assets/Scripts/Enemy/EnemyMoveDefault.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0624f93e2b743af4baf8b6459f3a64ff
|
||||
8
Assets/Scripts/GameBase.meta
Normal file
8
Assets/Scripts/GameBase.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c80c08a1206344f46b2eaf93665cb998
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
2
Assets/Scripts/GameBase/Billboard.cs.meta
Normal file
2
Assets/Scripts/GameBase/Billboard.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f276e01d8ad842409e5c148fb7e3e4f
|
||||
@@ -6,15 +6,16 @@ using System.Collections.Generic;
|
||||
public class BuildManager : MonoBehaviour
|
||||
{
|
||||
public static BuildManager Instance;
|
||||
|
||||
|
||||
[System.Serializable]
|
||||
public struct TurretData // 타워별 정보를 담는 구조체
|
||||
public struct TurretData
|
||||
{
|
||||
public string turretName;
|
||||
public GameObject finalPrefab; // 완공 후 실제 타워
|
||||
public GameObject ghostPrefab; // 건설 모드 시 미리보기
|
||||
public float buildTime; // 건설 소요 시간
|
||||
public Vector2Int size; // 점유 칸수
|
||||
public bool isTunnel; // [추가] 터널 여부 체크
|
||||
public GameObject finalPrefab;
|
||||
public GameObject ghostPrefab;
|
||||
public float buildTime;
|
||||
public Vector2Int size;
|
||||
}
|
||||
|
||||
public bool IsBuildMode => isBuildMode;
|
||||
@@ -216,32 +217,48 @@ public class BuildManager : MonoBehaviour
|
||||
}
|
||||
|
||||
// --- Utilities ---
|
||||
private bool CanBuild(Vector2Int startPos, Vector2Int size)
|
||||
private bool CanBuild(Vector2Int startPos, TurretData data)
|
||||
{
|
||||
for (int x = 0; x < size.x; x++)
|
||||
for (int y = 0; y < size.y; y++)
|
||||
if (_occupiedNodes.Contains(new Vector2Int(startPos.x + x, startPos.y + y)))
|
||||
// 1. 기존 점유 노드 및 플레이어 충돌 체크 (기존 로직)
|
||||
for (int x = 0; x < data.size.x; x++)
|
||||
for (int y = 0; y < data.size.y; y++)
|
||||
if (_occupiedNodes.Contains(new Vector2Int(startPos.x + x, startPos.y + y)))
|
||||
return false;
|
||||
|
||||
// 2. 플레이어와 겹치는지 물리적 박스 검사
|
||||
Vector3 center = GridToWorld(startPos, size);
|
||||
// 타워 높이의 절반 정도 위에서 검사 (y축 위치 보정)
|
||||
center.y = 1f;
|
||||
// 2. 터널 연결 제약 조건 체크
|
||||
if (data.isTunnel)
|
||||
{
|
||||
return IsConnectedToExistingTunnel(startPos, data);
|
||||
}
|
||||
|
||||
// 타워 사이즈보다 아주 살짝 작게 설정하여 여유 공간 부여 (0.45f)
|
||||
Vector3 halfExtents = new Vector3(size.x * 0.45f, 0.5f, size.y * 0.45f);
|
||||
|
||||
// 해당 영역에 playerLayer를 가진 콜라이더가 있는지 확인
|
||||
bool isPlayerOverlapping = Physics.CheckBox(center, halfExtents, Quaternion.identity, playerLayer);
|
||||
|
||||
return !isPlayerOverlapping;
|
||||
return true; // 일반 타워는 어디든 건설 가능 (필요시 수정)
|
||||
}
|
||||
|
||||
private Vector2Int WorldToGrid(Vector3 worldPos) => new Vector2Int(Mathf.FloorToInt(worldPos.x / cellSize), Mathf.FloorToInt(worldPos.z / cellSize));
|
||||
|
||||
private Vector3 GridToWorld(Vector2Int gridPos, Vector2Int size)
|
||||
private bool IsConnectedToExistingTunnel(Vector2Int startPos, TurretData data)
|
||||
{
|
||||
return new Vector3(gridPos.x * cellSize + (size.x - 1) * cellSize * 0.5f, 0.05f, gridPos.y * cellSize + (size.y - 1) * cellSize * 0.5f);
|
||||
// [중요] 게임의 첫 번째 터널을 지을 수 있도록, 기존 터널이 아예 없다면 true 반환
|
||||
// 혹은 '코어(성벽)' 레이어를 체크하도록 할 수도 있습니다.
|
||||
if (_occupiedNodes.Count == 0) return true;
|
||||
|
||||
// 현재 배치하려는 고스트의 위치 근처에 이미 완성된 TunnelNode가 있는지 검사합니다.
|
||||
Vector3 ghostWorldPos = GridToWorld(startPos, data.size);
|
||||
|
||||
// 고스트 프리팹에 있는 노드들의 상대 위치를 활용해 주변을 검색합니다.
|
||||
// 여기서는 간단하게 고스트의 일정 반경 내에 Tunnel 레이어가 있는지 확인합니다.
|
||||
float checkRadius = cellSize * 1.5f; // 한 칸 정도의 여유 범위
|
||||
Collider[] neighbors = Physics.OverlapSphere(ghostWorldPos, checkRadius, LayerMask.GetMask("Tunnel"));
|
||||
|
||||
foreach (var col in neighbors)
|
||||
{
|
||||
// 건설 중인 '토대'가 아니라, 이미 '완공된' 터널 노드인지 확인해야 합니다.
|
||||
TunnelNode node = col.GetComponent<TunnelNode>();
|
||||
if (node != null && node.gameObject.activeInHierarchy)
|
||||
{
|
||||
return true; // 연결 가능한 노드 발견!
|
||||
}
|
||||
}
|
||||
|
||||
return false; // 주변에 연결된 터널이 없음
|
||||
}
|
||||
|
||||
private void OnDrawGizmos()
|
||||
|
||||
2
Assets/Scripts/GameBase/BuildManager.cs.meta
Normal file
2
Assets/Scripts/GameBase/BuildManager.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2d6331caa25f3aa4aa4fbd51ef4ec71a
|
||||
2
Assets/Scripts/GameBase/Core.cs.meta
Normal file
2
Assets/Scripts/GameBase/Core.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eda0106ca978373449769fd4ded4658f
|
||||
2
Assets/Scripts/GameBase/GameManager.cs.meta
Normal file
2
Assets/Scripts/GameBase/GameManager.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 161668cd059bc9444bbf189e4d48995a
|
||||
2
Assets/Scripts/GameBase/Gate.cs.meta
Normal file
2
Assets/Scripts/GameBase/Gate.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aca054ee474238545a8a396d410bf5a3
|
||||
2
Assets/Scripts/GameBase/IDamageable.cs.meta
Normal file
2
Assets/Scripts/GameBase/IDamageable.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f4263f817b93ba40aae6bf400f9ce49
|
||||
2
Assets/Scripts/GameBase/Portal.cs.meta
Normal file
2
Assets/Scripts/GameBase/Portal.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: df30a5239a8f26149a53cbc492a9fba7
|
||||
2
Assets/Scripts/GameBase/WaveManager.cs.meta
Normal file
2
Assets/Scripts/GameBase/WaveManager.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 44cce58f0e8db1747ba5bd6d1284e438
|
||||
2
Assets/Scripts/IInteractable.cs.meta
Normal file
2
Assets/Scripts/IInteractable.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3df376f8a6fb43b4d826654d7fe3f606
|
||||
8
Assets/Scripts/Player.meta
Normal file
8
Assets/Scripts/Player.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 86ec2e121074b4646948012f852e6dc2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
2
Assets/Scripts/Player/PlayerBuildInteract.cs.meta
Normal file
2
Assets/Scripts/Player/PlayerBuildInteract.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 29785216765776848b0c3cc745d761a7
|
||||
2
Assets/Scripts/Player/PlayerInteraction.cs.meta
Normal file
2
Assets/Scripts/Player/PlayerInteraction.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 059b81ebcbce23f4b88e7c52021fa869
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 736c03e837e6b074ba7f90b813050aed
|
||||
2
Assets/Scripts/Player/PlayerMovement.cs.meta
Normal file
2
Assets/Scripts/Player/PlayerMovement.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 768ea4bbb68b30140921c7192ebe2852
|
||||
8
Assets/Scripts/Tower.meta
Normal file
8
Assets/Scripts/Tower.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d30483e79262aff41a16e7e869ba3d08
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
2
Assets/Scripts/Tower/AreaTowerAttack.cs.meta
Normal file
2
Assets/Scripts/Tower/AreaTowerAttack.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: acf7c1949566efb448f1f1f2622012a2
|
||||
@@ -52,11 +52,23 @@ public class ConstructionSite : MonoBehaviour
|
||||
|
||||
private void CompleteBuild()
|
||||
{
|
||||
// 1. 실제 타워 생성
|
||||
GameObject turret = Instantiate(_finalTurretPrefab, transform.position, transform.rotation);
|
||||
GameObject finalTurret = Instantiate(_finalPrefab, transform.position, Quaternion.identity);
|
||||
BuildManager.Instance.AlignToGround(finalTurret, 0f);
|
||||
|
||||
// 2. 생성된 타워의 크기를 저장해둔 사이즈로 변경!
|
||||
turret.transform.localScale = new Vector3(_size.x, 1f, _size.y);
|
||||
// [추가] 새로 생긴 터널의 노드들에게 주변 연결을 찾으라고 명령
|
||||
TunnelNode[] newNodes = finalTurret.GetComponentsInChildren<TunnelNode>();
|
||||
foreach (var node in newNodes)
|
||||
{
|
||||
node.FindNeighborNode();
|
||||
}
|
||||
|
||||
// [추가] 주변에 있던 기존 노드들도 새 노드를 찾도록 주변 검색 실행
|
||||
Collider[] neighbors = Physics.OverlapSphere(transform.position, 5f, LayerMask.GetMask("Tunnel"));
|
||||
foreach (var col in neighbors)
|
||||
{
|
||||
TunnelNode neighborNode = col.GetComponent<TunnelNode>();
|
||||
if (neighborNode != null) neighborNode.FindNeighborNode();
|
||||
}
|
||||
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
2
Assets/Scripts/Tower/ConstructionSite.cs.meta
Normal file
2
Assets/Scripts/Tower/ConstructionSite.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9bbda59cbb9721e419a846e7db104508
|
||||
2
Assets/Scripts/Tower/ExplosiveProjectile.cs.meta
Normal file
2
Assets/Scripts/Tower/ExplosiveProjectile.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: edc9774450b461949881473493df9118
|
||||
2
Assets/Scripts/Tower/Projectile.cs.meta
Normal file
2
Assets/Scripts/Tower/Projectile.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8b0881e69aae16f4e87dd19a210a026b
|
||||
2
Assets/Scripts/Tower/TowerAttack.cs.meta
Normal file
2
Assets/Scripts/Tower/TowerAttack.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2a2261bfcc98da54f99ea109f6fd9645
|
||||
2
Assets/Scripts/Tower/TowerRangeOverlay.cs.meta
Normal file
2
Assets/Scripts/Tower/TowerRangeOverlay.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1de87143b4c1b934fa3178ed813be3b3
|
||||
2
Assets/Scripts/TunnelNode.cs.meta
Normal file
2
Assets/Scripts/TunnelNode.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 275306f282948c343bf20ee884ad22b8
|
||||
2
Assets/Scripts/TunnelTraveler.cs.meta
Normal file
2
Assets/Scripts/TunnelTraveler.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d71ce06d133743140877345b807f33ad
|
||||
Reference in New Issue
Block a user