30 lines
789 B
C#
30 lines
789 B
C#
#if NETCOREAPP
|
|
using System;
|
|
using Cysharp.Threading.Tasks;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
namespace BITKit;
|
|
|
|
public class BITAppForNet
|
|
{
|
|
[Obsolete("Use InitializeAsync instead")]
|
|
public static UniTask Init(string name)=>UniTask.CompletedTask;
|
|
|
|
public static async UniTask InitializeAsync(string name)
|
|
{
|
|
BIT4Log.OnLog += Console.WriteLine;
|
|
BIT4Log.OnWarning += Console.WriteLine;
|
|
BIT4Log.OnException += e => Console.WriteLine(e.ToString());
|
|
BIT4Log.OnSetConsoleColor += color => Console.ForegroundColor = color;
|
|
BIT4Log.OnNextLine += Console.WriteLine;
|
|
|
|
await BITApp.Start(name);
|
|
await BITBinary.Start();
|
|
}
|
|
public static UniTask DisposeAsync()
|
|
{
|
|
BITApp.Stop();
|
|
return UniTask.CompletedTask;
|
|
}
|
|
}
|
|
#endif |