迁移数据表到 Luban,移除 JsonNet、EnumUtility
This commit is contained in:
+1
-2
@@ -1,7 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using SepCore.DataTable;
|
||||
using SepCore.Definition;
|
||||
using SepCore.Entity;
|
||||
using GameFramework.Event;
|
||||
@@ -70,7 +69,7 @@ namespace SepCore.EnemyManager
|
||||
_entity = null;
|
||||
}
|
||||
|
||||
public void OnInit(DRLevel level, Player player)
|
||||
public void OnInit(LevelConfig level, Player player)
|
||||
{
|
||||
_isStopped = false;
|
||||
|
||||
|
||||
+16
-7
@@ -1,5 +1,5 @@
|
||||
using System;
|
||||
using SepCore.DataTable;
|
||||
using SepCore.CustomUtility;
|
||||
using SepCore.Definition;
|
||||
using SepCore.Timer;
|
||||
using UnityEngine;
|
||||
@@ -22,18 +22,27 @@ namespace SepCore.EnemyManager
|
||||
public float ElapsedTime => _elapsedTime;
|
||||
public int WaveCount => _enemyTypes?.Length ?? 0;
|
||||
|
||||
public void Init(DRLevel level, Action<EnemyType, int> onSpawn)
|
||||
public void Init(LevelConfig level, Action<EnemyType, int> onSpawn)
|
||||
{
|
||||
GameEntry.Timer.CancelByOwner(this);
|
||||
|
||||
_onSpawn = onSpawn;
|
||||
_baseIntervals = (float[])level.Intervals.Clone();
|
||||
_enemyTypes = level.EntityTypes;
|
||||
_spawnCounts = level.EntityCounts;
|
||||
int count = level.EnemySpawnConfigs.Count;
|
||||
_baseIntervals = new float[count];
|
||||
_enemyTypes = new EnemyType[count];
|
||||
_spawnCounts = new int[count];
|
||||
_elapsedTime = 0f;
|
||||
|
||||
_waveHandles = new TimerHandle[_baseIntervals.Length];
|
||||
for (int i = 0; i < _baseIntervals.Length; i++)
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
var spawnConfig = level.EnemySpawnConfigs[i];
|
||||
_baseIntervals[i] = spawnConfig.Interval / 1000f;
|
||||
_enemyTypes[i] = EntityDataFactory.GetEnemyType(spawnConfig.EnemyName);
|
||||
_spawnCounts[i] = spawnConfig.EnemyCount;
|
||||
}
|
||||
|
||||
_waveHandles = new TimerHandle[count];
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
int waveIndex = i;
|
||||
float interval = GetScaledInterval(_baseIntervals[i], _spawnRateScale);
|
||||
|
||||
Reference in New Issue
Block a user