2025-04-26 21:05:13 +08:00
|
|
|
using System;
|
|
|
|
using UnityEngine;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.IO;
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
|
|
namespace Data
|
|
|
|
{
|
|
|
|
public enum AgreementTermsDataType{
|
2025-06-17 09:31:12 +08:00
|
|
|
Desc_1001 = 1001,
|
2025-04-26 21:05:13 +08:00
|
|
|
SimplifiedChinese_1001 = 1001,
|
|
|
|
English_1001 = 1001,
|
2025-06-17 09:31:12 +08:00
|
|
|
Desc_1002 = 1002,
|
2025-04-26 21:05:13 +08:00
|
|
|
SimplifiedChinese_1002 = 1002,
|
|
|
|
English_1002 = 1002,
|
2025-06-17 09:31:12 +08:00
|
|
|
Desc_1003 = 1003,
|
2025-04-26 21:05:13 +08:00
|
|
|
SimplifiedChinese_1003 = 1003,
|
|
|
|
English_1003 = 1003,
|
2025-06-17 09:31:12 +08:00
|
|
|
Desc_1004 = 1004,
|
|
|
|
SimplifiedChinese_1004 = 1004,
|
|
|
|
English_1004 = 1004,
|
2025-04-26 21:05:13 +08:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
[System.Serializable]
|
|
|
|
public class AgreementTermsData
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// ID
|
|
|
|
/// </summary>
|
|
|
|
public int ID;
|
|
|
|
/// <summary>
|
2025-06-17 09:31:12 +08:00
|
|
|
/// 描述
|
2025-04-26 21:05:13 +08:00
|
|
|
/// </summary>
|
2025-06-17 09:31:12 +08:00
|
|
|
public string Desc;
|
2025-04-26 21:05:13 +08:00
|
|
|
/// <summary>
|
2025-06-17 09:31:12 +08:00
|
|
|
/// 中文
|
2025-04-26 21:05:13 +08:00
|
|
|
/// </summary>
|
2025-06-17 09:31:12 +08:00
|
|
|
public string SimplifiedChinese;
|
2025-04-26 21:05:13 +08:00
|
|
|
/// <summary>
|
|
|
|
/// 英文
|
|
|
|
/// </summary>
|
|
|
|
public string English;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
[System.Serializable]
|
|
|
|
public class AgreementTermsDatas
|
|
|
|
{
|
|
|
|
public List<AgreementTermsData> AgreementTermsList = new List<AgreementTermsData>();
|
|
|
|
}
|
|
|
|
|
|
|
|
public class AgreementTermsDataExcel
|
|
|
|
{
|
|
|
|
private const string _fileName = "AgreementTerms";
|
|
|
|
private string _filePath;
|
|
|
|
private AgreementTermsDatas _datas;
|
|
|
|
public AgreementTermsDatas Datas => _datas;
|
|
|
|
|
|
|
|
public AgreementTermsDataExcel()
|
|
|
|
{
|
2025-06-17 09:31:12 +08:00
|
|
|
_filePath = $"{Application.dataPath}/Res/ExcelData/{_fileName}.json";
|
2025-04-26 21:05:13 +08:00
|
|
|
var text = File.ReadAllText(_filePath);
|
|
|
|
_datas = JsonConvert.DeserializeObject<AgreementTermsDatas>(text);
|
|
|
|
}
|
|
|
|
|
|
|
|
public AgreementTermsData GetData(int id)
|
|
|
|
{
|
|
|
|
foreach (var testData in _datas.AgreementTermsList)
|
|
|
|
{
|
|
|
|
if (id == testData.ID)
|
|
|
|
{
|
|
|
|
return testData;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
throw new NullReferenceException();
|
|
|
|
}
|
2025-06-17 09:31:12 +08:00
|
|
|
}}
|