1
This commit is contained in:
@@ -1,20 +1,18 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using Stary.Evo;
|
||||
using UnityEngine;
|
||||
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<AudioClip> GetAudioClip(string auid);
|
||||
}
|
||||
|
||||
|
||||
public class AudioTableData : IAudioTableData, IDisposable
|
||||
public class AudioTableDataCore : IAudioTableDataCore, IDisposable
|
||||
{
|
||||
private Stary.Evo.TableTextConversion.AudioTableData audioTableData;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
13
Assets/05.TableTextConversion/RunTime/Core/ITableDataCore.cs
Normal file
13
Assets/05.TableTextConversion/RunTime/Core/ITableDataCore.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
43
Assets/05.TableTextConversion/RunTime/Core/TableSystem.cs
Normal file
43
Assets/05.TableTextConversion/RunTime/Core/TableSystem.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 943d2e1e53404a23b8871dc3e64e0dc9
|
||||
timeCreated: 1757473764
|
||||
@@ -1,19 +1,18 @@
|
||||
using System;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using Stary.Evo;
|
||||
using UnityEngine;
|
||||
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<Sprite> GetSprite(string uiid);
|
||||
}
|
||||
|
||||
|
||||
public class UITableData : IUITableData, IDisposable
|
||||
public class UITableDataCore : IUITableDataCore, IDisposable
|
||||
{
|
||||
public string TableName => "Config_UITableData";
|
||||
public bool IsLoad { get; set; }
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: acecbcc2903fe7044bfb88198181773a
|
||||
guid: e562d8d5a2bf0c04486e6b861c2d9b37
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -1,20 +1,18 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using Stary.Evo;
|
||||
using UnityEngine;
|
||||
using YooAsset;
|
||||
|
||||
namespace Main
|
||||
namespace Stary.Evo.TableTextConversion
|
||||
{
|
||||
public interface IVideoTableData : ITableData
|
||||
public interface IVideoTableDataCore : ITableDataCore
|
||||
{
|
||||
UniTask LoadData();
|
||||
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 bool IsLoad { get; set; }
|
||||
@@ -35,8 +33,7 @@ namespace Main
|
||||
}
|
||||
|
||||
|
||||
async UniTask<Stary.Evo.TableTextConversion.VideoTableData.MessageInfo> IVideoTableData.PlayVideoName(
|
||||
string vidid)
|
||||
public async UniTask<Stary.Evo.TableTextConversion.VideoTableData.MessageInfo> PlayVideoName(string vidid)
|
||||
{
|
||||
if (!IsLoad)
|
||||
{
|
||||
Reference in New Issue
Block a user