1
This commit is contained in:
@@ -46,6 +46,8 @@ namespace BITKit
|
||||
[SerializeReference, SubclassSelector] private IRemoteServices remoteServices;
|
||||
[SerializeReference, SubclassSelector] private IBuildinQueryServices buildinQueryServices;
|
||||
|
||||
[SerializeField] private Optional<string> loadEntryScene;
|
||||
|
||||
[SerializeField] private UIDocument document;
|
||||
|
||||
[SerializeField] private bool isOffline;
|
||||
@@ -178,12 +180,23 @@ namespace BITKit
|
||||
YooAssetUtils.RegisterPackage(packageName.Value);
|
||||
YooAssetUtils.RegisterResourcePackage(package);
|
||||
|
||||
if (document)
|
||||
Destroy(document);
|
||||
SceneManager.LoadScene(1);
|
||||
if (loadEntryScene.Allow)
|
||||
{
|
||||
_progressLabel.text="正在加载场景...";
|
||||
await package.LoadSceneAsync(loadEntryScene.Value);
|
||||
if (document)
|
||||
Destroy(document);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (document)
|
||||
Destroy(document);
|
||||
SceneManager.LoadScene(1);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
await UniTask.SwitchToMainThread();
|
||||
_progressBar.value =0;
|
||||
_progressLabel.text = e.Message;
|
||||
}
|
||||
|
20
Src/Unity/Scripts/Assets/YooAssetVersionEvent.cs
Normal file
20
Src/Unity/Scripts/Assets/YooAssetVersionEvent.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using YooAsset;
|
||||
|
||||
namespace BITKit
|
||||
{
|
||||
public class YooAssetVersionEvent : MonoBehaviour
|
||||
{
|
||||
[SerializeReference, SubclassSelector] private IReference packageName;
|
||||
[SerializeField] private UnityEvent<string> output;
|
||||
private void Start()
|
||||
{
|
||||
var package = YooAssets.GetPackage(packageName.Value);
|
||||
output?.Invoke(package.GetPackageVersion());
|
||||
}
|
||||
}
|
||||
}
|
11
Src/Unity/Scripts/Assets/YooAssetVersionEvent.cs.meta
Normal file
11
Src/Unity/Scripts/Assets/YooAssetVersionEvent.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d8adb662636da83409ffabc85b2df24e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user