- 添加对话表结构

- 调整部分类的命名空间
- 引入 EnumUtility 用于string与enum的转换
This commit is contained in:
SepComet
2026-02-09 10:23:25 +08:00
parent 67e6b33677
commit 5973c1a4a7
77 changed files with 397 additions and 157 deletions
@@ -9,7 +9,7 @@ using System;
using System.IO;
using UnityEngine;
namespace StarForce
namespace DataTable
{
public static class BinaryReaderExtension
{
@@ -0,0 +1,39 @@
using CustomUtility;
using Definition.Enum;
using UnityGameFramework.Runtime;
namespace DataTable
{
public class DRDialog : DataRowBase
{
private int m_Id;
/// <summary>
/// 获取对话编号。
/// </summary>
public override int Id => m_Id;
/// <summary>
/// 获取对话标识。
/// </summary>
public string Title { get; private set; }
/// <summary>
/// 获取对话形式。
/// </summary>
public DialogUIMode UIMode { get; private set; }
public override bool ParseDataRow(string dataRowString, object userData)
{
string[] fields = dataRowString.Split('\t');
int index = 1;
m_Id = int.Parse(fields[index++]);
index++;
Title = fields[index++];
UIMode = EnumUtility<DialogUIMode>.Get(fields[index++]);
return true;
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fb12692f2a7e6174eae3b0d28c769e55
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,64 @@
using CustomUtility;
using Definition.Enum;
using UnityGameFramework.Runtime;
namespace DataTable
{
public class DRDialogLine : DataRowBase
{
private int m_Id;
/// <summary>
/// 获取对话行编号
/// </summary>
public override int Id { get; }
/// <summary>
/// 获取说话人 Id。
/// </summary>
public string SpeakerId { get; private set; }
/// <summary>
/// 获取说话人表情。
/// </summary>
public ExpressionType Expression { get; private set; }
/// <summary>
/// 获取说话人显示名。
/// </summary>
public string SpeakerName { get; private set; }
/// <summary>
/// 获取说话人朝向。
/// </summary>
public int Direction { get; private set; }
/// <summary>
/// 获取对话内容。
/// </summary>
public string Text { get; private set; }
/// <summary>
/// 获取对话效果。
/// </summary>
public EmphasisType Emphasis { get; private set; }
public override bool ParseDataRow(string dataRowString, object userData)
{
string[] fields = dataRowString.Split('\t');
int index = 0;
index++;
m_Id = int.Parse(fields[index++]);
index++;
SpeakerId = fields[index++];
Expression = EnumUtility<ExpressionType>.Get(fields[index++]);
SpeakerName = fields[index++];
Direction = int.Parse(fields[index++]);
Text = fields[index++];
Emphasis = EnumUtility<EmphasisType>.Get(fields[index++]);
return true;
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fc6d3e8e61ab627488e22bb5fc28f95d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -16,7 +16,7 @@ using System.Text;
using UnityEngine;
using UnityGameFramework.Runtime;
namespace StarForce
namespace DataTable
{
/// <summary>
/// 实体表。
@@ -28,13 +28,7 @@ namespace StarForce
/// <summary>
/// 获取实体编号。
/// </summary>
public override int Id
{
get
{
return m_Id;
}
}
public override int Id => m_Id;
/// <summary>
/// 获取资源名称。
+1 -1
View File
@@ -16,7 +16,7 @@ using System.Text;
using UnityEngine;
using UnityGameFramework.Runtime;
namespace StarForce
namespace DataTable
{
/// <summary>
/// 音乐配置表。
+2 -16
View File
@@ -1,22 +1,8 @@
//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
// 此文件由工具自动生成,请勿直接修改。
// 生成时间:2021-06-16 21:54:35.610
//------------------------------------------------------------
using GameFramework;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO;
using System.Text;
using UnityEngine;
using UnityGameFramework.Runtime;
namespace StarForce
namespace DataTable
{
/// <summary>
/// 场景配置表。
+2 -16
View File
@@ -1,22 +1,8 @@
//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
// 此文件由工具自动生成,请勿直接修改。
// 生成时间:2021-06-16 21:54:35.625
//------------------------------------------------------------
using GameFramework;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO;
using System.Text;
using UnityEngine;
using UnityGameFramework.Runtime;
namespace StarForce
namespace DataTable
{
/// <summary>
/// 声音配置表。
+2 -12
View File
@@ -1,14 +1,4 @@
//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
// 此文件由工具自动生成,请勿直接修改。
// 生成时间:2021-06-16 21:54:35.652
//------------------------------------------------------------
using GameFramework;
using GameFramework;
using System;
using System.Collections.Generic;
using System.IO;
@@ -16,7 +6,7 @@ using System.Text;
using UnityEngine;
using UnityGameFramework.Runtime;
namespace StarForce
namespace DataTable
{
/// <summary>
/// 界面配置表。
+2 -12
View File
@@ -1,14 +1,4 @@
//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
// 此文件由工具自动生成,请勿直接修改。
// 生成时间:2021-06-16 21:54:35.666
//------------------------------------------------------------
using GameFramework;
using GameFramework;
using System;
using System.Collections.Generic;
using System.IO;
@@ -16,7 +6,7 @@ using System.Text;
using UnityEngine;
using UnityGameFramework.Runtime;
namespace StarForce
namespace DataTable
{
/// <summary>
/// 声音配置表。
@@ -1,16 +1,10 @@
//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
using GameFramework.DataTable;
using GameFramework.DataTable;
using System;
using Definition;
using UnityEngine;
using UnityGameFramework.Runtime;
namespace StarForce
namespace DataTable
{
public static class DataTableExtension
{