2024-11-03 16:42:23 +08:00
|
|
|
using System.Threading;
|
|
|
|
using BITKit;
|
|
|
|
using BITKit.UX;
|
|
|
|
using Cysharp.Threading.Tasks;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Net.Like.Xue.Tokyo.UX;
|
2024-11-20 11:36:36 +08:00
|
|
|
using Net.Project.B.UX;
|
2024-11-03 16:42:23 +08:00
|
|
|
using Project.B.UX;
|
|
|
|
using UnityEngine;
|
2025-02-24 23:03:39 +08:00
|
|
|
using IUXDialogue = Net.Project.B.UX.IUXDialogue;
|
2024-11-03 16:42:23 +08:00
|
|
|
|
|
|
|
namespace Net.Like.Xue.Tokyo
|
|
|
|
{
|
|
|
|
public class Program : MonoBehaviour
|
|
|
|
{
|
|
|
|
private async void Start()
|
|
|
|
{
|
|
|
|
DontDestroyOnLoad(gameObject);
|
|
|
|
var source = new CancellationTokenSource();
|
|
|
|
destroyCancellationToken.Register(source.Cancel);
|
|
|
|
|
2024-12-28 23:19:55 +08:00
|
|
|
var serviceCollection = BITApp.ServiceCollection = new ServiceCollection();
|
2024-11-03 16:42:23 +08:00
|
|
|
|
2025-02-24 23:03:39 +08:00
|
|
|
await global::Project.B.Program.AddProjectBServices(serviceCollection,source);
|
2024-12-29 17:52:04 +08:00
|
|
|
|
2024-12-28 23:19:55 +08:00
|
|
|
serviceCollection.AddSingleton<IUXService, UXService>();
|
2025-02-24 23:03:39 +08:00
|
|
|
|
2025-02-26 15:34:59 +08:00
|
|
|
serviceCollection.AddSingleton<UXRadialMenu>();
|
|
|
|
serviceCollection.AddSingleton<UXContextMenu>();
|
|
|
|
|
2025-02-24 23:03:39 +08:00
|
|
|
serviceCollection.AddSingleton<IUXDialogue, UXDialogue<UXHud>>();
|
|
|
|
serviceCollection.AddSingleton<IUXLoadingMap, UXLoadingMap>();
|
2024-12-28 23:19:55 +08:00
|
|
|
serviceCollection.AddSingleton<UXMenu>();
|
|
|
|
serviceCollection.AddSingleton<UXLevel>();
|
2025-02-24 23:03:39 +08:00
|
|
|
serviceCollection.AddSingleton<UXHud>();
|
2025-02-26 15:34:59 +08:00
|
|
|
serviceCollection.AddSingleton<UXMap>();
|
|
|
|
serviceCollection.AddSingleton<IUXCosmetics, UXCosmetics<UXMenu>>();
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IUXBuyStation, UXBuyStation>();
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IUXInventory, UXInventory<UXHud>>();
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IUXSnapshotWindow, UXSnapshotWindow>();
|
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IUXItemInspector, UXItemInspector>();
|
2025-02-27 17:52:42 +08:00
|
|
|
|
|
|
|
serviceCollection.AddSingleton<IUXInventorySwap, UXInventorySwap>();
|
2025-02-24 23:03:39 +08:00
|
|
|
|
2024-11-03 16:42:23 +08:00
|
|
|
//获取服务提供者
|
2024-11-20 11:36:36 +08:00
|
|
|
await using var serviceProvider = BITApp.ServiceProvider = serviceCollection.BuildServiceProvider();
|
2024-11-03 16:42:23 +08:00
|
|
|
|
2025-02-24 23:03:39 +08:00
|
|
|
await global::Project.B.Program.BuildServiceProvider(serviceProvider,destroyCancellationToken);
|
|
|
|
|
|
|
|
var uxService = serviceProvider.GetRequiredService<IUXService>();
|
|
|
|
|
|
|
|
await uxService.InitializeAsync();
|
|
|
|
|
|
|
|
uxService.Entry<UXMenu>();
|
2024-11-20 11:36:36 +08:00
|
|
|
|
2025-02-24 23:03:39 +08:00
|
|
|
serviceProvider.GetRequiredService<UXHud>();
|
2024-12-28 23:19:55 +08:00
|
|
|
|
2025-02-24 23:03:39 +08:00
|
|
|
serviceProvider.GetRequiredService<IUXDialogue>();
|
2024-12-28 23:19:55 +08:00
|
|
|
|
2025-02-24 23:03:39 +08:00
|
|
|
serviceProvider.GetRequiredService<IUXLoadingMap>();
|
2024-11-13 17:47:45 +08:00
|
|
|
|
2025-02-26 15:34:59 +08:00
|
|
|
serviceProvider.GetRequiredService<IUXSnapshotWindow>();
|
|
|
|
|
|
|
|
serviceProvider.GetRequiredService<IUXCosmetics>();
|
|
|
|
|
|
|
|
serviceProvider.GetRequiredService<IUXBuyStation>();
|
|
|
|
|
2025-02-28 16:58:23 +08:00
|
|
|
var inventory = serviceProvider.GetRequiredService<IUXInventory>();
|
|
|
|
inventory.AutoInspect = ItemQuality.Develop;
|
2025-02-26 15:34:59 +08:00
|
|
|
|
|
|
|
serviceProvider.GetRequiredService<UXContextMenu>();
|
2025-02-27 17:52:42 +08:00
|
|
|
|
|
|
|
|
|
|
|
serviceProvider.GetRequiredService<IUXInventorySwap>();
|
2025-02-26 15:34:59 +08:00
|
|
|
|
2024-11-16 15:45:30 +08:00
|
|
|
Application.targetFrameRate = 165;
|
2024-11-03 16:42:23 +08:00
|
|
|
|
|
|
|
await destroyCancellationToken.WaitUntilCanceled();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|