diff --git a/Src/Core/Applation/BITApp.cs b/Src/Core/Applation/BITApp.cs
index 75d66fd..15f8898 100644
--- a/Src/Core/Applation/BITApp.cs
+++ b/Src/Core/Applation/BITApp.cs
@@ -7,6 +7,8 @@ using Cysharp.Threading.Tasks;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
+using Microsoft.Extensions.DependencyInjection;
+
// ReSharper disable StringLiteralTypo
#if NET5_0_OR_GREATER
using Microsoft.Extensions.DependencyInjection;
@@ -18,10 +20,9 @@ namespace BITKit
{
public override string Message => "Application Is Not Playing";
}
+ // ReSharper disable once InconsistentNaming
public class BITApp
{
- public static int Count => _count++;
- private static int _count;
public static async UniTask SwitchToMainThread()
{
#if UNITY_5_3_OR_NEWER
@@ -168,7 +169,6 @@ namespace BITKit
"MySql",
};
}
- #if NET5_0_OR_GREATER
///
/// 依赖服务集合
///
@@ -176,13 +176,18 @@ namespace BITKit
///
/// 依赖服务提供接口
///
- public static ServiceProvider ServiceProvider { get; internal set; }
+ public static ServiceProvider ServiceProvider { get; private set; }
+ public static ServiceProvider BuildServiceProvider()
+ {
+ var value = ServiceProvider = ServiceCollection.BuildServiceProvider();
+ OnServiceProviderBuild?.Invoke(value);
+ return value;
+ }
///
/// 服务创建后的回调
///
- public static Action OnServiceProviderBuilded;
-#endif
+ public static Action OnServiceProviderBuild;
///
/// 主线程
///
@@ -254,7 +259,6 @@ namespace BITKit
private static DateTime InitialTime { get; set; }=DateTime.Now;
public static async UniTask Start(string appName = nameof(BITApp),AppSettings settings=default)
{
- _count = 0;
Time.TimeAsDouble = 0;
Time.DeltaTime = 1 / 60f;
diff --git a/Src/Core/Auth.meta b/Src/Core/Auth.meta
deleted file mode 100644
index 7987d36..0000000
--- a/Src/Core/Auth.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: ef5795e833a88cd4b8c1485d4b50ebfd
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Src/Core/AutoMapper/BITMapper.cs b/Src/Core/AutoMapper/BITMapper.cs
index 0b7c900..a9f8f42 100644
--- a/Src/Core/AutoMapper/BITMapper.cs
+++ b/Src/Core/AutoMapper/BITMapper.cs
@@ -2,7 +2,7 @@
{
public static class BITMapper
{
- public static void Map(T source, T target) where T : class
+ public static T Map(object source, T target) where T : class
{
foreach (var info in source.GetType().GetProperties(ReflectionHelper.Flags))
{
@@ -23,6 +23,7 @@
targetInfo?.SetValue(target, value);
}
}
+ return target;
}
}
}
diff --git a/Src/Core/Binary/BITBinary.cs b/Src/Core/Binary/BITBinary.cs
index 66e88ed..b143b61 100644
--- a/Src/Core/Binary/BITBinary.cs
+++ b/Src/Core/Binary/BITBinary.cs
@@ -137,50 +137,58 @@ namespace BITKit
}
public static void Write(BinaryWriter writer, object value)
{
- if (value is not string && value is IList enumerable)
+ try
{
- var pars = enumerable.Cast