mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d51534464e7d0684697d37b78f571c58
|
||||
guid: daf23295ecba47f4aaea7c1eb5d2ac11
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5ad8b594dcec3544bb060084303c6e20
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,15 @@
|
||||
/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
|
||||
|
||||
using FairyGUI;
|
||||
|
||||
namespace Launcher
|
||||
{
|
||||
public class LauncherBinder
|
||||
{
|
||||
public static void BindAll()
|
||||
{
|
||||
UIObjectFactory.SetPackageItemExtension(UI_Button.URL, typeof(UI_Button));
|
||||
UIObjectFactory.SetPackageItemExtension(UI_Launcher.URL, typeof(UI_Launcher));
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d082f02b9c184cb4e880a9a47b088792
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,25 @@
|
||||
/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
|
||||
|
||||
using FairyGUI;
|
||||
using FairyGUI.Utils;
|
||||
|
||||
namespace Launcher
|
||||
{
|
||||
public partial class UI_Button : GButton
|
||||
{
|
||||
public Controller m_Type;
|
||||
public const string URL = "ui://h88wuvsbed8im2";
|
||||
|
||||
public static UI_Button CreateInstance()
|
||||
{
|
||||
return (UI_Button)UIPackage.CreateObject("Launcher", "Button");
|
||||
}
|
||||
|
||||
public override void ConstructFromXML(XML xml)
|
||||
{
|
||||
base.ConstructFromXML(xml);
|
||||
|
||||
m_Type = GetControllerAt(1);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 640b003b63f42c2489ddda56671df3d5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,31 @@
|
||||
/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
|
||||
|
||||
using FairyGUI;
|
||||
using FairyGUI.Utils;
|
||||
|
||||
namespace Launcher
|
||||
{
|
||||
public partial class UI_Launcher : GComponent
|
||||
{
|
||||
public Controller m_Type;
|
||||
public GProgressBar m_progress;
|
||||
public GTextField m_title;
|
||||
public UI_Button m_downloader;
|
||||
public const string URL = "ui://h88wuvsbkpkc0";
|
||||
|
||||
public static UI_Launcher CreateInstance()
|
||||
{
|
||||
return (UI_Launcher)UIPackage.CreateObject("Launcher", "Launcher");
|
||||
}
|
||||
|
||||
public override void ConstructFromXML(XML xml)
|
||||
{
|
||||
base.ConstructFromXML(xml);
|
||||
|
||||
m_Type = GetControllerAt(0);
|
||||
m_progress = (GProgressBar)GetChildAt(1);
|
||||
m_title = (GTextField)GetChildAt(2);
|
||||
m_downloader = (UI_Button)GetChildAt(3);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 45c6da4efa15f2c47a3b57b10d47d6ba
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cccf8f03bd08441fbe4c9f253a62a4a2
|
||||
timeCreated: 1729067678
|
@@ -5,7 +5,7 @@ using Launcher;
|
||||
using SHFrame;
|
||||
using YooAsset;
|
||||
|
||||
namespace HotScripts.GameLauncher.FGui.Scripts
|
||||
namespace HotScripts.GameLauncher.FGui.Scripts.Launcher
|
||||
{
|
||||
public class LauncherUI : UIBase
|
||||
{
|
||||
@@ -29,10 +29,12 @@ namespace HotScripts.GameLauncher.FGui.Scripts
|
||||
if (totalDownloadBytes <= 0)
|
||||
{
|
||||
UIView.m_title.text = "资源已经最新";
|
||||
EventUtil.DispatchEvent(HotMainEvent.StartDownloader);
|
||||
}
|
||||
else
|
||||
{
|
||||
UIView.m_title.text = $"需更新 {totalDownloadBytes} 字节资源";
|
||||
UIView.m_Type.selectedIndex = 1;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -44,22 +46,42 @@ namespace HotScripts.GameLauncher.FGui.Scripts
|
||||
UIView.m_downloader.onClick.Add(OnDownloader);
|
||||
|
||||
EventUtil.AddListener(HotMainEvent.DownloaderProgressUpdate,OnDownloaderProgressUpdate);
|
||||
EventUtil.AddListener(HotLauncherEvent.InitSuccess,OnInitSuccess);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public override void RemoveListener()
|
||||
{
|
||||
UIView.m_downloader.onClick.Add(OnDownloader);
|
||||
|
||||
EventUtil.RemoveListener(HotMainEvent.DownloaderProgressUpdate,OnDownloaderProgressUpdate);
|
||||
EventUtil.RemoveListener(HotLauncherEvent.InitSuccess,OnInitSuccess);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void OnDownloader(EventContext context)
|
||||
{
|
||||
EventUtil.DispatchEvent(HotMainEvent.StartDownloader);
|
||||
if (UIView.m_Type.selectedIndex != 2)
|
||||
{
|
||||
EventUtil.DispatchEvent(HotMainEvent.StartDownloader);
|
||||
}
|
||||
else
|
||||
{
|
||||
EventUtil.DispatchEvent(HotLauncherEvent.GoGameMain);
|
||||
SHFrameModule.UI.Close("Launcher", "Launcher");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 初始化完成 进入游戏
|
||||
/// </summary>
|
||||
/// <param name="eventargs"></param>
|
||||
private void OnInitSuccess(EventArgs eventargs)
|
||||
{
|
||||
UIView.m_Type.selectedIndex = 2;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 资源更新进度
|
Reference in New Issue
Block a user