디버깅용 로그 제거
This commit is contained in:
@@ -162,7 +162,6 @@ namespace Northbound
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("[MapGenerator] Core not found in scene!");
|
||||
_corePosition = Vector2.zero;
|
||||
}
|
||||
|
||||
@@ -178,7 +177,6 @@ namespace Northbound
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("[MapGenerator] No Resource found in scene!");
|
||||
_initialResourcePosition = Vector2.zero;
|
||||
}
|
||||
|
||||
@@ -189,7 +187,6 @@ namespace Northbound
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("[MapGenerator] Worker Hall not found in scene!");
|
||||
_barracksPosition = Vector2.zero;
|
||||
}
|
||||
}
|
||||
@@ -219,7 +216,6 @@ namespace Northbound
|
||||
{
|
||||
if (resourcePrefab == null)
|
||||
{
|
||||
Debug.LogError("[MapGenerator] Resource prefab not assigned!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -231,20 +227,13 @@ namespace Northbound
|
||||
{
|
||||
_generatedResources = resources;
|
||||
success = true;
|
||||
Debug.Log($"<color=green>[MapGenerator] Normal resource generation succeeded on attempt {attempt + 1}</color>");
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"[MapGenerator] Resource generation attempt {attempt + 1} failed validation");
|
||||
}
|
||||
}
|
||||
|
||||
if (!success)
|
||||
{
|
||||
Debug.LogWarning("<color=yellow>[MapGenerator] All resource generation attempts failed, using fallback layout</color>");
|
||||
GenerateResourceFallbackLayout();
|
||||
Debug.Log($"<color=yellow>[MapGenerator] Fallback layout X coordinates: {string.Join(", ", System.Array.ConvertAll(_generatedResources, r => r.position.x.ToString("F1")))}</color>");
|
||||
}
|
||||
|
||||
SpawnResources();
|
||||
@@ -309,7 +298,6 @@ namespace Northbound
|
||||
if (IsValidResourcePosition(candidatePosition, existingResources, currentIndex))
|
||||
{
|
||||
position = candidatePosition;
|
||||
Debug.Log($"[MapGenerator] Generated valid resource position: X={position.x:F2} (range: {-playableAreaWidth/2f:F2} to {playableAreaWidth/2f:F2})");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -414,7 +402,6 @@ namespace Northbound
|
||||
Resource resource = resourceObj.GetComponent<Resource>();
|
||||
if (resource == null)
|
||||
{
|
||||
Debug.LogError($"[MapGenerator] Resource prefab at index {i} doesn't have Resource component!");
|
||||
Destroy(resourceObj);
|
||||
continue;
|
||||
}
|
||||
@@ -428,7 +415,6 @@ namespace Northbound
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError($"[MapGenerator] Resource prefab at index {i} doesn't have NetworkObject component!");
|
||||
Destroy(resourceObj);
|
||||
}
|
||||
|
||||
@@ -456,7 +442,6 @@ namespace Northbound
|
||||
{
|
||||
if (obstacle.prefab == null)
|
||||
{
|
||||
Debug.LogWarning($"[MapGenerator] Obstacle prefab is null!");
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -657,7 +642,6 @@ namespace Northbound
|
||||
{
|
||||
if (creepCampPrefab == null)
|
||||
{
|
||||
Debug.LogWarning("[MapGenerator] Creep camp prefab not assigned, skipping creep camp generation.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -665,7 +649,6 @@ namespace Northbound
|
||||
|
||||
if (_creepPrefabs.Count == 0)
|
||||
{
|
||||
Debug.LogWarning("[MapGenerator] No creep prefabs found in Assets/Prefabs/Creep/, skipping creep camp generation.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -721,13 +704,8 @@ namespace Northbound
|
||||
}
|
||||
}
|
||||
#else
|
||||
Debug.LogWarning("[MapGenerator] Creep prefabs not loaded in build. Please assign creep prefabs manually in Inspector.");
|
||||
// Creep prefabs not available in build - please assign manually
|
||||
#endif
|
||||
|
||||
if (_creepPrefabs.Count == 0)
|
||||
{
|
||||
Debug.LogWarning("[MapGenerator] No creep prefabs loaded!");
|
||||
}
|
||||
}
|
||||
|
||||
private Vector3 FindValidCampPosition()
|
||||
@@ -791,8 +769,6 @@ namespace Northbound
|
||||
float bestDistance = float.MaxValue;
|
||||
int maxAttempts = 50;
|
||||
|
||||
Debug.Log($"[MapGenerator] FindValidCampPositionForResource: Resource at {resourcePosition}, bounds: X:[{-playableAreaWidth/2f}, {playableAreaWidth/2f}], Z:[{startZ}, {endZ}]");
|
||||
|
||||
for (int attempt = 0; attempt < maxAttempts; attempt++)
|
||||
{
|
||||
float angle = Random.Range(0f, 360f);
|
||||
@@ -813,11 +789,6 @@ namespace Northbound
|
||||
}
|
||||
}
|
||||
|
||||
if (bestPosition == Vector3.zero)
|
||||
{
|
||||
Debug.LogWarning($"[MapGenerator] Failed to find camp position for resource at {resourcePosition} after {maxAttempts} attempts");
|
||||
}
|
||||
|
||||
return bestPosition;
|
||||
}
|
||||
|
||||
@@ -855,7 +826,6 @@ namespace Northbound
|
||||
|
||||
creepCamp.InitializeCamp(position.z, strength, campCostBudget, spawnRadius, maxSpawnAttempts);
|
||||
creepCamp.SetCreepPrefabs(_creepPrefabs);
|
||||
Debug.Log($"[MapGenerator] Camp initialized with {_creepPrefabs.Count} creep prefabs");
|
||||
|
||||
NetworkObject networkObj = campObj.GetComponent<NetworkObject>();
|
||||
if (networkObj == null)
|
||||
|
||||
Reference in New Issue
Block a user