P0-02 补齐数据表:组件、敌人、波次、节点、事件、商店商品
- 组件:
- 底座:Assets\GameMain\DataTables\BaseComp.txt
- 轴承:Assets\GameMain\DataTables\BearingComp.txt
- 枪口:Assets\GameMain\DataTables\MuzzleComp.txt
- 敌人:Assets\GameMain\DataTables\Enemy.txt
- 波次:
- 关卡:Assets\GameMain\DataTables\Level.txt
- 关卡阶段(波次):Assets\GameMain\DataTables\LevelPhase.txt
- 波次条目(波次出怪规则):Assets\GameMain\DataTables\LevelSpawnEntry.txt
- 事件:Assets\GameMain\DataTables\Event.txt
- 商店:Assets\GameMain\DataTables\ShopPrice.txt
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// 敌人配置表
|
||||
/// </summary>
|
||||
public class DREnemy : DataRowBase
|
||||
{
|
||||
private int m_Id = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 获取敌人编号
|
||||
/// </summary>
|
||||
public override int Id => m_Id;
|
||||
|
||||
/// <summary>
|
||||
/// 获取敌人实体编号
|
||||
/// </summary>
|
||||
public int EntityId { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取敌人基础血量
|
||||
/// </summary>
|
||||
public int BaseHp { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取敌人基础基地伤害
|
||||
/// </summary>
|
||||
public int BaseDamage { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取敌人移动速度
|
||||
/// </summary>
|
||||
public float Speed { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取敌人掉落金币
|
||||
/// </summary>
|
||||
public int DropCoin { get; private set; }
|
||||
|
||||
public override bool ParseDataRow(string dataRowString, object userData)
|
||||
{
|
||||
string[] columnStrings = dataRowString.Split(DataTableExtension.DataSplitSeparators);
|
||||
for (int i = 0; i < columnStrings.Length; i++)
|
||||
{
|
||||
columnStrings[i] = columnStrings[i].Trim(DataTableExtension.DataTrimSeparators);
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
index++;
|
||||
m_Id = int.Parse(columnStrings[index++]);
|
||||
index++;
|
||||
EntityId = int.Parse(columnStrings[index++]);
|
||||
BaseHp = int.Parse(columnStrings[index++]);
|
||||
BaseDamage = int.Parse(columnStrings[index++]);
|
||||
Speed = float.Parse(columnStrings[index++]);
|
||||
DropCoin = int.Parse(columnStrings[index++]);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0f9832b810954c4eb0f45ad735bb5a58
|
||||
timeCreated: 1772101800
|
||||
@@ -0,0 +1,52 @@
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// 事件配置表
|
||||
/// </summary>
|
||||
public class DREvent : DataRowBase
|
||||
{
|
||||
private int m_Id = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 获取事件编号
|
||||
/// </summary>
|
||||
public override int Id => m_Id;
|
||||
|
||||
/// <summary>
|
||||
/// 获取事件题目
|
||||
/// </summary>
|
||||
public string Title { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取事件描述
|
||||
/// </summary>
|
||||
public string Description { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取事件选项
|
||||
/// </summary>
|
||||
/// <remarks>原始字符串(如 JSON 文本),不在此处做解析。</remarks>
|
||||
public string OptionsRaw { get; private set; }
|
||||
|
||||
public override bool ParseDataRow(string dataRowString, object userData)
|
||||
{
|
||||
string[] columnStrings = dataRowString.Split(DataTableExtension.DataSplitSeparators);
|
||||
for (int i = 0; i < columnStrings.Length; i++)
|
||||
{
|
||||
columnStrings[i] = columnStrings[i].Trim(DataTableExtension.DataTrimSeparators);
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
index++;
|
||||
m_Id = int.Parse(columnStrings[index++]);
|
||||
index++;
|
||||
Title = columnStrings[index++];
|
||||
Description = columnStrings[index++];
|
||||
OptionsRaw = columnStrings[index++];
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 57e29dfa7f1044a1acfbf3abde81859f
|
||||
timeCreated: 1772097514
|
||||
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using GeometryTD.Definition;
|
||||
using GeometryTD.CustomUtility;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// 关卡表
|
||||
/// </summary>
|
||||
public class DRLevel : DataRowBase
|
||||
{
|
||||
private int m_Id = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 获取关卡编号
|
||||
/// </summary>
|
||||
public override int Id => m_Id;
|
||||
|
||||
/// <summary>
|
||||
/// 获取关卡所属主题类型
|
||||
/// </summary>
|
||||
public LevelThemeType LevelThemeType { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取关卡初始基地生命
|
||||
/// </summary>
|
||||
public int BaseHp { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取关卡初始硬币数量
|
||||
/// </summary>
|
||||
public int StartCoin { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取关卡胜利条件
|
||||
/// </summary>
|
||||
public LevelVictoryType LevelVictoryType { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取关卡胜利奖励金币
|
||||
/// </summary>
|
||||
public int RewardGold { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取关卡胜利条件参数
|
||||
/// </summary>
|
||||
public string VictoryParams { get; private set; }
|
||||
|
||||
public override bool ParseDataRow(string dataRowString, object userData)
|
||||
{
|
||||
string[] columnStrings = dataRowString.Split(DataTableExtension.DataSplitSeparators);
|
||||
for (int i = 0; i < columnStrings.Length; i++)
|
||||
{
|
||||
columnStrings[i] = columnStrings[i].Trim(DataTableExtension.DataTrimSeparators);
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
index++;
|
||||
m_Id = int.Parse(columnStrings[index++]);
|
||||
index++;
|
||||
LevelThemeType = EnumUtility<LevelThemeType>.Get(columnStrings[index++]);
|
||||
BaseHp = int.Parse(columnStrings[index++]);
|
||||
StartCoin = int.Parse(columnStrings[index++]);
|
||||
LevelVictoryType = EnumUtility<LevelVictoryType>.Get(columnStrings[index++]);
|
||||
VictoryParams = columnStrings[index++];
|
||||
RewardGold = int.Parse(columnStrings[index++]);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e0eb47d184fe4204b38dc7c9e86da609
|
||||
timeCreated: 1772089145
|
||||
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using GeometryTD.CustomUtility;
|
||||
using GeometryTD.Definition;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// 关卡阶段表
|
||||
/// </summary>
|
||||
public class DRLevelPhase : DataRowBase
|
||||
{
|
||||
private int m_Id = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 获取关卡阶段编号
|
||||
/// </summary>
|
||||
public override int Id => m_Id;
|
||||
|
||||
/// <summary>
|
||||
/// 获取阶段持续时间(秒)
|
||||
/// </summary>
|
||||
public int DurationSeconds { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取阶段结束条件类型
|
||||
/// </summary>
|
||||
public PhaseEndType EndType { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取阶段结束参数
|
||||
/// </summary>
|
||||
public string EndParam { get; private set; }
|
||||
|
||||
public override bool ParseDataRow(string dataRowString, object userData)
|
||||
{
|
||||
string[] columnStrings = dataRowString.Split(DataTableExtension.DataSplitSeparators);
|
||||
for (int i = 0; i < columnStrings.Length; i++)
|
||||
{
|
||||
columnStrings[i] = columnStrings[i].Trim(DataTableExtension.DataTrimSeparators);
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
index++;
|
||||
m_Id = int.Parse(columnStrings[index++]);
|
||||
index++;
|
||||
DurationSeconds = int.Parse(columnStrings[index++]);
|
||||
EndType = ParsePhaseEndType(columnStrings[index++]);
|
||||
EndParam = columnStrings[index++];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private PhaseEndType ParsePhaseEndType(string raw)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(raw))
|
||||
{
|
||||
return PhaseEndType.None;
|
||||
}
|
||||
|
||||
return EnumUtility<PhaseEndType>.Get(raw);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f1fd79e88eca4bfbb38f5bcb8091e2dd
|
||||
timeCreated: 1772090000
|
||||
@@ -0,0 +1,94 @@
|
||||
using System;
|
||||
using GeometryTD.CustomUtility;
|
||||
using GeometryTD.Definition;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// 关卡阶段出怪条目表
|
||||
/// </summary>
|
||||
public class DRLevelSpawnEntry : DataRowBase
|
||||
{
|
||||
private int m_Id = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 获取阶段条目编号
|
||||
/// </summary>
|
||||
public override int Id => m_Id;
|
||||
|
||||
/// <summary>
|
||||
/// 获取敌人出生口编号
|
||||
/// </summary>
|
||||
public int SpawnPointId { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取相对开始时间(秒)
|
||||
/// </summary>
|
||||
public int StartTime { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取出怪条目类型
|
||||
/// </summary>
|
||||
public EntryType EntryType { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取敌人编号
|
||||
/// </summary>
|
||||
public int EnemyId { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取单次出怪数量
|
||||
/// </summary>
|
||||
public int Count { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取出怪间隔(秒)
|
||||
/// </summary>
|
||||
public float Interval { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取持续时间(秒)
|
||||
/// </summary>
|
||||
public int Duration { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取单怪出生间隔(秒)
|
||||
/// </summary>
|
||||
public float Gap { get; private set; }
|
||||
|
||||
public override bool ParseDataRow(string dataRowString, object userData)
|
||||
{
|
||||
string[] columnStrings = dataRowString.Split(DataTableExtension.DataSplitSeparators);
|
||||
for (int i = 0; i < columnStrings.Length; i++)
|
||||
{
|
||||
columnStrings[i] = columnStrings[i].Trim(DataTableExtension.DataTrimSeparators);
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
index++;
|
||||
m_Id = int.Parse(columnStrings[index++]);
|
||||
index++;
|
||||
SpawnPointId = int.Parse(columnStrings[index++]);
|
||||
StartTime = int.Parse(columnStrings[index++]);
|
||||
EntryType = ParseEntryType(columnStrings[index++]);
|
||||
EnemyId = int.Parse(columnStrings[index++]);
|
||||
Count = int.Parse(columnStrings[index++]);
|
||||
Interval = float.Parse(columnStrings[index++]);
|
||||
Duration = int.Parse(columnStrings[index++]);
|
||||
Gap = float.Parse(columnStrings[index++]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private EntryType ParseEntryType(string raw)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(raw))
|
||||
{
|
||||
return EntryType.None;
|
||||
}
|
||||
|
||||
return EnumUtility<EntryType>.Get(raw);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b06804b242d247bd8a937cdce930cee1
|
||||
timeCreated: 1772090001
|
||||
@@ -0,0 +1,38 @@
|
||||
using GeometryTD.CustomUtility;
|
||||
using GeometryTD.Definition;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace GeometryTD.DataTable
|
||||
{
|
||||
public class DRShopPrice : DataRowBase
|
||||
{
|
||||
private int m_Id = 0;
|
||||
|
||||
public override int Id => m_Id;
|
||||
|
||||
public RarityType Rarity { get; set; }
|
||||
|
||||
public int MinPrice { get; set; }
|
||||
|
||||
public int MaxPrice { get; set; }
|
||||
|
||||
public override bool ParseDataRow(string dataRowString, object userData)
|
||||
{
|
||||
string[] columnStrings = dataRowString.Split(DataTableExtension.DataSplitSeparators);
|
||||
for (int i = 0; i < columnStrings.Length; i++)
|
||||
{
|
||||
columnStrings[i] = columnStrings[i].Trim(DataTableExtension.DataTrimSeparators);
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
index++;
|
||||
m_Id = int.Parse(columnStrings[index++]);
|
||||
index++;
|
||||
Rarity = EnumUtility<RarityType>.Get(columnStrings[index++]);
|
||||
MinPrice = int.Parse(columnStrings[index++]);
|
||||
MaxPrice = int.Parse(columnStrings[index++]);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7c47aaecd99446f2b8c9ec84c797005b
|
||||
timeCreated: 1772105886
|
||||
Reference in New Issue
Block a user