Compare commits

..

6 Commits

Author SHA1 Message Date
ALEXTANG
01f8eb9d57 升级HybridCLR 4.0.10=>4.0.11 强烈建议升级,修复了若干bug
升级HybridCLR 4.0.10=>4.0.11 强烈建议升级,修复了若干bug
2023-11-02 10:01:30 +08:00
ALEXTANG
f5021a9688 修正Utility生命周期注入OnDestroy和OnDrawGizmos无效的问题
修正Utility生命周期注入OnDestroy和OnDrawGizmos无效的问题
2023-10-31 12:45:40 +08:00
ALEXTANG
a632f7a5ad Merge pull request #55 from AlanWeekend/main
修复demo流程的下载网速显示错误问题
2023-10-30 23:48:17 +08:00
Weekend
5f968f4154 优化网速计算
优化网速计算
2023-10-30 23:47:07 +08:00
Weekend
c9fe83c2bd Merge branch 'main' of https://github.com/AlanWeekend/TEngine 2023-10-30 23:04:05 +08:00
Weekend
2c00d103cb Update ProcedureDownloadFile.cs
fixed:demo流程的下载网速错误显示问题
2023-10-30 23:04:01 +08:00
4 changed files with 22 additions and 15 deletions

View File

@@ -13,10 +13,9 @@ namespace GameMain
private ProcedureOwner _procedureOwner; private ProcedureOwner _procedureOwner;
private float _currentDownloadTime;
private float CurrentSpeed => private float CurrentSpeed =>
(GameModule.Resource.Downloader.TotalDownloadBytes - (GameModule.Resource.Downloader.TotalDownloadBytes -
GameModule.Resource.Downloader.CurrentDownloadBytes) / _currentDownloadTime; GameModule.Resource.Downloader.CurrentDownloadBytes) / GameTime.time;
protected override void OnEnter(ProcedureOwner procedureOwner) protected override void OnEnter(ProcedureOwner procedureOwner)
{ {

View File

@@ -225,15 +225,6 @@ namespace TEngine
} }
#endregion #endregion
/// <summary>
/// 释放Behaviour生命周期。
/// </summary>
public static void Release()
{
_MakeEntity();
_behaviour.Release();
}
private static void _MakeEntity() private static void _MakeEntity()
{ {
if (_entity != null) if (_entity != null)
@@ -241,11 +232,12 @@ namespace TEngine
return; return;
} }
_entity = new GameObject("__MonoUtility__") _entity = new GameObject("[Unity.Utility]")
{ {
hideFlags = HideFlags.HideAndDontSave // hideFlags = HideFlags.HideAndDontSave
}; };
_entity.SetActive(true); _entity.SetActive(true);
_entity.transform.SetParent(GameModule.Base.transform);
#if UNITY_EDITOR #if UNITY_EDITOR
if (Application.isPlaying) if (Application.isPlaying)
@@ -258,6 +250,22 @@ namespace TEngine
_behaviour = _entity.AddComponent<MainBehaviour>(); _behaviour = _entity.AddComponent<MainBehaviour>();
} }
/// <summary>
/// 释放Behaviour生命周期。
/// </summary>
public static void Shutdown()
{
if (_behaviour != null)
{
_behaviour.Release();
}
if (_entity != null)
{
Object.Destroy(_entity);
}
_entity = null;
}
private class MainBehaviour : MonoBehaviour private class MainBehaviour : MonoBehaviour
{ {
private event UnityAction UpdateEvent; private event UnityAction UpdateEvent;

View File

@@ -77,7 +77,7 @@ namespace TEngine
public static void Shutdown(ShutdownType shutdownType) public static void Shutdown(ShutdownType shutdownType)
{ {
Log.Info("Shutdown Game Framework ({0})...", shutdownType); Log.Info("Shutdown Game Framework ({0})...", shutdownType);
Utility.Unity.Release(); Utility.Unity.Shutdown();
RootModule rootModule = GetModule<RootModule>(); RootModule rootModule = GetModule<RootModule>();
if (rootModule != null) if (rootModule != null)
{ {

View File

@@ -5,7 +5,7 @@
"depth": 0, "depth": 0,
"source": "git", "source": "git",
"dependencies": {}, "dependencies": {},
"hash": "216d09f7b65fadc5d8fcd0bba82e5ac50ca58f06" "hash": "84ed2e6b9d0e476b1da70ea1f4e4b1e7c33ae7f8"
}, },
"com.cysharp.unitask": { "com.cysharp.unitask": {
"version": "file:UniTask", "version": "file:UniTask",