Compare commits
3 Commits
225b076b62
...
95db5ce4f3
| Author | SHA1 | Date | |
|---|---|---|---|
| 95db5ce4f3 | |||
| 3e026d3319 | |||
| a3b1b83c8d |
@@ -45,7 +45,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Unity.Netcode.Runtime::Unity.Netcode.NetworkObject
|
||||
GlobalObjectIdHash: 0
|
||||
GlobalObjectIdHash: 1920228393
|
||||
InScenePlacedSourceGlobalObjectIdHash: 0
|
||||
DeferredDespawnTick: 0
|
||||
Ownership: 1
|
||||
@@ -72,7 +72,5 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::Northbound.CreepCamp
|
||||
ShowTopMostFoldoutHeaderGroup: 1
|
||||
creepPrefabs: []
|
||||
campStrength: 1
|
||||
campCostBudget: 10
|
||||
spawnRadius: 5
|
||||
maxSpawnAttempts: 50
|
||||
resourcePickupPrefab: {fileID: 1627676033990080135, guid: 8c45964a69bf8fa4ba461ed217bc052f, type: 3}
|
||||
baseResourceAmount: 50
|
||||
|
||||
@@ -352,7 +352,7 @@ Transform:
|
||||
m_GameObject: {fileID: 447015514}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 6.1460094, y: 0.00002002716, z: -612.7231}
|
||||
m_LocalPosition: {x: -10, y: 0, z: 15}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
@@ -649,7 +649,7 @@ Transform:
|
||||
m_GameObject: {fileID: 519420028}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0.38268346, y: -0.00000022436977, z: 0.000000092937015, w: 0.92387956}
|
||||
m_LocalPosition: {x: 0, y: 19, z: -18}
|
||||
m_LocalPosition: {x: -16.14601, y: 18.99998, z: 514.7231}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
@@ -712,7 +712,7 @@ Transform:
|
||||
m_GameObject: {fileID: 576429379}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -16.14601, y: 0.99998, z: 532.7231}
|
||||
m_LocalPosition: {x: 0, y: 1, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
@@ -901,15 +901,15 @@ MonoBehaviour:
|
||||
ShowTopMostFoldoutHeaderGroup: 1
|
||||
generateOnSpawn: 1
|
||||
groupUnderParent: 1
|
||||
playableAreaWidth: 70
|
||||
startZ: -75
|
||||
endZ: 600
|
||||
playableAreaWidth: 80
|
||||
startZ: 25
|
||||
endZ: 725
|
||||
resourcePrefab: {fileID: 5585059388146411250, guid: f395fcc064a3a834ba957327f1387c19, type: 3}
|
||||
minResourceCount: 8
|
||||
maxResourceCount: 12
|
||||
minDistanceBetweenResources: 80
|
||||
minDistanceFromCore: 50
|
||||
minDistanceFromBarracks: 50
|
||||
minDistanceFromCore: 30
|
||||
minDistanceFromBarracks: 30
|
||||
initialResourceProduction: 50
|
||||
additionalResourceBaseProduction: 25
|
||||
targetTotalProduction: 300
|
||||
@@ -938,7 +938,7 @@ MonoBehaviour:
|
||||
spawnWeight: 30
|
||||
minCount: 0
|
||||
maxCount: 99999
|
||||
obstacleDensity: 0.01
|
||||
obstacleDensity: 0.02
|
||||
maxTotalObstacles: 10000
|
||||
minDistanceBetweenObstacles: 2
|
||||
checkCollision: 1
|
||||
@@ -951,14 +951,17 @@ MonoBehaviour:
|
||||
scaleVariation: 0.2
|
||||
maxObstacleSpawnAttempts: 50
|
||||
creepCampPrefab: {fileID: 3360908504529629757, guid: 41d918243a20cbd4d8f1558ac8345e9b, type: 3}
|
||||
minDistanceBetweenCamps: 60
|
||||
minDistanceFromCoreCamps: 60
|
||||
minDistanceFromBarracksCamps: 60
|
||||
minDistanceFromInitialResource: 60
|
||||
additionalCreepCampCount: 5
|
||||
baseCampStrength: 3
|
||||
minDistanceBetweenCamps: 30
|
||||
minDistanceFromCoreCamps: 0
|
||||
minDistanceFromBarracksCamps: 0
|
||||
minDistanceFromInitialResource: 20
|
||||
additionalCreepCampCount: 200
|
||||
baseCampStrength: 1
|
||||
strengthIncreasePerZ100: 0.1
|
||||
resourceCampStrengthBonus: 0.2
|
||||
resourceCampStrengthBonus: 1.2
|
||||
campCostBudget: 5
|
||||
spawnRadius: 5
|
||||
maxSpawnAttempts: 50
|
||||
generateResourcesFirst: 1
|
||||
--- !u!4 &672563223
|
||||
Transform:
|
||||
@@ -1672,15 +1675,15 @@ PrefabInstance:
|
||||
m_Modifications:
|
||||
- target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 36.14601
|
||||
value: 20
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0.00002002716
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 117.27692
|
||||
value: 750
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
@@ -1712,7 +1715,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3432047510330746227, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: EnemyPortal (1)
|
||||
value: EnemyPortal - Right
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
|
||||
propertyPath: initialCost
|
||||
@@ -1967,7 +1970,7 @@ Transform:
|
||||
m_GameObject: {fileID: 1290143989}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0.38268343, y: -0.00000022436976, z: 0.00000009293699, w: 0.92387956}
|
||||
m_LocalPosition: {x: 0, y: 19, z: -18}
|
||||
m_LocalPosition: {x: -16.14601, y: 18.99998, z: 514.7231}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
@@ -2613,7 +2616,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: 19ca9afdd7bb3a64c9036c18e8cee5f2, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 300
|
||||
value: 400
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: -8679921383154817045, guid: 19ca9afdd7bb3a64c9036c18e8cee5f2, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
@@ -2862,15 +2865,15 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6727958582834582256, guid: ace4a11b046dac9498e6897c2b5eb245, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 26.14601
|
||||
value: 10
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6727958582834582256, guid: ace4a11b046dac9498e6897c2b5eb245, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0.00002002716
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6727958582834582256, guid: ace4a11b046dac9498e6897c2b5eb245, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: -622.7231
|
||||
value: 10
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6727958582834582256, guid: ace4a11b046dac9498e6897c2b5eb245, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
@@ -2915,15 +2918,15 @@ PrefabInstance:
|
||||
m_Modifications:
|
||||
- target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -3.8539906
|
||||
value: -20
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0.00002002716
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 117.27692
|
||||
value: 750
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 228462577495887354, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
@@ -2955,7 +2958,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3432047510330746227, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: EnemyPortal
|
||||
value: EnemyPortal - Left
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
|
||||
propertyPath: initialCost
|
||||
@@ -3387,15 +3390,15 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8064559726283331702, guid: e56926eda34629f4fbf3e4c53f0f8bd4, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 16.14601
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8064559726283331702, guid: e56926eda34629f4fbf3e4c53f0f8bd4, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: -0.99998
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8064559726283331702, guid: e56926eda34629f4fbf3e4c53f0f8bd4, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: -622.7231
|
||||
value: 10
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8064559726283331702, guid: e56926eda34629f4fbf3e4c53f0f8bd4, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
@@ -3449,15 +3452,15 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3247786716306397435, guid: f395fcc064a3a834ba957327f1387c19, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -13.853991
|
||||
value: -30
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3247786716306397435, guid: f395fcc064a3a834ba957327f1387c19, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0.00002002716
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3247786716306397435, guid: f395fcc064a3a834ba957327f1387c19, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: -622.7231
|
||||
value: 10
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3247786716306397435, guid: f395fcc064a3a834ba957327f1387c19, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
|
||||
@@ -11,20 +11,22 @@ namespace Northbound
|
||||
[Tooltip("Creep prefabs available to spawn")]
|
||||
[SerializeField] private List<GameObject> creepPrefabs = new List<GameObject>();
|
||||
|
||||
[Header("Spawning Settings")]
|
||||
[Tooltip("Camp strength multiplier (higher = stronger creeps)")]
|
||||
[SerializeField] private float campStrength = 1f;
|
||||
[Header("Reward Settings")]
|
||||
[Tooltip("Resource pickup prefab to spawn when all creeps are defeated")]
|
||||
[SerializeField] private GameObject resourcePickupPrefab;
|
||||
|
||||
[Tooltip("Cost budget for spawning creeps")]
|
||||
[SerializeField] private float campCostBudget = 10f;
|
||||
|
||||
[Tooltip("Spawn radius around camp")]
|
||||
[SerializeField] private float spawnRadius = 5f;
|
||||
|
||||
[Tooltip("Max creep spawn attempts")]
|
||||
[SerializeField] private int maxSpawnAttempts = 50;
|
||||
[Tooltip("Base resource amount multiplier (actual amount = this * camp strength)")]
|
||||
[SerializeField] private int baseResourceAmount = 50;
|
||||
|
||||
private float _zPosition;
|
||||
private float _campStrength;
|
||||
private float _campCostBudget;
|
||||
private float _spawnRadius;
|
||||
private int _maxSpawnAttempts;
|
||||
|
||||
private readonly List<EnemyUnit> _spawnedCreeps = new List<EnemyUnit>();
|
||||
private ResourcePickup _resourcePickup;
|
||||
private readonly Dictionary<EnemyUnit, System.Action<ulong>> _deathHandlers = new Dictionary<EnemyUnit, System.Action<ulong>>();
|
||||
|
||||
public override void OnNetworkSpawn()
|
||||
{
|
||||
@@ -34,10 +36,34 @@ namespace Northbound
|
||||
}
|
||||
}
|
||||
|
||||
public void InitializeCamp(float zPosition, float strengthMultiplier)
|
||||
public override void OnNetworkDespawn()
|
||||
{
|
||||
base.OnNetworkDespawn();
|
||||
|
||||
if (IsServer)
|
||||
{
|
||||
// 모든 이벤트 구독 해제
|
||||
foreach (var kvp in _deathHandlers)
|
||||
{
|
||||
if (kvp.Key != null && kvp.Value != null)
|
||||
{
|
||||
kvp.Key.OnDeath -= kvp.Value;
|
||||
}
|
||||
}
|
||||
|
||||
// 리스트와 딕셔너리 비우기
|
||||
_spawnedCreeps.Clear();
|
||||
_deathHandlers.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public void InitializeCamp(float zPosition, float strengthMultiplier, float costBudget, float radius, int maxAttempts)
|
||||
{
|
||||
_zPosition = zPosition;
|
||||
campStrength = strengthMultiplier;
|
||||
_campStrength = strengthMultiplier;
|
||||
_campCostBudget = costBudget;
|
||||
_spawnRadius = radius;
|
||||
_maxSpawnAttempts = maxAttempts;
|
||||
}
|
||||
|
||||
public void SetCreepPrefabs(List<GameObject> prefabs)
|
||||
@@ -48,23 +74,24 @@ namespace Northbound
|
||||
|
||||
private void SpawnCreeps()
|
||||
{
|
||||
|
||||
if (creepPrefabs.Count == 0)
|
||||
{
|
||||
Debug.LogWarning($"[CreepCamp] No creep prefabs assigned!");
|
||||
return;
|
||||
}
|
||||
|
||||
float remainingCost = campCostBudget * campStrength;
|
||||
// 리소스 픽업 스폰 (비활성화 상태로)
|
||||
SpawnResourcePickup();
|
||||
|
||||
float remainingCost = _campCostBudget * _campStrength;
|
||||
int spawnedCount = 0;
|
||||
|
||||
for (int attempt = 0; attempt < maxSpawnAttempts && remainingCost > 0; attempt++)
|
||||
for (int attempt = 0; attempt < _maxSpawnAttempts && remainingCost > 0; attempt++)
|
||||
{
|
||||
GameObject selectedCreep = SelectCreepByCost(remainingCost);
|
||||
if (selectedCreep == null)
|
||||
{
|
||||
Debug.LogWarning($"[CreepCamp] Could not select creep (attempt {attempt + 1}/{maxSpawnAttempts}), remaining cost: {remainingCost:F2}");
|
||||
Debug.LogWarning($"[CreepCamp] No affordable creeps. Remaining cost: {remainingCost:F2}");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -75,21 +102,12 @@ namespace Northbound
|
||||
continue;
|
||||
}
|
||||
|
||||
if (creepData.cost > remainingCost)
|
||||
{
|
||||
if (!CanSpawnAnyCreep(remainingCost))
|
||||
{
|
||||
Debug.LogWarning($"[CreepCamp] No affordable creeps found. Remaining cost: {remainingCost:F2}");
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
SpawnCreep(selectedCreep);
|
||||
remainingCost -= creepData.cost;
|
||||
spawnedCount++;
|
||||
}
|
||||
|
||||
Debug.Log($"<color=green>[CreepCamp] Spawned {spawnedCount} creeps (Cost budget: {_campCostBudget * _campStrength:F2}, Used: {(_campCostBudget * _campStrength) - remainingCost:F2})</color>");
|
||||
}
|
||||
|
||||
private GameObject SelectCreepByCost(float remainingCost)
|
||||
@@ -157,6 +175,85 @@ namespace Northbound
|
||||
return false;
|
||||
}
|
||||
|
||||
private void SpawnResourcePickup()
|
||||
{
|
||||
if (resourcePickupPrefab == null)
|
||||
{
|
||||
Debug.LogWarning($"[CreepCamp] No resource pickup prefab assigned!");
|
||||
return;
|
||||
}
|
||||
|
||||
GameObject pickup = Instantiate(resourcePickupPrefab, transform.position, Quaternion.identity);
|
||||
|
||||
_resourcePickup = pickup.GetComponent<ResourcePickup>();
|
||||
if (_resourcePickup == null)
|
||||
{
|
||||
Debug.LogError($"[CreepCamp] ResourcePickup component not found on prefab!");
|
||||
Destroy(pickup);
|
||||
return;
|
||||
}
|
||||
|
||||
// 캠프 강도에 비례하여 리소스 양 설정
|
||||
_resourcePickup.resourceAmount = Mathf.RoundToInt(baseResourceAmount * _campStrength);
|
||||
|
||||
// NetworkObject 추가 및 스폰
|
||||
NetworkObject networkObj = pickup.GetComponent<NetworkObject>();
|
||||
if (networkObj == null)
|
||||
{
|
||||
networkObj = pickup.AddComponent<NetworkObject>();
|
||||
}
|
||||
|
||||
networkObj.SpawnWithOwnership(NetworkManager.Singleton.LocalClientId);
|
||||
|
||||
// 비활성화는 ServerRpc를 통해 처리
|
||||
DisablePickupClientRpc();
|
||||
|
||||
Debug.Log($"<color=cyan>[CreepCamp] Resource pickup spawned (Amount: {_resourcePickup.resourceAmount})</color>");
|
||||
}
|
||||
|
||||
private void HandleCreepDeath(EnemyUnit deadCreep)
|
||||
{
|
||||
// 이벤트 구독 해제 (메모리 누수 방지)
|
||||
if (_deathHandlers.ContainsKey(deadCreep))
|
||||
{
|
||||
if (deadCreep != null)
|
||||
{
|
||||
deadCreep.OnDeath -= _deathHandlers[deadCreep];
|
||||
}
|
||||
_deathHandlers.Remove(deadCreep);
|
||||
}
|
||||
|
||||
// 리스트에서 해당 creep 제거
|
||||
_spawnedCreeps.Remove(deadCreep);
|
||||
|
||||
Debug.Log($"<color=orange>[CreepCamp] Creep died. Remaining creeps: {_spawnedCreeps.Count}</color>");
|
||||
|
||||
// 모든 creep이 처치되었으면 ResourcePickup 활성화
|
||||
if (_spawnedCreeps.Count == 0 && _resourcePickup != null)
|
||||
{
|
||||
EnableResourcePickupClientRpc();
|
||||
Debug.Log($"<color=green>[CreepCamp] All creeps defeated! Resource pickup enabled.</color>");
|
||||
}
|
||||
}
|
||||
|
||||
[Rpc(SendTo.ClientsAndHost)]
|
||||
private void EnableResourcePickupClientRpc()
|
||||
{
|
||||
if (_resourcePickup != null)
|
||||
{
|
||||
_resourcePickup.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
[Rpc(SendTo.ClientsAndHost)]
|
||||
private void DisablePickupClientRpc()
|
||||
{
|
||||
if (_resourcePickup != null)
|
||||
{
|
||||
_resourcePickup.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
private CreepData GetCreepDataFromPrefab(GameObject prefab)
|
||||
{
|
||||
if (prefab == null) return null;
|
||||
@@ -172,7 +269,7 @@ namespace Northbound
|
||||
|
||||
private void SpawnCreep(GameObject prefab)
|
||||
{
|
||||
Vector3 spawnOffset = Random.insideUnitSphere * spawnRadius;
|
||||
Vector3 spawnOffset = Random.insideUnitSphere * _spawnRadius;
|
||||
spawnOffset.y = 0;
|
||||
|
||||
GameObject creep = Instantiate(prefab, transform.position + spawnOffset, Quaternion.identity);
|
||||
@@ -190,19 +287,34 @@ namespace Northbound
|
||||
networkObj = creep.AddComponent<NetworkObject>();
|
||||
}
|
||||
|
||||
// EnemyUnit 참조 저장 및 이벤트 구독
|
||||
EnemyUnit enemyUnit = creep.GetComponent<EnemyUnit>();
|
||||
if (enemyUnit != null)
|
||||
{
|
||||
_spawnedCreeps.Add(enemyUnit);
|
||||
// Dictionary에 핸들러 저장 (메모리 누수 방지)
|
||||
System.Action<ulong> handler = (killerId) => HandleCreepDeath(enemyUnit);
|
||||
_deathHandlers[enemyUnit] = handler;
|
||||
enemyUnit.OnDeath += handler;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[CreepCamp] EnemyUnit component not found on creep prefab {prefab.name}");
|
||||
}
|
||||
|
||||
networkObj.SpawnWithOwnership(NetworkManager.Singleton.LocalClientId);
|
||||
}
|
||||
|
||||
private void OnDrawGizmos()
|
||||
{
|
||||
Gizmos.color = Color.red;
|
||||
Gizmos.DrawWireSphere(transform.position, spawnRadius);
|
||||
Gizmos.DrawWireSphere(transform.position, _spawnRadius);
|
||||
}
|
||||
|
||||
private void OnDrawGizmosSelected()
|
||||
{
|
||||
Gizmos.color = new Color(1f, 0f, 0f, 0.3f);
|
||||
Gizmos.DrawSphere(transform.position, spawnRadius);
|
||||
Gizmos.DrawSphere(transform.position, _spawnRadius);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace Northbound
|
||||
[Tooltip("초기 자원과의 최소 거리")]
|
||||
[SerializeField] private float minDistanceFromInitialResource = 30f;
|
||||
[Tooltip("추가 크립 캠프 개수")]
|
||||
[Range(0, 10)]
|
||||
[Range(0, 1000)]
|
||||
[SerializeField] private int additionalCreepCampCount = 5;
|
||||
[Tooltip("크립 캠프 강도 기본값")]
|
||||
[SerializeField] private float baseCampStrength = 1f;
|
||||
@@ -107,6 +107,15 @@ namespace Northbound
|
||||
[Tooltip("자원 보호 캠프 강도 보너스 (far camp보다 얼마나 강할지)")]
|
||||
[SerializeField] private float resourceCampStrengthBonus = 0.5f;
|
||||
|
||||
[Tooltip("크립 스폰 비용 예산")]
|
||||
[SerializeField] private float campCostBudget = 10f;
|
||||
|
||||
[Tooltip("스폰 반경 (캠프 주변)")]
|
||||
[SerializeField] private float spawnRadius = 5f;
|
||||
|
||||
[Tooltip("최대 크립 스폰 시도 횟수")]
|
||||
[SerializeField] private int maxSpawnAttempts = 50;
|
||||
|
||||
[Header("Generation Order")]
|
||||
[Tooltip("자원 먼저 생성 후 장애물 생성 (true) 또는 그 반대 (false)")]
|
||||
[SerializeField] private bool generateResourcesFirst = true;
|
||||
@@ -558,11 +567,10 @@ namespace Northbound
|
||||
|
||||
private Vector3 GetRandomPositionInPlayableArea()
|
||||
{
|
||||
Vector3 center = transform.position;
|
||||
float x = Random.Range(-playableAreaWidth / 2f, playableAreaWidth / 2f);
|
||||
float z = Random.Range(startZ, endZ);
|
||||
|
||||
Vector3 result = new Vector3(x, center.y, z);
|
||||
Vector3 result = new Vector3(x, 1, z);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -845,7 +853,7 @@ namespace Northbound
|
||||
return;
|
||||
}
|
||||
|
||||
creepCamp.InitializeCamp(position.z, strength);
|
||||
creepCamp.InitializeCamp(position.z, strength, campCostBudget, spawnRadius, maxSpawnAttempts);
|
||||
creepCamp.SetCreepPrefabs(_creepPrefabs);
|
||||
Debug.Log($"[MapGenerator] Camp initialized with {_creepPrefabs.Count} creep prefabs");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user