添加了3DText
This commit is contained in:
8
Assets/Scripts/HotUpdate/Main/UI/LoadingWindow.meta
Normal file
8
Assets/Scripts/HotUpdate/Main/UI/LoadingWindow.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b273eeefab12b774ca0fffb36391a0db
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,37 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using YooAsset;
|
||||
|
||||
public class LoadingWindow : UIBaseWindow
|
||||
{
|
||||
public Slider slider;
|
||||
public Text progressText;
|
||||
private HandleBase _currentOperation;
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (_currentOperation == null) return;
|
||||
|
||||
slider.value = _currentOperation.Progress;
|
||||
Debug.Log(slider.value);
|
||||
if (progressText != null)
|
||||
progressText.text = $"{_currentOperation.Progress * 100:F0}%";
|
||||
|
||||
if (_currentOperation.IsDone)
|
||||
StopTracking();
|
||||
}
|
||||
|
||||
public void TrackOperation(HandleBase operation)
|
||||
{
|
||||
_currentOperation = operation;
|
||||
gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
public void StopTracking()
|
||||
{
|
||||
_currentOperation = null;
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e49b2fed14fbfcd48804c019a87aee19
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user