1
This commit is contained in:
@@ -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
|
||||
/// <summary>
|
||||
/// 依赖服务集合
|
||||
/// </summary>
|
||||
@@ -176,13 +176,18 @@ namespace BITKit
|
||||
/// <summary>
|
||||
/// 依赖服务提供接口
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 服务创建后的回调
|
||||
/// </summary>
|
||||
public static Action<ServiceProvider> OnServiceProviderBuilded;
|
||||
#endif
|
||||
public static Action<ServiceProvider> OnServiceProviderBuild;
|
||||
/// <summary>
|
||||
/// 主线程
|
||||
/// </summary>
|
||||
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user