This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2024-10-16 02:48:23 +08:00
parent 9cd469b811
commit 44c3ea001a
146 changed files with 28324 additions and 11203 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 66a61ebb88a94e742a5d74adb5ad268f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 382f010898382c74c85229058ab6e520
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d51534464e7d0684697d37b78f571c58
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 826cf248984883c4abafb851d9ab209f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,89 @@
using FairyGUI;
using HotMain;
using HotMain.SHGame.Procedure;
using Launcher;
using SHFrame;
using YooAsset;
namespace HotScripts.GameLauncher.FGui.Scripts
{
public class LauncherUI : UIBase
{
public UI_Launcher UIView => View as UI_Launcher;
private long totalDownloadBytes = 0;
public override void OnInit()
{
}
public override void OnOpen(params object[] param)
{
//显示需要升级的大小
ResourcePackage rawFilePackage = YooAssets.GetPackage(ProcedureInitializePackage.RawFilePackageName);
totalDownloadBytes += rawFilePackage.CreateResourceDownloader(10, 3, 60).TotalDownloadBytes;
ResourcePackage defaultPackage = YooAssets.GetPackage(ProcedureInitializePackage.DefaultPackageName);
totalDownloadBytes += defaultPackage.CreateResourceDownloader(10, 3, 60).TotalDownloadBytes;
if (totalDownloadBytes <= 0)
{
UIView.m_title.text = "资源已经最新";
}
else
{
UIView.m_title.text = $"需更新 {totalDownloadBytes} 字节资源";
}
}
public override void AddListener()
{
UIView.m_downloader.onClick.Add(OnDownloader);
EventUtil.AddListener(HotMainEvent.DownloaderProgressUpdate,OnDownloaderProgressUpdate);
}
public override void RemoveListener()
{
UIView.m_downloader.onClick.Add(OnDownloader);
EventUtil.RemoveListener(HotMainEvent.DownloaderProgressUpdate,OnDownloaderProgressUpdate);
}
private void OnDownloader(EventContext context)
{
EventUtil.DispatchEvent(HotMainEvent.StartDownloader);
}
/// <summary>
/// 资源更新进度
/// </summary>
private void OnDownloaderProgressUpdate(EventArgs eventargs)
{
int totalCount = (int)eventargs.args[0];
int currentCount = (int)eventargs.args[1];
long totalBytes = (long)eventargs.args[2];
long currentBytes = (long)eventargs.args[3];
if (currentBytes <= 0)
{
UIView.m_progress.value = 0;
}else
{
UIView.m_progress.value = (currentBytes*100) / totalBytes;
}
UIView.m_title.text = $"文件总数:{totalCount}, 已下载文件数:{currentCount}, 下载总大小:{totalBytes}, 已下载大小:{currentBytes}";
}
public override void OnClose()
{
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 0f0dc1f485ca487e8a69893724fdd2bd
timeCreated: 1729011198

View File

@@ -0,0 +1,20 @@
{
"name": "GameLauncher",
"rootNamespace": "",
"references": [
"GUID:f4270d81837019d47b93f11421168dae",
"GUID:f51ebe6a0ceec4240a699833d6309b23",
"GUID:23aed7c57bb0a5d49aeaef92abb5bfff",
"GUID:e34a5702dd353724aa315fb8011f08c3",
"GUID:00b62574639528e40bdd0ce0d013db67"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b12e2c634b4214e4bab66a9cac501248
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,20 @@
using Cysharp.Threading.Tasks;
using HotScripts.GameLauncher.FGui.Scripts;
using Launcher;
using SHFrame;
using UnityEngine;
public class HotLauncherMain : MonoBehaviour
{
private void Start()
{
//打开下载页
RunLauncher().Forget();
}
private async UniTask RunLauncher()
{
LauncherBinder.BindAll();
await SHFrameModule.UI.Open<LauncherUI>("Launcher", "Launcher", UILayerEnum.Root);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9a4484ccb149dc24aa373a560079afd7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a0e886dedded7384784adaae86dd1ddf
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4f6f997587afcb840b9139ce8a3ff3b2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0f45d335a26535941bd3040692e68b2d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,16 @@
{
"name": "GameScripts",
"rootNamespace": "",
"references": [
"GUID:f4270d81837019d47b93f11421168dae"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 30cdc49ab6f9ba240b6b000711d4e038
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -4,6 +4,6 @@ public class InstantiateByAsset : MonoBehaviour
{
void Start()
{
Debug.Log("原始代码3333");
Debug.Log("原始代码9999");
}
}