포탈이 글로벌 타이머 사이클에 맞춰 웨이브를 소환하도록 함

시작 코스트 4, 웨이브당 증가량 10%
This commit is contained in:
2026-01-31 21:36:56 +09:00
parent d055591dcc
commit b54e016283
12 changed files with 252 additions and 55 deletions

5
.gitignore vendored
View File

@@ -8,4 +8,7 @@
[Uu]ser[Ss]ettings/ [Uu]ser[Ss]ettings/
.vs .vs
.vs/* .vs/*
.vscode
Assets/_Recovery
Assets/_Recovery.meta

View File

@@ -43,13 +43,13 @@
<UnityVersion>6000.3.5f2</UnityVersion> <UnityVersion>6000.3.5f2</UnityVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Analyzer Include="C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\Extensions\Microsoft\Visual Studio Tools for Unity\Analyzers\Microsoft.Unity.Analyzers.dll" />
<Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.SourceGenerators.dll" /> <Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.SourceGenerators.dll" />
<Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.Properties.SourceGenerator.dll" /> <Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.Properties.SourceGenerator.dll" />
<Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.UIToolkit.SourceGenerator.dll" /> <Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.UIToolkit.SourceGenerator.dll" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Assets\FlatKit\[Render Pipeline] URP\Water\Editor\Tooltips.cs" /> <Compile Include="Assets\FlatKit\[Render Pipeline] URP\Water\Editor\Tooltips.cs" />
<Compile Include="Assets\Scripts\Editor\EnemyPortalEditor.cs" />
<Compile Include="Assets\Editor\DataImporter\ImporterWindow.cs" /> <Compile Include="Assets\Editor\DataImporter\ImporterWindow.cs" />
<Compile Include="Assets\Scripts\Editor\ObstacleSpawnerEditor.cs" /> <Compile Include="Assets\Scripts\Editor\ObstacleSpawnerEditor.cs" />
<Compile Include="Assets\Editor\DataImporter\CSVDebugger.cs" /> <Compile Include="Assets\Editor\DataImporter\CSVDebugger.cs" />
@@ -1245,14 +1245,14 @@
<HintPath>Library\ScriptAssemblies\PPv2URPConverters.dll</HintPath> <HintPath>Library\ScriptAssemblies\PPv2URPConverters.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="Unity.2D.Common.Editor">
<HintPath>Library\ScriptAssemblies\Unity.2D.Common.Editor.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Unity.AI.Navigation.Updater"> <Reference Include="Unity.AI.Navigation.Updater">
<HintPath>Library\ScriptAssemblies\Unity.AI.Navigation.Updater.dll</HintPath> <HintPath>Library\ScriptAssemblies\Unity.AI.Navigation.Updater.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="Unity.2D.Common.Editor">
<HintPath>Library\ScriptAssemblies\Unity.2D.Common.Editor.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Unity.AI.Navigation.Editor"> <Reference Include="Unity.AI.Navigation.Editor">
<HintPath>Library\ScriptAssemblies\Unity.AI.Navigation.Editor.dll</HintPath> <HintPath>Library\ScriptAssemblies\Unity.AI.Navigation.Editor.dll</HintPath>
<Private>False</Private> <Private>False</Private>
@@ -1289,10 +1289,6 @@
<HintPath>Library\ScriptAssemblies\Unity.2D.Aseprite.Common.dll</HintPath> <HintPath>Library\ScriptAssemblies\Unity.2D.Aseprite.Common.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="Unity.Rider.Editor">
<HintPath>Library\ScriptAssemblies\Unity.Rider.Editor.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Unity.AI.Navigation.Editor.ConversionSystem"> <Reference Include="Unity.AI.Navigation.Editor.ConversionSystem">
<HintPath>Library\ScriptAssemblies\Unity.AI.Navigation.Editor.ConversionSystem.dll</HintPath> <HintPath>Library\ScriptAssemblies\Unity.AI.Navigation.Editor.ConversionSystem.dll</HintPath>
<Private>False</Private> <Private>False</Private>
@@ -1301,6 +1297,10 @@
<HintPath>Library\ScriptAssemblies\Unity.2D.Aseprite.Editor.dll</HintPath> <HintPath>Library\ScriptAssemblies\Unity.2D.Aseprite.Editor.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="Unity.Rider.Editor">
<HintPath>Library\ScriptAssemblies\Unity.Rider.Editor.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary"> <Reference Include="Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary">
<HintPath>Library\ScriptAssemblies\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll</HintPath> <HintPath>Library\ScriptAssemblies\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll</HintPath>
<Private>False</Private> <Private>False</Private>

View File

@@ -43,14 +43,12 @@
<UnityVersion>6000.3.5f2</UnityVersion> <UnityVersion>6000.3.5f2</UnityVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Analyzer Include="C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\Extensions\Microsoft\Visual Studio Tools for Unity\Analyzers\Microsoft.Unity.Analyzers.dll" />
<Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.SourceGenerators.dll" /> <Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.SourceGenerators.dll" />
<Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.Properties.SourceGenerator.dll" /> <Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.Properties.SourceGenerator.dll" />
<Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.UIToolkit.SourceGenerator.dll" /> <Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.UIToolkit.SourceGenerator.dll" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Assets\Scripts\NetworkManagerUI.cs" /> <Compile Include="Assets\Scripts\NetworkManagerUI.cs" />
<Compile Include="Assets\Data\Scripts\DataClasses\WaveMasterData.cs" />
<Compile Include="Assets\FlatKit\Demos\[Demo] Desert\Scripts\FloatingMotion.cs" /> <Compile Include="Assets\FlatKit\Demos\[Demo] Desert\Scripts\FloatingMotion.cs" />
<Compile Include="Assets\Scripts\PlayerResourceInventory.cs" /> <Compile Include="Assets\Scripts\PlayerResourceInventory.cs" />
<Compile Include="Assets\Scripts\ITeamMember.cs" /> <Compile Include="Assets\Scripts\ITeamMember.cs" />
@@ -69,6 +67,7 @@
<Compile Include="Assets\Scripts\BuildingDamageTest.cs" /> <Compile Include="Assets\Scripts\BuildingDamageTest.cs" />
<Compile Include="Assets\Scripts\EnemyAIController.cs" /> <Compile Include="Assets\Scripts\EnemyAIController.cs" />
<Compile Include="Assets\Scripts\EquipmentSocket.cs" /> <Compile Include="Assets\Scripts\EquipmentSocket.cs" />
<Compile Include="Assets\Data\Scripts\DataClasses\PlayerData.cs" />
<Compile Include="Assets\Scripts\TeamManager.cs" /> <Compile Include="Assets\Scripts\TeamManager.cs" />
<Compile Include="Assets\Scripts\TeamGate.cs" /> <Compile Include="Assets\Scripts\TeamGate.cs" />
<Compile Include="Assets\Scripts\BuildingData.cs" /> <Compile Include="Assets\Scripts\BuildingData.cs" />
@@ -83,7 +82,6 @@
<Compile Include="Assets\FlatKit\Demos\Common\Scripts\UvScroller.cs" /> <Compile Include="Assets\FlatKit\Demos\Common\Scripts\UvScroller.cs" />
<Compile Include="Assets\Scripts\GlobalTimer.cs" /> <Compile Include="Assets\Scripts\GlobalTimer.cs" />
<Compile Include="Assets\InputSystem_Actions.cs" /> <Compile Include="Assets\InputSystem_Actions.cs" />
<Compile Include="Assets\Data\Scripts\DataClasses\MonsterMasterData.cs" />
<Compile Include="Assets\FlatKit\Demos\[Demo] Desert\Scripts\BillboardLineRendererCircle.cs" /> <Compile Include="Assets\FlatKit\Demos\[Demo] Desert\Scripts\BillboardLineRendererCircle.cs" />
<Compile Include="Assets\Scripts\BuildingHealthBar.cs" /> <Compile Include="Assets\Scripts\BuildingHealthBar.cs" />
<Compile Include="Assets\Scripts\PlayerSpawnPoint.cs" /> <Compile Include="Assets\Scripts\PlayerSpawnPoint.cs" />
@@ -99,10 +97,13 @@
<Compile Include="Assets\Scripts\IDamageable.cs" /> <Compile Include="Assets\Scripts\IDamageable.cs" />
<Compile Include="Assets\Scripts\NetworkSpawnManager.cs" /> <Compile Include="Assets\Scripts\NetworkSpawnManager.cs" />
<Compile Include="Assets\Scripts\FogOfWarSystem.cs" /> <Compile Include="Assets\Scripts\FogOfWarSystem.cs" />
<Compile Include="Assets\Data\Scripts\DataClasses\MonsterData.cs" />
<Compile Include="Assets\Data\Scripts\DataClasses\TowerData.cs" />
<Compile Include="Assets\Scripts\IAction.cs" /> <Compile Include="Assets\Scripts\IAction.cs" />
<Compile Include="Assets\Scripts\NetworkPlayerController.cs" /> <Compile Include="Assets\Scripts\NetworkPlayerController.cs" />
<Compile Include="Assets\Scripts\PlayerInteraction.cs" /> <Compile Include="Assets\Scripts\PlayerInteraction.cs" />
<Compile Include="Assets\Scripts\FogOfWarVisibility.cs" /> <Compile Include="Assets\Scripts\FogOfWarVisibility.cs" />
<Compile Include="Assets\Data\Scripts\DataClasses\DefaultSettingsData.cs" />
<Compile Include="Assets\Scripts\EnemyAIState.cs" /> <Compile Include="Assets\Scripts\EnemyAIState.cs" />
<Compile Include="Assets\Scripts\EquipmentData.cs" /> <Compile Include="Assets\Scripts\EquipmentData.cs" />
<Compile Include="Assets\Scripts\NetworkConnectionHandler.cs" /> <Compile Include="Assets\Scripts\NetworkConnectionHandler.cs" />
@@ -1263,14 +1264,14 @@
<HintPath>Library\ScriptAssemblies\PPv2URPConverters.dll</HintPath> <HintPath>Library\ScriptAssemblies\PPv2URPConverters.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="Unity.2D.Common.Editor">
<HintPath>Library\ScriptAssemblies\Unity.2D.Common.Editor.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Unity.AI.Navigation.Updater"> <Reference Include="Unity.AI.Navigation.Updater">
<HintPath>Library\ScriptAssemblies\Unity.AI.Navigation.Updater.dll</HintPath> <HintPath>Library\ScriptAssemblies\Unity.AI.Navigation.Updater.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="Unity.2D.Common.Editor">
<HintPath>Library\ScriptAssemblies\Unity.2D.Common.Editor.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Unity.AI.Navigation.Editor"> <Reference Include="Unity.AI.Navigation.Editor">
<HintPath>Library\ScriptAssemblies\Unity.AI.Navigation.Editor.dll</HintPath> <HintPath>Library\ScriptAssemblies\Unity.AI.Navigation.Editor.dll</HintPath>
<Private>False</Private> <Private>False</Private>
@@ -1307,10 +1308,6 @@
<HintPath>Library\ScriptAssemblies\Unity.2D.Aseprite.Common.dll</HintPath> <HintPath>Library\ScriptAssemblies\Unity.2D.Aseprite.Common.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="Unity.Rider.Editor">
<HintPath>Library\ScriptAssemblies\Unity.Rider.Editor.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Unity.AI.Navigation.Editor.ConversionSystem"> <Reference Include="Unity.AI.Navigation.Editor.ConversionSystem">
<HintPath>Library\ScriptAssemblies\Unity.AI.Navigation.Editor.ConversionSystem.dll</HintPath> <HintPath>Library\ScriptAssemblies\Unity.AI.Navigation.Editor.ConversionSystem.dll</HintPath>
<Private>False</Private> <Private>False</Private>
@@ -1319,6 +1316,10 @@
<HintPath>Library\ScriptAssemblies\Unity.2D.Aseprite.Editor.dll</HintPath> <HintPath>Library\ScriptAssemblies\Unity.2D.Aseprite.Editor.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="Unity.Rider.Editor">
<HintPath>Library\ScriptAssemblies\Unity.Rider.Editor.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary"> <Reference Include="Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary">
<HintPath>Library\ScriptAssemblies\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll</HintPath> <HintPath>Library\ScriptAssemblies\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll</HintPath>
<Private>False</Private> <Private>False</Private>

View File

@@ -19,6 +19,6 @@ MonoBehaviour:
atkRange: 1 atkRange: 1
atkDamage: 3 atkDamage: 3
atkIntervalSec: 1.2 atkIntervalSec: 1.2
prefabPath: Assets/Prefabs/EnemyTest prefabPath: Assets/Prefabs/EnemyTest.prefab
cost: 1 cost: 1
weight: 1 weight: 1

View File

@@ -19,6 +19,6 @@ MonoBehaviour:
atkRange: 1 atkRange: 1
atkDamage: 2 atkDamage: 2
atkIntervalSec: 1 atkIntervalSec: 1
prefabPath: Assets/Prefabs/MonsterTest prefabPath: Assets/Prefabs/MonsterTest.prefab
cost: 2 cost: 2
weight: 0.5 weight: 0.5

View File

@@ -1891,6 +1891,26 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: EnemyPortal (1) value: EnemyPortal (1)
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.size
value: 2
objectReference: {fileID: 0}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.data[0].prefab
value:
objectReference: {fileID: 8774623643640324048, guid: c92c9f1bf0ae6364f85409ecdc4aeaf3, type: 3}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.data[1].prefab
value:
objectReference: {fileID: 5176576196123937037, guid: 951b69041a2ace947afd721fefb3eaba, type: 3}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.data[0].monsterData
value:
objectReference: {fileID: 11400000, guid: cec2336a0be4b6c4eb954ac3d08aa8d9, type: 2}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.data[1].monsterData
value:
objectReference: {fileID: 11400000, guid: fde07a19ade09f044aca9151f407d073, type: 2}
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
@@ -2341,10 +2361,10 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Northbound.GlobalTimer m_EditorClassIdentifier: Assembly-CSharp::Northbound.GlobalTimer
ShowTopMostFoldoutHeaderGroup: 1 ShowTopMostFoldoutHeaderGroup: 1
cycleLength: 90 cycleLength: 5
autoStart: 1 autoStart: 1
pauseOnZero: 0 pauseOnZero: 0
exceptionalFirstCycleLength: 10 exceptionalFirstCycleLength: 1
showDebugLogs: 1 showDebugLogs: 1
--- !u!4 &1442785555 --- !u!4 &1442785555
Transform: Transform:
@@ -3224,6 +3244,26 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: EnemyPortal value: EnemyPortal
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.size
value: 2
objectReference: {fileID: 0}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.data[0].prefab
value:
objectReference: {fileID: 8774623643640324048, guid: c92c9f1bf0ae6364f85409ecdc4aeaf3, type: 3}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.data[1].prefab
value:
objectReference: {fileID: 5176576196123937037, guid: 951b69041a2ace947afd721fefb3eaba, type: 3}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.data[0].monsterData
value:
objectReference: {fileID: 11400000, guid: cec2336a0be4b6c4eb954ac3d08aa8d9, type: 2}
- target: {fileID: 6859825394817103090, guid: 11e3760dda2c0164abf759c18d918893, type: 3}
propertyPath: monsterEntries.Array.data[1].monsterData
value:
objectReference: {fileID: 11400000, guid: fde07a19ade09f044aca9151f407d073, type: 2}
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []

View File

@@ -0,0 +1,77 @@
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.Linq;
[CustomEditor(typeof(EnemyPortal))]
public class EnemyPortalEditor : Editor
{
private const string MONSTER_DATA_FOLDER = "Assets/Data/ScriptableObjects/Monster";
public override void OnInspectorGUI()
{
DrawDefaultInspector();
EnemyPortal portal = (EnemyPortal)target;
EditorGUILayout.Space();
EditorGUILayout.LabelField("Monster Data Loader", EditorStyles.boldLabel);
if (GUILayout.Button("Load Monster Data"))
{
LoadMonsterData(portal);
}
EditorGUILayout.HelpBox("Click 'Load Monster Data' to automatically load all monsters from " + MONSTER_DATA_FOLDER, MessageType.Info);
}
private void LoadMonsterData(EnemyPortal portal)
{
string[] guids = AssetDatabase.FindAssets("t:MonsterData", new[] { MONSTER_DATA_FOLDER });
List<EnemyPortal.MonsterEntry> entries = new List<EnemyPortal.MonsterEntry>();
int loadedCount = 0;
foreach (string guid in guids)
{
string assetPath = AssetDatabase.GUIDToAssetPath(guid);
Northbound.Data.MonsterData monsterData = AssetDatabase.LoadAssetAtPath<Northbound.Data.MonsterData>(assetPath);
if (monsterData != null)
{
GameObject prefab = AssetDatabase.LoadAssetAtPath<GameObject>(monsterData.prefabPath);
if (prefab != null)
{
entries.Add(new EnemyPortal.MonsterEntry
{
monsterData = monsterData,
prefab = prefab
});
loadedCount++;
}
else
{
Debug.LogWarning($"[EnemyPortal] Could not load prefab at path: {monsterData.prefabPath} for monster {monsterData.id}");
}
}
}
serializedObject.Update();
SerializedProperty entriesProperty = serializedObject.FindProperty("monsterEntries");
entriesProperty.ClearArray();
entriesProperty.arraySize = entries.Count;
for (int i = 0; i < entries.Count; i++)
{
SerializedProperty element = entriesProperty.GetArrayElementAtIndex(i);
element.FindPropertyRelative("monsterData").objectReferenceValue = entries[i].monsterData;
element.FindPropertyRelative("prefab").objectReferenceValue = entries[i].prefab;
}
serializedObject.ApplyModifiedProperties();
AssetDatabase.SaveAssets();
Debug.Log($"[EnemyPortal] Loaded {loadedCount} monsters from {MONSTER_DATA_FOLDER}");
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 70cde0c89ff88c149b6535cc2e9903b3

View File

@@ -2,43 +2,120 @@ using Northbound;
using System.Collections.Generic; using System.Collections.Generic;
using Unity.Netcode; using Unity.Netcode;
using UnityEngine; using UnityEngine;
using static Northbound.ObstacleSpawner;
using static UnityEditor.FilePathAttribute;
public class EnemyPortal : MonoBehaviour public class EnemyPortal : MonoBehaviour
{ {
[Header("Spawn Settings")] [System.Serializable]
[Tooltip("소환할 몬스터 목록")] public class MonsterEntry
[SerializeField] private List<GameObject> Enemies = new();
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{ {
GlobalTimer.Instance.OnCycleComplete += SpawnEnemy; public Northbound.Data.MonsterData monsterData;
public GameObject prefab;
} }
private void SpawnEnemy() [Header("Spawn Settings")]
{ [Tooltip("몬스터 데이터 목록 (Editor에서 자동 로드 가능)")]
foreach (GameObject obj in Enemies) [SerializeField] private List<MonsterEntry> monsterEntries = new();
{
GameObject enemy = Instantiate(obj, transform);
// Add FogOfWarVisibility component to hide enemies in unexplored areas [Header("Cost Settings")]
if (enemy.GetComponent<FogOfWarVisibility>() == null) [Tooltip("시간당 코스트 시작 값")]
[SerializeField] private float initialCost = 4f;
[Tooltip("사이클마다 코스트 증가율 (%)")]
[SerializeField] private float costIncreaseRate = 10f;
private float currentCost;
void Start()
{
currentCost = initialCost;
GlobalTimer.Instance.OnCycleStart += OnCycleStart;
}
private void OnCycleStart(int cycleNumber)
{
SpawnMonsters();
IncreaseCost();
}
private void SpawnMonsters()
{
float remainingCost = currentCost;
int spawnedCount = 0;
while (remainingCost > 0 && monsterEntries.Count > 0)
{
MonsterEntry selectedEntry = SelectMonsterByWeight();
if (selectedEntry.monsterData.cost > remainingCost)
{ {
var visibility = enemy.AddComponent<FogOfWarVisibility>(); if (!CanSpawnAnyMonster(remainingCost))
visibility.showInExploredAreas = false; // Enemies hidden when not visible {
visibility.updateInterval = 0.2f; break;
}
continue;
} }
enemy.GetComponent<NetworkObject>().Spawn(); SpawnEnemy(selectedEntry.prefab);
Debug.Log(enemy); remainingCost -= selectedEntry.monsterData.cost;
spawnedCount++;
}
if (spawnedCount > 0)
{
Debug.Log($"[EnemyPortal] Spawned {spawnedCount} monsters (Cost used: {currentCost - remainingCost:F2})");
} }
} }
// Update is called once per frame private bool CanSpawnAnyMonster(float remainingCost)
void Update()
{ {
foreach (var entry in monsterEntries)
{
if (entry.monsterData.cost <= remainingCost)
{
return true;
}
}
return false;
}
private MonsterEntry SelectMonsterByWeight()
{
float totalWeight = 0f;
foreach (var entry in monsterEntries)
{
totalWeight += entry.monsterData.weight;
}
float randomValue = Random.Range(0f, totalWeight);
float cumulativeWeight = 0f;
foreach (var entry in monsterEntries)
{
cumulativeWeight += entry.monsterData.weight;
if (randomValue <= cumulativeWeight)
{
return entry;
}
}
return monsterEntries[0];
}
private void SpawnEnemy(GameObject prefab)
{
GameObject enemy = Instantiate(prefab, transform);
if (enemy.GetComponent<FogOfWarVisibility>() == null)
{
var visibility = enemy.AddComponent<FogOfWarVisibility>();
visibility.showInExploredAreas = false;
visibility.updateInterval = 0.2f;
}
enemy.GetComponent<NetworkObject>().Spawn();
}
private void IncreaseCost()
{
currentCost *= (1f + costIncreaseRate / 100f);
} }
} }

View File

@@ -43,7 +43,6 @@
<UnityVersion>6000.3.5f2</UnityVersion> <UnityVersion>6000.3.5f2</UnityVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Analyzer Include="C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\Extensions\Microsoft\Visual Studio Tools for Unity\Analyzers\Microsoft.Unity.Analyzers.dll" />
<Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.SourceGenerators.dll" /> <Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.SourceGenerators.dll" />
<Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.Properties.SourceGenerator.dll" /> <Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.Properties.SourceGenerator.dll" />
<Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.UIToolkit.SourceGenerator.dll" /> <Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.UIToolkit.SourceGenerator.dll" />

View File

@@ -43,7 +43,6 @@
<UnityVersion>6000.3.5f2</UnityVersion> <UnityVersion>6000.3.5f2</UnityVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Analyzer Include="C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\Extensions\Microsoft\Visual Studio Tools for Unity\Analyzers\Microsoft.Unity.Analyzers.dll" />
<Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.SourceGenerators.dll" /> <Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.SourceGenerators.dll" />
<Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.Properties.SourceGenerator.dll" /> <Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.Properties.SourceGenerator.dll" />
<Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.UIToolkit.SourceGenerator.dll" /> <Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.UIToolkit.SourceGenerator.dll" />

View File

@@ -43,15 +43,14 @@
<UnityVersion>6000.3.5f2</UnityVersion> <UnityVersion>6000.3.5f2</UnityVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Analyzer Include="C:\Program Files\Microsoft Visual Studio\18\Community\Common7\IDE\Extensions\Microsoft\Visual Studio Tools for Unity\Analyzers\Microsoft.Unity.Analyzers.dll" />
<Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.SourceGenerators.dll" /> <Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.SourceGenerators.dll" />
<Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.Properties.SourceGenerator.dll" /> <Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.Properties.SourceGenerator.dll" />
<Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.UIToolkit.SourceGenerator.dll" /> <Analyzer Include="C:\Program Files\Unity\Hub\Editor\6000.3.5f2\Editor\Data\Tools\BuildPipeline\Unity.SourceGenerators\Unity.UIToolkit.SourceGenerator.dll" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Overrides\ColorAdjustments.cs" /> <Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Overrides\ColorAdjustments.cs" />
<Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Passes\ScreenSpaceAmbientOcclusionPass.cs" />
<Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Decal\Entities\DecalEntityManager.cs" /> <Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Decal\Entities\DecalEntityManager.cs" />
<Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Passes\ScreenSpaceAmbientOcclusionPass.cs" />
<Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Overrides\ScreenSpaceLensFlare.cs" /> <Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Overrides\ScreenSpaceLensFlare.cs" />
<Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\History\RawColorHistory.cs" /> <Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\History\RawColorHistory.cs" />
<Compile Include="Assets\FlatKit\[Render Pipeline] URP\EditorAttributes\Core\DrawerAttributes\InfoBoxAttribute.cs" /> <Compile Include="Assets\FlatKit\[Render Pipeline] URP\EditorAttributes\Core\DrawerAttributes\InfoBoxAttribute.cs" />
@@ -143,8 +142,8 @@
<Compile Include="Assets\FlatKit\[Render Pipeline] URP\RenderFeatures\Outline\FlatKitOutline.cs" /> <Compile Include="Assets\FlatKit\[Render Pipeline] URP\RenderFeatures\Outline\FlatKitOutline.cs" />
<Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Passes\AdditionalLightsShadowAtlasLayout.cs" /> <Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Passes\AdditionalLightsShadowAtlasLayout.cs" />
<Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Deprecated.cs" /> <Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Deprecated.cs" />
<Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Passes\ColorGradingLutPass.cs" />
<Compile Include="Assets\FlatKit\[Render Pipeline] URP\RenderFeatures\Common\ScreenRenderPass.cs" /> <Compile Include="Assets\FlatKit\[Render Pipeline] URP\RenderFeatures\Common\ScreenRenderPass.cs" />
<Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Passes\ColorGradingLutPass.cs" />
<Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Tiling\TileRangeExpansionJob.cs" /> <Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Tiling\TileRangeExpansionJob.cs" />
<Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\TemporalAA.cs" /> <Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\TemporalAA.cs" />
<Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\VFXGraph\Utility\PropertyBinders\URPCameraBinder.cs" /> <Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\VFXGraph\Utility\PropertyBinders\URPCameraBinder.cs" />
@@ -247,8 +246,8 @@
<Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Data\UniversalRenderPipelineAsset.DefaultResources.cs" /> <Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Data\UniversalRenderPipelineAsset.DefaultResources.cs" />
<Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Data\RenderStateData.cs" /> <Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Data\RenderStateData.cs" />
<Compile Include="Assets\FlatKit\[Render Pipeline] URP\EditorAttributes\Core\DrawerAttributes\DrawerAttribute.cs" /> <Compile Include="Assets\FlatKit\[Render Pipeline] URP\EditorAttributes\Core\DrawerAttributes\DrawerAttribute.cs" />
<Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\FrameData\UniversalLightData.cs" />
<Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Debug\DebugHandler.cs" /> <Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Debug\DebugHandler.cs" />
<Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\FrameData\UniversalLightData.cs" />
<Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Decal\Entities\DecalDrawSystem.cs" /> <Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Decal\Entities\DecalDrawSystem.cs" />
<Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Passes\PostProcessPass.cs" /> <Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Passes\PostProcessPass.cs" />
<Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Passes\CapturePass.cs" /> <Compile Include="Library\PackageCache\com.unity.render-pipelines.universal@1e87cf1dccb8\Runtime\Passes\CapturePass.cs" />