(client) feat:添加测试用定义
This commit is contained in:
@ -319,7 +319,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!4 &912467178
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -11,15 +11,15 @@ namespace Data
|
||||
{
|
||||
public class PackAbout
|
||||
{
|
||||
public string[] after;
|
||||
public string author;
|
||||
public string[] before;
|
||||
public string description;
|
||||
public string name;
|
||||
public string description;
|
||||
public string author;
|
||||
public string version;
|
||||
public string packID;
|
||||
|
||||
public string[] necessary;
|
||||
public string packID;
|
||||
public string version;
|
||||
public string[] after;
|
||||
public string[] before;
|
||||
|
||||
/// <summary>
|
||||
/// 使用静态方法从 XML 文档创建 PackAbout 实例。
|
||||
|
@ -15,12 +15,29 @@ namespace Managers
|
||||
|
||||
public void Init()
|
||||
{
|
||||
var packFolder = Directory.GetDirectories(dataSetFilePath[0]);
|
||||
var packFolder = Configs.ConfigProcessor.GetSubFolders(new(dataSetFilePath));
|
||||
foreach (var folder in packFolder)
|
||||
{
|
||||
var pack = new DefinePack();
|
||||
if (pack.LoadPack(folder)) packs.Add(pack.packID, pack);
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (packs == null || packs.Count == 0)
|
||||
{
|
||||
return "No packs available"; // 如果集合为空或为 null,返回默认信息
|
||||
}
|
||||
|
||||
var result = new System.Text.StringBuilder();
|
||||
|
||||
foreach (var definePack in packs)
|
||||
{
|
||||
result.AppendLine(definePack.ToString()); // 每个元素占一行
|
||||
}
|
||||
|
||||
return result.ToString();
|
||||
}
|
||||
}
|
||||
}
|
23
Client/Assets/Scripts/Test/TestDefine.cs
Normal file
23
Client/Assets/Scripts/Test/TestDefine.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Test
|
||||
{
|
||||
|
||||
|
||||
public class TestDefine : MonoBehaviour
|
||||
{
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
Managers.DefineManager.Instance.Init();
|
||||
Debug.Log(Managers.DefineManager.Instance);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
2
Client/Assets/Scripts/Test/TestDefine.cs.meta
Normal file
2
Client/Assets/Scripts/Test/TestDefine.cs.meta
Normal file
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 147e91e6929d90a4fb877c0b0a6b608c
|
Reference in New Issue
Block a user