Init
This commit is contained in:
13
Assets/GameScripts/Preload/GamePreload.cs
Normal file
13
Assets/GameScripts/Preload/GamePreload.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using UnityEngine;
|
||||
using Tuan.GameFramework;
|
||||
|
||||
namespace Tuan.GameScripts.Preload
|
||||
{
|
||||
public class GamePreload : Singleton<GamePreload>
|
||||
{
|
||||
public void Test(string msg)
|
||||
{
|
||||
Debug.Log($"GamePreload.Test:{msg}");
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/GameScripts/Preload/GamePreload.cs.meta
Normal file
2
Assets/GameScripts/Preload/GamePreload.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f70a842d4d8919e41a34b7ad7012e9ff
|
||||
16
Assets/GameScripts/Preload/GameScripts.Preload.asmdef
Normal file
16
Assets/GameScripts/Preload/GameScripts.Preload.asmdef
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "GameScripts.Preload",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:63f032f8696ad5b4e99c26f7a9f89060"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 921b262766d31374c8fd93ad67954b9c
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
51
Assets/GameScripts/Preload/PatchWindow.cs
Normal file
51
Assets/GameScripts/Preload/PatchWindow.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.Video;
|
||||
using Tuan.GameFramework;
|
||||
|
||||
namespace Tuan.GameScripts.Preload
|
||||
{
|
||||
public class PatchWindow : MonoBehaviour
|
||||
{
|
||||
public Text statusText;
|
||||
public Slider progressBar;
|
||||
public Text downloadSizeText;
|
||||
public VideoPlayer video;
|
||||
private void Awake()
|
||||
{
|
||||
video.targetCamera = MainUICanvas.Inst.UICamera;
|
||||
PatchEvent.OnStatusUpdate += OnStatusUpdate;
|
||||
PatchEvent.OnProgressUpdate += OnProgressUpdate;
|
||||
PatchEvent.OnDownloadSizeUpdate += OnDownloadSizeUpdate;
|
||||
PatchEvent.OnClosePatchWindow += OnClosePatchWindow;
|
||||
}
|
||||
private void OnDestroy()
|
||||
{
|
||||
PatchEvent.OnStatusUpdate -= OnStatusUpdate;
|
||||
PatchEvent.OnProgressUpdate -= OnProgressUpdate;
|
||||
PatchEvent.OnDownloadSizeUpdate -= OnDownloadSizeUpdate;
|
||||
}
|
||||
|
||||
private void OnStatusUpdate(string status)
|
||||
{
|
||||
if (statusText != null)
|
||||
statusText.text = status;
|
||||
}
|
||||
|
||||
private void OnProgressUpdate(float progress)
|
||||
{
|
||||
if (progressBar != null)
|
||||
progressBar.value = progress;
|
||||
}
|
||||
|
||||
private void OnDownloadSizeUpdate(string sizeText)
|
||||
{
|
||||
if (downloadSizeText != null)
|
||||
downloadSizeText.text = sizeText;
|
||||
}
|
||||
private void OnClosePatchWindow()
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/GameScripts/Preload/PatchWindow.cs.meta
Normal file
2
Assets/GameScripts/Preload/PatchWindow.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5a0d239551fa52c4d9907777f1f485bf
|
||||
Reference in New Issue
Block a user