1
This commit is contained in:
@@ -3,7 +3,9 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using BITKit;
|
||||
using BITKit.Console;
|
||||
using BITKit.Mod;
|
||||
using BITKit.Pool;
|
||||
using BITKit.UX;
|
||||
using BITKit.WorldNode;
|
||||
using Cysharp.Threading.Tasks;
|
||||
@@ -14,6 +16,7 @@ using Microsoft.Extensions.Hosting.Unity;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Net.Like.Xue.Tokyo.GameService;
|
||||
using Net.Like.Xue.Tokyo.UX;
|
||||
using Net.Project.B.Health;
|
||||
using Net.Project.B.Interaction;
|
||||
using Net.Project.B.WorldNode;
|
||||
using Project.B.Animation;
|
||||
@@ -51,12 +54,21 @@ namespace Net.Like.Xue.Tokyo
|
||||
|
||||
//玩家角色控制器服务
|
||||
serviceCollection.AddSingleton<ICharacterService, CharacterService>();
|
||||
|
||||
//玩家生命值
|
||||
serviceCollection.AddSingleton<IHealthService, HealthService>();
|
||||
//对象池
|
||||
serviceCollection.AddSingleton<IPoolService, UnityPoolService>();
|
||||
//击倒服务
|
||||
serviceCollection.AddSingleton<IKnockedService, KnockedService>();
|
||||
|
||||
var scriptablePlayerAnimation =await
|
||||
ModService.LoadAsset<ScriptablePlayerAnimationFactory>("scriptable_player_animations");
|
||||
//玩家动画
|
||||
serviceCollection.AddSingleton<IPlayerAnimationFactory, PlayerAnimationFactory>();
|
||||
serviceCollection.AddSingleton<IPlayerAnimationFactory>(scriptablePlayerAnimation);
|
||||
|
||||
//注册实体工厂
|
||||
serviceCollection.AddProjectBEntitiesFactory();
|
||||
serviceCollection.AddSingleton<IPlayerFactory, YangdunCreateFactory>();
|
||||
|
||||
//注册地图服务
|
||||
serviceCollection.AddSingleton<IGameMapService, GameMapService>();
|
||||
@@ -93,6 +105,7 @@ namespace Net.Like.Xue.Tokyo
|
||||
serviceCollection.AddSingleton<UXMap>();
|
||||
serviceCollection.AddSingleton<UXLoadingMap>();
|
||||
serviceCollection.AddSingleton<UXMenu>();
|
||||
serviceCollection.AddSingleton<UXConsole>();
|
||||
|
||||
//生成玩家
|
||||
serviceCollection.AddSingleton<GameSpawnPlayerService>();
|
||||
@@ -141,7 +154,9 @@ namespace Net.Like.Xue.Tokyo
|
||||
//初始化场景高亮
|
||||
serviceProvider.GetRequiredService<WorldHighlightService>();
|
||||
|
||||
Application.targetFrameRate = 60;
|
||||
serviceProvider.GetRequiredService<UXConsole>();
|
||||
|
||||
Application.targetFrameRate = 90;
|
||||
|
||||
await destroyCancellationToken.WaitUntilCanceled();
|
||||
}
|
||||
|
Reference in New Issue
Block a user