This commit is contained in:
2025-09-10 11:15:18 +08:00
parent f830789f4c
commit d6006094d9
12 changed files with 71 additions and 29 deletions

View File

@@ -1,20 +1,18 @@
using System; using System;
using System.Threading;
using Cysharp.Threading.Tasks; using Cysharp.Threading.Tasks;
using Stary.Evo;
using UnityEngine; using UnityEngine;
using YooAsset; using YooAsset;
namespace Main namespace Stary.Evo.TableTextConversion
{ {
public interface IAudioTableData : ITableData public interface IAudioTableDataCore : ITableDataCore
{ {
UniTask<Stary.Evo.TableTextConversion.AudioTableData.MessageInfo> GetAudioInfo(string auid); UniTask<Stary.Evo.TableTextConversion.AudioTableData.MessageInfo> GetAudioInfo(string auid);
UniTask<AudioClip> GetAudioClip(string auid); UniTask<AudioClip> GetAudioClip(string auid);
} }
public class AudioTableData : IAudioTableData, IDisposable public class AudioTableDataCore : IAudioTableDataCore, IDisposable
{ {
private Stary.Evo.TableTextConversion.AudioTableData audioTableData; private Stary.Evo.TableTextConversion.AudioTableData audioTableData;

View File

@@ -1,11 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using Cysharp.Threading.Tasks;
using UnityEngine;
public interface ITableData
{
string TableName { get; }
bool IsLoad { get; set; }
UniTask LoadData();
}

View File

@@ -0,0 +1,13 @@
using Cysharp.Threading.Tasks;
namespace Stary.Evo.TableTextConversion
{
public interface ITableDataCore
{
string TableName { get; }
bool IsLoad { get; set; }
UniTask LoadData();
}
}

View File

@@ -0,0 +1,43 @@
using System;
namespace Stary.Evo.TableTextConversion
{
public class TableSystem : IDisposable
{
// 单例实例
private static TableSystem _instance;
// 公共访问属性
public static TableSystem Instance
{
get
{
if (_instance == null)
{
_instance = new TableSystem();
}
return _instance;
}
}
public IAudioTableDataCore AudioTableCore;
public IUITableDataCore UITableCore;
public IVideoTableDataCore VideoTableCore;
// 私有构造函数,防止外部实例化
private TableSystem()
{
AudioTableCore = new AudioTableDataCore();
UITableCore = new UITableDataCore();
VideoTableCore = new VideoTableDataCore();
}
public void Dispose()
{
AudioTableCore = null;
UITableCore = null;
VideoTableCore = null;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 943d2e1e53404a23b8871dc3e64e0dc9
timeCreated: 1757473764

View File

@@ -1,19 +1,18 @@
using System; using System;
using Cysharp.Threading.Tasks; using Cysharp.Threading.Tasks;
using Stary.Evo;
using UnityEngine; using UnityEngine;
using YooAsset; using YooAsset;
namespace X_04_04 namespace Stary.Evo.TableTextConversion
{ {
public interface IUITableData : ITableData public interface IUITableDataCore : ITableDataCore
{ {
UniTask<Stary.Evo.TableTextConversion.UITableData.MessageInfo> GetUIInfo(string uiid); UniTask<Stary.Evo.TableTextConversion.UITableData.MessageInfo> GetUIInfo(string uiid);
UniTask<Sprite> GetSprite(string uiid); UniTask<Sprite> GetSprite(string uiid);
} }
public class UITableData : IUITableData, IDisposable public class UITableDataCore : IUITableDataCore, IDisposable
{ {
public string TableName => "Config_UITableData"; public string TableName => "Config_UITableData";
public bool IsLoad { get; set; } public bool IsLoad { get; set; }

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: acecbcc2903fe7044bfb88198181773a guid: e562d8d5a2bf0c04486e6b861c2d9b37
MonoImporter: MonoImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 2 serializedVersion: 2

View File

@@ -1,20 +1,18 @@
using System; using System;
using System.Threading;
using Cysharp.Threading.Tasks; using Cysharp.Threading.Tasks;
using Stary.Evo;
using UnityEngine; using UnityEngine;
using YooAsset; using YooAsset;
namespace Main namespace Stary.Evo.TableTextConversion
{ {
public interface IVideoTableData : ITableData public interface IVideoTableDataCore : ITableDataCore
{ {
UniTask LoadData(); UniTask LoadData();
UniTask<Stary.Evo.TableTextConversion.VideoTableData.MessageInfo> PlayVideoName(string vidid); UniTask<Stary.Evo.TableTextConversion.VideoTableData.MessageInfo> PlayVideoName(string vidid);
} }
public class VideoTableData : IVideoTableData, IDisposable public class VideoTableDataCore : IVideoTableDataCore, IDisposable
{ {
public string TableName => "Config_VideoTableData"; public string TableName => "Config_VideoTableData";
public bool IsLoad { get; set; } public bool IsLoad { get; set; }
@@ -35,8 +33,7 @@ namespace Main
} }
async UniTask<Stary.Evo.TableTextConversion.VideoTableData.MessageInfo> IVideoTableData.PlayVideoName( public async UniTask<Stary.Evo.TableTextConversion.VideoTableData.MessageInfo> PlayVideoName(string vidid)
string vidid)
{ {
if (!IsLoad) if (!IsLoad)
{ {

View File

@@ -1,6 +1,6 @@
{ {
"name": "com.staryevo.tabletextconversion", "name": "com.staryevo.tabletextconversion",
"version": "1.1.6", "version": "1.1.7",
"displayName": "05.TableTextConversion", "displayName": "05.TableTextConversion",
"description": "表格转化工具", "description": "表格转化工具",
"unity": "2021.3", "unity": "2021.3",