From bb257507bcd66b36e02aa598fa71a64aac0858e1 Mon Sep 17 00:00:00 2001
From: CortexCore <2630229280@qq.com>
Date: Sat, 23 Nov 2024 17:20:13 +0800
Subject: [PATCH] 1
---
.gitignore | 10 ++
Com.Project.B.csproj | 23 ++++
Src/Authorize.meta | 8 ++
Src/Authorize/Com.Project.B.Authorize.asmdef | 17 +++
.../Com.Project.B.Authorize.asmdef.meta | 7 ++
Src/Authorize/IAuthorizeData.cs | 35 ++++++
Src/Authorize/IAuthorizeData.cs.meta | 3 +
Src/Authorize/IAuthorizeService.cs | 43 +++++++
Src/Authorize/IAuthorizeService.cs.meta | 11 ++
Src/CharacterAnimation.meta | 8 ++
.../Com.Project.B.CharacterAnimation.asmdef | 19 +++
...m.Project.B.CharacterAnimation.asmdef.meta | 7 ++
Src/CharacterAnimation/IAnimationFactory.cs | 12 ++
.../IAnimationFactory.cs.meta | 11 ++
.../IHumanoidAnimationFactory.cs | 21 ++++
.../IHumanoidAnimationFactory.cs.meta | 11 ++
.../IPlayerAnimationFactory.cs | 12 ++
.../IPlayerAnimationFactory.cs.meta | 11 ++
Src/CharacterController.meta | 8 ++
.../Com.Project.B.CharacterController.asmdef | 17 +++
....Project.B.CharacterController.asmdef.meta | 7 ++
.../IBotCharacterController.cs | 8 ++
.../IBotCharacterController.cs.meta | 11 ++
.../ICharacterController.cs | 19 +++
.../ICharacterController.cs.meta | 11 ++
Src/CharacterController/ICharacterService.cs | 12 ++
.../ICharacterService.cs.meta | 11 ++
Src/CharacterController/ICharacterState.cs | 73 ++++++++++++
.../ICharacterState.cs.meta | 11 ++
.../IPlayerCharacterController.cs | 20 ++++
.../IPlayerCharacterController.cs.meta | 11 ++
Src/Dialogue.meta | 8 ++
Src/Dialogue/IDialogueData.cs | 79 +++++++++++++
Src/Dialogue/IDialogueData.cs.meta | 11 ++
Src/Dialogue/IDialogueService.cs | 91 +++++++++++++++
Src/Dialogue/IDialogueService.cs.meta | 11 ++
Src/Dialogue/Net.Project.B.Dialogue.asmdef | 17 +++
.../Net.Project.B.Dialogue.asmdef.meta | 7 ++
Src/Entities.meta | 8 ++
Src/Entities/Com.Project.B.Entities.asmdef | 17 +++
.../Com.Project.B.Entities.asmdef.meta | 7 ++
Src/Entities/IEntitiesFactory.cs | 18 +++
Src/Entities/IEntitiesFactory.cs.meta | 11 ++
Src/Entities/IGameEntitiesService.cs | 11 ++
Src/Entities/IGameEntitiesService.cs.meta | 11 ++
Src/Entities/INpcFactory.cs | 7 ++
Src/Entities/INpcFactory.cs.meta | 11 ++
Src/Entities/IPlayerFactory.cs | 10 ++
Src/Entities/IPlayerFactory.cs.meta | 11 ++
Src/GameService.meta | 8 ++
.../Com.Project.B.GameService.asmdef | 18 +++
.../Com.Project.B.GameService.asmdef.meta | 7 ++
Src/GameService/IGameMapService.cs | 58 ++++++++++
Src/GameService/IGameMapService.cs.meta | 11 ++
Src/Health.meta | 8 ++
Src/Health/HealthService.cs | 89 ++++++++++++++
Src/Health/HealthService.cs.meta | 11 ++
Src/Health/KnockedService.cs | 109 ++++++++++++++++++
Src/Health/KnockedService.cs.meta | 11 ++
Src/Health/Net.Project.B.Health.asmdef | 17 +++
Src/Health/Net.Project.B.Health.asmdef.meta | 7 ++
Src/Interaction.meta | 8 ++
.../Com.Project.B.Interaction.asmdef | 14 +++
.../Com.Project.B.Interaction.asmdef.meta | 7 ++
Src/Interaction/IWorldInteractionService.cs | 64 ++++++++++
.../IWorldInteractionService.cs.meta | 11 ++
Src/Interaction/IWorldInteractions.cs | 20 ++++
Src/Interaction/IWorldInteractions.cs.meta | 11 ++
Src/Inventory.meta | 8 ++
Src/Inventory/Com.Project.B.Inventory.asmdef | 18 +++
.../Com.Project.B.Inventory.asmdef.meta | 7 ++
Src/Inventory/IPlayerInventory.cs | 36 ++++++
Src/Inventory/IPlayerInventory.cs.meta | 11 ++
Src/Inventory/IPlayerWeaponInventory.cs | 81 +++++++++++++
Src/Inventory/IPlayerWeaponInventory.cs.meta | 11 ++
Src/Item.meta | 8 ++
Src/Item/IManagedItemService.cs | 22 ++++
Src/Item/IManagedItemService.cs.meta | 11 ++
Src/Item/Net.Project.B.Item.asmdef | 19 +++
Src/Item/Net.Project.B.Item.asmdef.meta | 7 ++
Src/Lobby.meta | 3 +
Src/Lobby/Com.Project.B.Lobby.asmdef | 17 +++
Src/Lobby/Com.Project.B.Lobby.asmdef.meta | 7 ++
Src/Lobby/ILobbyData.cs | 87 ++++++++++++++
Src/Lobby/ILobbyData.cs.meta | 3 +
Src/Lobby/ILobbyServices.cs | 99 ++++++++++++++++
Src/Lobby/ILobbyServices.cs.meta | 3 +
Src/Net.meta | 8 ++
Src/Net/Com.Project.B.Net.asmdef | 16 +++
Src/Net/Com.Project.B.Net.asmdef.meta | 7 ++
Src/Net/IGameNetService.cs | 24 ++++
Src/Net/IGameNetService.cs.meta | 11 ++
Src/Player.meta | 8 ++
Src/Player/Com.Project.B.Player.asmdef | 17 +++
Src/Player/Com.Project.B.Player.asmdef.meta | 7 ++
Src/Player/IPlayerData.cs | 45 ++++++++
Src/Player/IPlayerData.cs.meta | 11 ++
Src/Player/IPlayerService.cs | 30 +++++
Src/Player/IPlayerService.cs.meta | 11 ++
Src/PlayerSettings.meta | 8 ++
.../Com.Project.B.PlayerSettings.asmdef | 17 +++
.../Com.Project.B.PlayerSettings.asmdef.meta | 7 ++
Src/PlayerSettings/IKeyMap.cs | 13 +++
Src/PlayerSettings/IKeyMap.cs.meta | 11 ++
Src/PlayerSettings/IPlayerKeyMap.cs | 93 +++++++++++++++
Src/PlayerSettings/IPlayerKeyMap.cs.meta | 11 ++
Src/PlayerSettings/IPlayerSettings.cs | 34 ++++++
Src/PlayerSettings/IPlayerSettings.cs.meta | 11 ++
Src/PlayerSettings/IUXKeyMap.cs | 12 ++
Src/PlayerSettings/IUXKeyMap.cs.meta | 11 ++
Src/Quest.meta | 8 ++
Src/Quest/IQuestData.cs | 30 +++++
Src/Quest/IQuestData.cs.meta | 11 ++
Src/Quest/IQuestService.cs | 45 ++++++++
Src/Quest/IQuestService.cs.meta | 11 ++
Src/Quest/Net.Project.B.Quest.asmdef | 16 +++
Src/Quest/Net.Project.B.Quest.asmdef.meta | 7 ++
Src/Skin.meta | 8 ++
Src/Skin/Com.Project.B.Skin.asmdef | 17 +++
Src/Skin/Com.Project.B.Skin.asmdef.meta | 7 ++
Src/Skin/IPlayerSkinData.cs | 30 +++++
Src/Skin/IPlayerSkinData.cs.meta | 11 ++
Src/Skin/IPlayerSkinService.cs | 32 +++++
Src/Skin/IPlayerSkinService.cs.meta | 11 ++
Src/WorldNode.meta | 8 ++
Src/WorldNode/Net.Project.B.WorldNode.asmdef | 18 +++
.../Net.Project.B.WorldNode.asmdef.meta | 7 ++
Src/WorldNode/UnityDoorNode.cs | 32 +++++
Src/WorldNode/UnityDoorNode.cs.meta | 11 ++
Src/WorldNode/UnityItemNode.cs | 22 ++++
Src/WorldNode/UnityItemNode.cs.meta | 11 ++
Src/package.json | 10 ++
Src/package.json.meta | 7 ++
133 files changed, 2574 insertions(+)
create mode 100644 .gitignore
create mode 100644 Com.Project.B.csproj
create mode 100644 Src/Authorize.meta
create mode 100644 Src/Authorize/Com.Project.B.Authorize.asmdef
create mode 100644 Src/Authorize/Com.Project.B.Authorize.asmdef.meta
create mode 100644 Src/Authorize/IAuthorizeData.cs
create mode 100644 Src/Authorize/IAuthorizeData.cs.meta
create mode 100644 Src/Authorize/IAuthorizeService.cs
create mode 100644 Src/Authorize/IAuthorizeService.cs.meta
create mode 100644 Src/CharacterAnimation.meta
create mode 100644 Src/CharacterAnimation/Com.Project.B.CharacterAnimation.asmdef
create mode 100644 Src/CharacterAnimation/Com.Project.B.CharacterAnimation.asmdef.meta
create mode 100644 Src/CharacterAnimation/IAnimationFactory.cs
create mode 100644 Src/CharacterAnimation/IAnimationFactory.cs.meta
create mode 100644 Src/CharacterAnimation/IHumanoidAnimationFactory.cs
create mode 100644 Src/CharacterAnimation/IHumanoidAnimationFactory.cs.meta
create mode 100644 Src/CharacterAnimation/IPlayerAnimationFactory.cs
create mode 100644 Src/CharacterAnimation/IPlayerAnimationFactory.cs.meta
create mode 100644 Src/CharacterController.meta
create mode 100644 Src/CharacterController/Com.Project.B.CharacterController.asmdef
create mode 100644 Src/CharacterController/Com.Project.B.CharacterController.asmdef.meta
create mode 100644 Src/CharacterController/IBotCharacterController.cs
create mode 100644 Src/CharacterController/IBotCharacterController.cs.meta
create mode 100644 Src/CharacterController/ICharacterController.cs
create mode 100644 Src/CharacterController/ICharacterController.cs.meta
create mode 100644 Src/CharacterController/ICharacterService.cs
create mode 100644 Src/CharacterController/ICharacterService.cs.meta
create mode 100644 Src/CharacterController/ICharacterState.cs
create mode 100644 Src/CharacterController/ICharacterState.cs.meta
create mode 100644 Src/CharacterController/IPlayerCharacterController.cs
create mode 100644 Src/CharacterController/IPlayerCharacterController.cs.meta
create mode 100644 Src/Dialogue.meta
create mode 100644 Src/Dialogue/IDialogueData.cs
create mode 100644 Src/Dialogue/IDialogueData.cs.meta
create mode 100644 Src/Dialogue/IDialogueService.cs
create mode 100644 Src/Dialogue/IDialogueService.cs.meta
create mode 100644 Src/Dialogue/Net.Project.B.Dialogue.asmdef
create mode 100644 Src/Dialogue/Net.Project.B.Dialogue.asmdef.meta
create mode 100644 Src/Entities.meta
create mode 100644 Src/Entities/Com.Project.B.Entities.asmdef
create mode 100644 Src/Entities/Com.Project.B.Entities.asmdef.meta
create mode 100644 Src/Entities/IEntitiesFactory.cs
create mode 100644 Src/Entities/IEntitiesFactory.cs.meta
create mode 100644 Src/Entities/IGameEntitiesService.cs
create mode 100644 Src/Entities/IGameEntitiesService.cs.meta
create mode 100644 Src/Entities/INpcFactory.cs
create mode 100644 Src/Entities/INpcFactory.cs.meta
create mode 100644 Src/Entities/IPlayerFactory.cs
create mode 100644 Src/Entities/IPlayerFactory.cs.meta
create mode 100644 Src/GameService.meta
create mode 100644 Src/GameService/Com.Project.B.GameService.asmdef
create mode 100644 Src/GameService/Com.Project.B.GameService.asmdef.meta
create mode 100644 Src/GameService/IGameMapService.cs
create mode 100644 Src/GameService/IGameMapService.cs.meta
create mode 100644 Src/Health.meta
create mode 100644 Src/Health/HealthService.cs
create mode 100644 Src/Health/HealthService.cs.meta
create mode 100644 Src/Health/KnockedService.cs
create mode 100644 Src/Health/KnockedService.cs.meta
create mode 100644 Src/Health/Net.Project.B.Health.asmdef
create mode 100644 Src/Health/Net.Project.B.Health.asmdef.meta
create mode 100644 Src/Interaction.meta
create mode 100644 Src/Interaction/Com.Project.B.Interaction.asmdef
create mode 100644 Src/Interaction/Com.Project.B.Interaction.asmdef.meta
create mode 100644 Src/Interaction/IWorldInteractionService.cs
create mode 100644 Src/Interaction/IWorldInteractionService.cs.meta
create mode 100644 Src/Interaction/IWorldInteractions.cs
create mode 100644 Src/Interaction/IWorldInteractions.cs.meta
create mode 100644 Src/Inventory.meta
create mode 100644 Src/Inventory/Com.Project.B.Inventory.asmdef
create mode 100644 Src/Inventory/Com.Project.B.Inventory.asmdef.meta
create mode 100644 Src/Inventory/IPlayerInventory.cs
create mode 100644 Src/Inventory/IPlayerInventory.cs.meta
create mode 100644 Src/Inventory/IPlayerWeaponInventory.cs
create mode 100644 Src/Inventory/IPlayerWeaponInventory.cs.meta
create mode 100644 Src/Item.meta
create mode 100644 Src/Item/IManagedItemService.cs
create mode 100644 Src/Item/IManagedItemService.cs.meta
create mode 100644 Src/Item/Net.Project.B.Item.asmdef
create mode 100644 Src/Item/Net.Project.B.Item.asmdef.meta
create mode 100644 Src/Lobby.meta
create mode 100644 Src/Lobby/Com.Project.B.Lobby.asmdef
create mode 100644 Src/Lobby/Com.Project.B.Lobby.asmdef.meta
create mode 100644 Src/Lobby/ILobbyData.cs
create mode 100644 Src/Lobby/ILobbyData.cs.meta
create mode 100644 Src/Lobby/ILobbyServices.cs
create mode 100644 Src/Lobby/ILobbyServices.cs.meta
create mode 100644 Src/Net.meta
create mode 100644 Src/Net/Com.Project.B.Net.asmdef
create mode 100644 Src/Net/Com.Project.B.Net.asmdef.meta
create mode 100644 Src/Net/IGameNetService.cs
create mode 100644 Src/Net/IGameNetService.cs.meta
create mode 100644 Src/Player.meta
create mode 100644 Src/Player/Com.Project.B.Player.asmdef
create mode 100644 Src/Player/Com.Project.B.Player.asmdef.meta
create mode 100644 Src/Player/IPlayerData.cs
create mode 100644 Src/Player/IPlayerData.cs.meta
create mode 100644 Src/Player/IPlayerService.cs
create mode 100644 Src/Player/IPlayerService.cs.meta
create mode 100644 Src/PlayerSettings.meta
create mode 100644 Src/PlayerSettings/Com.Project.B.PlayerSettings.asmdef
create mode 100644 Src/PlayerSettings/Com.Project.B.PlayerSettings.asmdef.meta
create mode 100644 Src/PlayerSettings/IKeyMap.cs
create mode 100644 Src/PlayerSettings/IKeyMap.cs.meta
create mode 100644 Src/PlayerSettings/IPlayerKeyMap.cs
create mode 100644 Src/PlayerSettings/IPlayerKeyMap.cs.meta
create mode 100644 Src/PlayerSettings/IPlayerSettings.cs
create mode 100644 Src/PlayerSettings/IPlayerSettings.cs.meta
create mode 100644 Src/PlayerSettings/IUXKeyMap.cs
create mode 100644 Src/PlayerSettings/IUXKeyMap.cs.meta
create mode 100644 Src/Quest.meta
create mode 100644 Src/Quest/IQuestData.cs
create mode 100644 Src/Quest/IQuestData.cs.meta
create mode 100644 Src/Quest/IQuestService.cs
create mode 100644 Src/Quest/IQuestService.cs.meta
create mode 100644 Src/Quest/Net.Project.B.Quest.asmdef
create mode 100644 Src/Quest/Net.Project.B.Quest.asmdef.meta
create mode 100644 Src/Skin.meta
create mode 100644 Src/Skin/Com.Project.B.Skin.asmdef
create mode 100644 Src/Skin/Com.Project.B.Skin.asmdef.meta
create mode 100644 Src/Skin/IPlayerSkinData.cs
create mode 100644 Src/Skin/IPlayerSkinData.cs.meta
create mode 100644 Src/Skin/IPlayerSkinService.cs
create mode 100644 Src/Skin/IPlayerSkinService.cs.meta
create mode 100644 Src/WorldNode.meta
create mode 100644 Src/WorldNode/Net.Project.B.WorldNode.asmdef
create mode 100644 Src/WorldNode/Net.Project.B.WorldNode.asmdef.meta
create mode 100644 Src/WorldNode/UnityDoorNode.cs
create mode 100644 Src/WorldNode/UnityDoorNode.cs.meta
create mode 100644 Src/WorldNode/UnityItemNode.cs
create mode 100644 Src/WorldNode/UnityItemNode.cs.meta
create mode 100644 Src/package.json
create mode 100644 Src/package.json.meta
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..9f64af3
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,10 @@
+# custom
+.idea
+.plastic
+.vscode
+/Assets/StreamingAssets/yoo
+yoo/
+Bundles/
+Profiler/
+/bin
+/obj
diff --git a/Com.Project.B.csproj b/Com.Project.B.csproj
new file mode 100644
index 0000000..3be19b6
--- /dev/null
+++ b/Com.Project.B.csproj
@@ -0,0 +1,23 @@
+
+
+
+ net8.0
+ enable
+ enable
+
+
+
+
+
+
+
+
+
+
+
+
+ ..\BITKit\DLL\Unity.Mathematics.dll
+
+
+
+
diff --git a/Src/Authorize.meta b/Src/Authorize.meta
new file mode 100644
index 0000000..a225b29
--- /dev/null
+++ b/Src/Authorize.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 5df31814c76fd5f429ae3f4c7b60aeaf
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/Authorize/Com.Project.B.Authorize.asmdef b/Src/Authorize/Com.Project.B.Authorize.asmdef
new file mode 100644
index 0000000..f53a991
--- /dev/null
+++ b/Src/Authorize/Com.Project.B.Authorize.asmdef
@@ -0,0 +1,17 @@
+{
+ "name": "Com.Project.B.Authorize",
+ "rootNamespace": "",
+ "references": [
+ "GUID:14fe60d984bf9f84eac55c6ea033a8f4",
+ "GUID:f51ebe6a0ceec4240a699833d6309b23"
+ ],
+ "includePlatforms": [],
+ "excludePlatforms": [],
+ "allowUnsafeCode": false,
+ "overrideReferences": false,
+ "precompiledReferences": [],
+ "autoReferenced": true,
+ "defineConstraints": [],
+ "versionDefines": [],
+ "noEngineReferences": true
+}
\ No newline at end of file
diff --git a/Src/Authorize/Com.Project.B.Authorize.asmdef.meta b/Src/Authorize/Com.Project.B.Authorize.asmdef.meta
new file mode 100644
index 0000000..129c247
--- /dev/null
+++ b/Src/Authorize/Com.Project.B.Authorize.asmdef.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 213fef69b5745f547bdcc386328dc311
+AssemblyDefinitionImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/Authorize/IAuthorizeData.cs b/Src/Authorize/IAuthorizeData.cs
new file mode 100644
index 0000000..80790dc
--- /dev/null
+++ b/Src/Authorize/IAuthorizeData.cs
@@ -0,0 +1,35 @@
+using System;
+
+namespace Com.Project.B.Authorize
+{
+ ///
+ /// 授权数据
+ ///
+ public interface IAuthorizeData
+ {
+ ///
+ /// 链接ID,仅用于网络通讯
+ ///
+ int ConnectionId { get; set; }
+ ///
+ /// 玩家ID
+ ///
+ Guid PlayerId { get; }
+ ///
+ /// 授权令牌
+ ///
+ string Token { get; }
+ ///
+ /// 上次更新时间
+ ///
+ DateTime LastUpdateTime { get; }
+ }
+
+ public struct AuthorizeData:IAuthorizeData
+ {
+ public int ConnectionId { get; set; }
+ public Guid PlayerId { get; set; }
+ public string Token { get; set; }
+ public DateTime LastUpdateTime { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Src/Authorize/IAuthorizeData.cs.meta b/Src/Authorize/IAuthorizeData.cs.meta
new file mode 100644
index 0000000..d610ffc
--- /dev/null
+++ b/Src/Authorize/IAuthorizeData.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 64fdf8c4f6b4457c87647acd79359508
+timeCreated: 1724414639
\ No newline at end of file
diff --git a/Src/Authorize/IAuthorizeService.cs b/Src/Authorize/IAuthorizeService.cs
new file mode 100644
index 0000000..a916a22
--- /dev/null
+++ b/Src/Authorize/IAuthorizeService.cs
@@ -0,0 +1,43 @@
+using System;
+using Com.Project.B.Authorize;
+using Cysharp.Threading.Tasks;
+
+namespace Project.B.Authorize
+{
+ ///
+ /// 授权服务
+ ///
+ public interface IAuthorizeService
+ {
+ ///
+ /// 尝试获取授权数据
+ ///
+ ///
+ ///
+ ///
+ bool TryGetAuthorizeData(Guid playerId, out IAuthorizeData data);
+ UniTask GetAllAuthorizeDataAsync();
+ ///
+ /// 授权和登录
+ ///
+ ///
+ ///
+ UniTask AuthorizeAsync(IAuthorizeData data);
+ ///
+ /// 保持心跳,超时则断开链接
+ ///
+ ///
+ ///
+ ///
+ UniTask HeartbeatAsync(Guid playerId,int connectionId);
+ ///
+ /// 授权成功回调
+ ///
+ event Action OnAuthorized;
+ ///
+ /// 授权超时回调
+ ///
+ event Action OnAuthorizeTimeout;
+ }
+}
+
diff --git a/Src/Authorize/IAuthorizeService.cs.meta b/Src/Authorize/IAuthorizeService.cs.meta
new file mode 100644
index 0000000..d732c6c
--- /dev/null
+++ b/Src/Authorize/IAuthorizeService.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d55accd2aeb80c940a0b80fcd1e4c634
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/CharacterAnimation.meta b/Src/CharacterAnimation.meta
new file mode 100644
index 0000000..7e661b1
--- /dev/null
+++ b/Src/CharacterAnimation.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: af56161a7c158cb4f97da44de0d64528
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/CharacterAnimation/Com.Project.B.CharacterAnimation.asmdef b/Src/CharacterAnimation/Com.Project.B.CharacterAnimation.asmdef
new file mode 100644
index 0000000..35fad59
--- /dev/null
+++ b/Src/CharacterAnimation/Com.Project.B.CharacterAnimation.asmdef
@@ -0,0 +1,19 @@
+{
+ "name": "Com.Project.B.CharacterAnimation",
+ "rootNamespace": "",
+ "references": [
+ "GUID:14fe60d984bf9f84eac55c6ea033a8f4",
+ "GUID:ecc5a2501a2c44d4cb8366674714f3d9",
+ "GUID:f51ebe6a0ceec4240a699833d6309b23",
+ "GUID:d8b63aba1907145bea998dd612889d6b"
+ ],
+ "includePlatforms": [],
+ "excludePlatforms": [],
+ "allowUnsafeCode": false,
+ "overrideReferences": false,
+ "precompiledReferences": [],
+ "autoReferenced": true,
+ "defineConstraints": [],
+ "versionDefines": [],
+ "noEngineReferences": false
+}
\ No newline at end of file
diff --git a/Src/CharacterAnimation/Com.Project.B.CharacterAnimation.asmdef.meta b/Src/CharacterAnimation/Com.Project.B.CharacterAnimation.asmdef.meta
new file mode 100644
index 0000000..6357f91
--- /dev/null
+++ b/Src/CharacterAnimation/Com.Project.B.CharacterAnimation.asmdef.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 6bf9bfd639affa44788ad1d79942746b
+AssemblyDefinitionImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/CharacterAnimation/IAnimationFactory.cs b/Src/CharacterAnimation/IAnimationFactory.cs
new file mode 100644
index 0000000..ca0da1d
--- /dev/null
+++ b/Src/CharacterAnimation/IAnimationFactory.cs
@@ -0,0 +1,12 @@
+using System.Collections;
+using System.Collections.Generic;
+using Cysharp.Threading.Tasks;
+
+namespace Project.B.Animation
+{
+ public interface IAnimationFactory
+ {
+ public UniTask InitializeAsync();
+ }
+
+}
diff --git a/Src/CharacterAnimation/IAnimationFactory.cs.meta b/Src/CharacterAnimation/IAnimationFactory.cs.meta
new file mode 100644
index 0000000..1cd2a00
--- /dev/null
+++ b/Src/CharacterAnimation/IAnimationFactory.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 93300d0073822a34184faa323300fcfd
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/CharacterAnimation/IHumanoidAnimationFactory.cs b/Src/CharacterAnimation/IHumanoidAnimationFactory.cs
new file mode 100644
index 0000000..24c957a
--- /dev/null
+++ b/Src/CharacterAnimation/IHumanoidAnimationFactory.cs
@@ -0,0 +1,21 @@
+using System.Collections;
+using System.Collections.Generic;
+using BITKit;
+using Unity.Mathematics;
+
+namespace Project.B.Animation
+{
+ public interface IHumanoidAnimationFactory: IAnimationFactory
+ {
+ IWrapper CreateIdleAnimation();
+ IWrapper CreateWalkAnimation();
+ IWrapper CreateCrouchedAnimation();
+ IWrapper CreateInAirAnimation();
+ IWrapper CreateRunAnimation();
+ IWrapper CreateSprintAnimation();
+ IWrapper CreateKnockedAnimation();
+ object CreateKnockingAnimation();
+ object CreateDeathAnimation();
+
+ }
+}
diff --git a/Src/CharacterAnimation/IHumanoidAnimationFactory.cs.meta b/Src/CharacterAnimation/IHumanoidAnimationFactory.cs.meta
new file mode 100644
index 0000000..d79c9ca
--- /dev/null
+++ b/Src/CharacterAnimation/IHumanoidAnimationFactory.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 85e6ac8c46e30404cbd8d8cffc15f319
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/CharacterAnimation/IPlayerAnimationFactory.cs b/Src/CharacterAnimation/IPlayerAnimationFactory.cs
new file mode 100644
index 0000000..63b99da
--- /dev/null
+++ b/Src/CharacterAnimation/IPlayerAnimationFactory.cs
@@ -0,0 +1,12 @@
+using System.Collections;
+using System.Collections.Generic;
+using BITKit;
+using Unity.Mathematics;
+
+namespace Project.B.Animation
+{
+ public interface IPlayerAnimationFactory : IHumanoidAnimationFactory
+ {
+ public object CreateStepUpAnimation();
+ }
+}
diff --git a/Src/CharacterAnimation/IPlayerAnimationFactory.cs.meta b/Src/CharacterAnimation/IPlayerAnimationFactory.cs.meta
new file mode 100644
index 0000000..f9757d8
--- /dev/null
+++ b/Src/CharacterAnimation/IPlayerAnimationFactory.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: f0cf21fa72c864844acd31f144d12f86
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/CharacterController.meta b/Src/CharacterController.meta
new file mode 100644
index 0000000..a2b0dce
--- /dev/null
+++ b/Src/CharacterController.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 0b88cd3c8eae9724caabbf566ba0e879
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/CharacterController/Com.Project.B.CharacterController.asmdef b/Src/CharacterController/Com.Project.B.CharacterController.asmdef
new file mode 100644
index 0000000..55f4100
--- /dev/null
+++ b/Src/CharacterController/Com.Project.B.CharacterController.asmdef
@@ -0,0 +1,17 @@
+{
+ "name": "Com.Project.B.CharacterController",
+ "rootNamespace": "",
+ "references": [
+ "GUID:14fe60d984bf9f84eac55c6ea033a8f4",
+ "GUID:d8b63aba1907145bea998dd612889d6b"
+ ],
+ "includePlatforms": [],
+ "excludePlatforms": [],
+ "allowUnsafeCode": false,
+ "overrideReferences": false,
+ "precompiledReferences": [],
+ "autoReferenced": true,
+ "defineConstraints": [],
+ "versionDefines": [],
+ "noEngineReferences": true
+}
\ No newline at end of file
diff --git a/Src/CharacterController/Com.Project.B.CharacterController.asmdef.meta b/Src/CharacterController/Com.Project.B.CharacterController.asmdef.meta
new file mode 100644
index 0000000..5c2b005
--- /dev/null
+++ b/Src/CharacterController/Com.Project.B.CharacterController.asmdef.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: ecc5a2501a2c44d4cb8366674714f3d9
+AssemblyDefinitionImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/CharacterController/IBotCharacterController.cs b/Src/CharacterController/IBotCharacterController.cs
new file mode 100644
index 0000000..80fce9c
--- /dev/null
+++ b/Src/CharacterController/IBotCharacterController.cs
@@ -0,0 +1,8 @@
+namespace Project.B.CharacterController
+{
+ public interface IBotCharacterController
+ {
+ ICharacterController CharacterController { get; }
+ }
+}
+
diff --git a/Src/CharacterController/IBotCharacterController.cs.meta b/Src/CharacterController/IBotCharacterController.cs.meta
new file mode 100644
index 0000000..206253c
--- /dev/null
+++ b/Src/CharacterController/IBotCharacterController.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9ed442d9b01567644b3ba71d2290f15d
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/CharacterController/ICharacterController.cs b/Src/CharacterController/ICharacterController.cs
new file mode 100644
index 0000000..dfb19a7
--- /dev/null
+++ b/Src/CharacterController/ICharacterController.cs
@@ -0,0 +1,19 @@
+using BITKit.StateMachine;
+using Unity.Mathematics;
+
+namespace Project.B.CharacterController
+{
+
+ ///
+ /// 角色控制器
+ ///
+ public interface ICharacterController:IStateMachine
+ {
+ float3 Center { get; }
+ float3 Position { get; set; }
+ float3 Velocity { get; set; }
+ float3 AngularVelocity { get; }
+ quaternion Rotation { get; set; }
+ float3 SelfVelocity { get; set; }
+ }
+}
diff --git a/Src/CharacterController/ICharacterController.cs.meta b/Src/CharacterController/ICharacterController.cs.meta
new file mode 100644
index 0000000..df08477
--- /dev/null
+++ b/Src/CharacterController/ICharacterController.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ea09f811bb3610f448df064bf4af3c3b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/CharacterController/ICharacterService.cs b/Src/CharacterController/ICharacterService.cs
new file mode 100644
index 0000000..27c0655
--- /dev/null
+++ b/Src/CharacterController/ICharacterService.cs
@@ -0,0 +1,12 @@
+using System.Collections.Generic;
+
+namespace Project.B.CharacterController
+{
+ ///
+ /// 角色服务
+ ///
+ public interface ICharacterService
+ {
+ IDictionary Dictionary { get; }
+ }
+}
diff --git a/Src/CharacterController/ICharacterService.cs.meta b/Src/CharacterController/ICharacterService.cs.meta
new file mode 100644
index 0000000..72243d9
--- /dev/null
+++ b/Src/CharacterController/ICharacterService.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8623eebfb2e93db44b3c1f3356660112
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/CharacterController/ICharacterState.cs b/Src/CharacterController/ICharacterState.cs
new file mode 100644
index 0000000..67e41c2
--- /dev/null
+++ b/Src/CharacterController/ICharacterState.cs
@@ -0,0 +1,73 @@
+using BITKit.StateMachine;
+using Unity.Mathematics;
+
+namespace Project.B.CharacterController
+{
+ ///
+ /// 角色状态
+ ///
+ public interface ICharacterState : IState
+ {
+ public void UpdateVelocity(ref float3 currentVelocity, float deltaTime);
+
+ public void UpdateRotation(ref float3 localPosition, ref quaternion currentRotation,
+ ref quaternion viewRotation, float deltaTime);
+
+ public void BeforeUpdateVelocity(float deltaTime);
+
+ public void AfterUpdateVelocity(float deltaTime);
+ }
+ ///
+ /// 角色状态数据
+ ///
+ public interface ICharacterStateData
+ {
+ public float BaseHeight { get; }
+ public float BaseSpeed { get; }
+ public float2 ViewOffset { get; }
+ }
+ ///
+ /// 空状态
+ ///
+ public interface ICharacterStateEmpty:ICharacterState{}
+ ///
+ /// 静止
+ ///
+ public interface ICharacterStateIdle:ICharacterState{}
+ ///
+ /// 行走
+ ///
+ public interface ICharacterStateWalk:ICharacterState{}
+ ///
+ /// 蹲下
+ ///
+ public interface ICharacterStateCrouched:ICharacterState{}
+ ///
+ /// 奔跑
+ ///
+ public interface ICharacterStateRun:ICharacterState{}
+ ///
+ /// 战术跑
+ ///
+ public interface ICharacterSprint:ICharacterState{}
+ ///
+ /// 在空中,包括跳跃、下落、飞行等
+ ///
+ public interface ICharacterStateInAir:ICharacterState{}
+ ///
+ /// 爬上低障碍物
+ ///
+ public interface ICharacterStateStepUp:ICharacterState{}
+ ///
+ /// 翻阅障碍物
+ ///
+ public interface ICharacterStateVault:ICharacterState{}
+ ///
+ /// 攀爬
+ ///
+ public interface ICharacterStateClimb:ICharacterState{}
+ ///
+ /// 被击倒
+ ///
+ public interface ICharacterKnocked:ICharacterState{}
+}
\ No newline at end of file
diff --git a/Src/CharacterController/ICharacterState.cs.meta b/Src/CharacterController/ICharacterState.cs.meta
new file mode 100644
index 0000000..68fb378
--- /dev/null
+++ b/Src/CharacterController/ICharacterState.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1a1d7bf82adaa85429d4edf3663803b4
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/CharacterController/IPlayerCharacterController.cs b/Src/CharacterController/IPlayerCharacterController.cs
new file mode 100644
index 0000000..2d21740
--- /dev/null
+++ b/Src/CharacterController/IPlayerCharacterController.cs
@@ -0,0 +1,20 @@
+using System.Collections.Generic;
+using System.Diagnostics.Contracts;
+using BITKit;
+using Unity.Mathematics;
+
+namespace Project.B.CharacterController
+{
+ public interface IPlayerCharacterController
+ {
+ ICharacterController CharacterController { get; }
+ IDictionary AdditiveCameraQuaternion { get; }
+ IDictionary ZoomFactor { get; }
+ ValidHandle AllowTpsCamera { get; }
+ ValidHandle AllowRun { get; }
+ ValidHandle AllowSprint { get; }
+ void CancelRun();
+ void CancelSprint();
+ }
+}
+
diff --git a/Src/CharacterController/IPlayerCharacterController.cs.meta b/Src/CharacterController/IPlayerCharacterController.cs.meta
new file mode 100644
index 0000000..001ed4d
--- /dev/null
+++ b/Src/CharacterController/IPlayerCharacterController.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1653b18508ad4d749bcea633bff67802
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/Dialogue.meta b/Src/Dialogue.meta
new file mode 100644
index 0000000..1fc748e
--- /dev/null
+++ b/Src/Dialogue.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: ee183f11afcda5644bd64299bd2f47f8
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/Dialogue/IDialogueData.cs b/Src/Dialogue/IDialogueData.cs
new file mode 100644
index 0000000..198df2e
--- /dev/null
+++ b/Src/Dialogue/IDialogueData.cs
@@ -0,0 +1,79 @@
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.CompilerServices;
+
+namespace Net.Project.B.Dialogue
+{
+ ///
+ /// 对话数据
+ ///
+ public interface IDialogueData
+ {
+ ///
+ /// 唯一对话ID
+ ///
+ public int Identity { get; set; }
+ ///
+ /// 通道ID,用于区分不同的对话
+ ///
+ public int Channel { get; }
+ ///
+ /// 演员ID,谁是说话的人
+ ///
+ public int ActorIdentity { get; }
+ ///
+ /// 文本
+ ///
+ public string Text { get; }
+ ///
+ /// 语音路径
+ ///
+ public string VoicePath { get; }
+ ///
+ /// 等待对话完成
+ ///
+ ///
+ TaskAwaiter GetAwaiter();
+ }
+ ///
+ /// 对话选择
+ ///
+ public interface IDialogueChoice
+ {
+ ///
+ /// 索引
+ ///
+ public int Index { get; }
+ ///
+ /// 文本
+ ///
+ public string Text { get; }
+ ///
+ /// 是否可选
+ ///
+ public bool Enabled { get; }
+ ///
+ /// 备注,例如:选择这个选项会触发什么事件,不可选的原因等
+ ///
+ public string Remark { get; }
+ }
+ public struct DialogueData:IDialogueData
+ {
+ public int Identity { get; set; }
+ public int Channel { get; set; }
+ public int ActorIdentity { get; set; }
+ public string Text { get; set; }
+ public string VoicePath { get; set; }
+ public TaskAwaiter GetAwaiter()
+ {
+ throw new System.NotImplementedException();
+ }
+ }
+ public struct DialogueChoice:IDialogueChoice
+ {
+ public int Index { get; set; }
+ public string Text { get; set; }
+ public bool Enabled { get; set; }
+ public string Remark { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Src/Dialogue/IDialogueData.cs.meta b/Src/Dialogue/IDialogueData.cs.meta
new file mode 100644
index 0000000..95b904d
--- /dev/null
+++ b/Src/Dialogue/IDialogueData.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ebb9eb40cce574a44b3419bd4d58411f
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/Dialogue/IDialogueService.cs b/Src/Dialogue/IDialogueService.cs
new file mode 100644
index 0000000..ee48ff0
--- /dev/null
+++ b/Src/Dialogue/IDialogueService.cs
@@ -0,0 +1,91 @@
+using System;
+using System.Collections;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Linq;
+using BITKit;
+using Cysharp.Threading.Tasks;
+
+namespace Net.Project.B.Dialogue
+{
+ ///
+ /// 对话服务
+ ///
+ public interface IDialogueService
+ {
+ ///
+ /// 所有对话
+ ///
+ IReadOnlyDictionary Dialogues { get; }
+
+ ///
+ /// 对话开始
+ ///
+ public event Func OnDialogueStart;
+
+ ///
+ /// 对话结束
+ ///
+ public event Action OnDialogueEnd;
+
+ ///
+ /// 对话选择
+ ///
+ public event Func, UniTask> OnDialogueChoose;
+
+ ///
+ /// 对话选择回调
+ ///
+ public event Action OnDialogueChose;
+
+ ///
+ /// 开启对话
+ ///
+ /// 对话
+ ///
+ UniTask CreateDialogue(IDialogueData dialogueData);
+
+ UniTask CreateDialogue(IDialogueData dialogueData, IReadOnlyCollection dialogueChoices);
+ }
+
+ public class DialogueService : IDialogueService
+ {
+ public IReadOnlyDictionary Dialogues => _dialogues;
+
+ public event Func OnDialogueStart;
+ public event Action OnDialogueEnd;
+ public event Func, UniTask> OnDialogueChoose;
+ public event Action OnDialogueChose;
+
+ public async UniTask CreateDialogue(IDialogueData dialogueData)
+ {
+ if (_dialogues.TryAdd(dialogueData.Identity, dialogueData) is false)
+ {
+ dialogueData.Identity = _dialogues.Keys.Max() + 1;
+ _dialogues.TryAdd(dialogueData.Identity, dialogueData);
+ }
+
+ await OnDialogueStart.UniTaskFunc(dialogueData);
+
+ OnDialogueEnd?.Invoke(dialogueData);
+ }
+
+ public async UniTask CreateDialogue(IDialogueData dialogueData,
+ IReadOnlyCollection dialogueChoices)
+ {
+ if (OnDialogueChoose is null)
+ {
+ throw new NullReferenceException("OnDialogueChoose is null,unable to create dialogue");
+ }
+
+ var task = OnDialogueChoose.Invoke(dialogueData, dialogueChoices);
+ var index = await task;
+
+ OnDialogueChose?.Invoke(dialogueData, dialogueChoices.ElementAt(index));
+
+ return index;
+ }
+
+ private readonly ConcurrentDictionary _dialogues = new();
+ }
+}
\ No newline at end of file
diff --git a/Src/Dialogue/IDialogueService.cs.meta b/Src/Dialogue/IDialogueService.cs.meta
new file mode 100644
index 0000000..62210a7
--- /dev/null
+++ b/Src/Dialogue/IDialogueService.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4b6700c7171a00048b0d5907bd7c0133
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/Dialogue/Net.Project.B.Dialogue.asmdef b/Src/Dialogue/Net.Project.B.Dialogue.asmdef
new file mode 100644
index 0000000..a7e5bd0
--- /dev/null
+++ b/Src/Dialogue/Net.Project.B.Dialogue.asmdef
@@ -0,0 +1,17 @@
+{
+ "name": "Net.Project.B.Dialogue",
+ "rootNamespace": "",
+ "references": [
+ "GUID:14fe60d984bf9f84eac55c6ea033a8f4",
+ "GUID:f51ebe6a0ceec4240a699833d6309b23"
+ ],
+ "includePlatforms": [],
+ "excludePlatforms": [],
+ "allowUnsafeCode": false,
+ "overrideReferences": false,
+ "precompiledReferences": [],
+ "autoReferenced": true,
+ "defineConstraints": [],
+ "versionDefines": [],
+ "noEngineReferences": true
+}
\ No newline at end of file
diff --git a/Src/Dialogue/Net.Project.B.Dialogue.asmdef.meta b/Src/Dialogue/Net.Project.B.Dialogue.asmdef.meta
new file mode 100644
index 0000000..168bd75
--- /dev/null
+++ b/Src/Dialogue/Net.Project.B.Dialogue.asmdef.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: ba8323a5a01afc24188ded7f4b05db8a
+AssemblyDefinitionImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/Entities.meta b/Src/Entities.meta
new file mode 100644
index 0000000..2151127
--- /dev/null
+++ b/Src/Entities.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 035b607824c8f7444a065771731609f5
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/Entities/Com.Project.B.Entities.asmdef b/Src/Entities/Com.Project.B.Entities.asmdef
new file mode 100644
index 0000000..8463d0f
--- /dev/null
+++ b/Src/Entities/Com.Project.B.Entities.asmdef
@@ -0,0 +1,17 @@
+{
+ "name": "Com.Project.B.Entities",
+ "rootNamespace": "",
+ "references": [
+ "GUID:14fe60d984bf9f84eac55c6ea033a8f4",
+ "GUID:f51ebe6a0ceec4240a699833d6309b23"
+ ],
+ "includePlatforms": [],
+ "excludePlatforms": [],
+ "allowUnsafeCode": false,
+ "overrideReferences": false,
+ "precompiledReferences": [],
+ "autoReferenced": true,
+ "defineConstraints": [],
+ "versionDefines": [],
+ "noEngineReferences": false
+}
\ No newline at end of file
diff --git a/Src/Entities/Com.Project.B.Entities.asmdef.meta b/Src/Entities/Com.Project.B.Entities.asmdef.meta
new file mode 100644
index 0000000..be18b29
--- /dev/null
+++ b/Src/Entities/Com.Project.B.Entities.asmdef.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: c469c0b0902774247810f42d61a18bd7
+AssemblyDefinitionImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/Entities/IEntitiesFactory.cs b/Src/Entities/IEntitiesFactory.cs
new file mode 100644
index 0000000..f78b014
--- /dev/null
+++ b/Src/Entities/IEntitiesFactory.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using BITKit.Entities;
+using Cysharp.Threading.Tasks;
+
+namespace Project.B.Entities
+{
+ ///
+ /// 实体工厂
+ ///
+ public interface IEntitiesFactory:IDisposable
+ {
+ IReadOnlyDictionary Entities { get; }
+ UniTask CreateAsync(string addressablePath);
+ public event Func OnEntityCreate;
+ public event Func OnEntityCreated;
+ }
+}
diff --git a/Src/Entities/IEntitiesFactory.cs.meta b/Src/Entities/IEntitiesFactory.cs.meta
new file mode 100644
index 0000000..ef36b55
--- /dev/null
+++ b/Src/Entities/IEntitiesFactory.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a04dc5a4e09c045449fae446e3ce4f4c
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/Entities/IGameEntitiesService.cs b/Src/Entities/IGameEntitiesService.cs
new file mode 100644
index 0000000..0d9638c
--- /dev/null
+++ b/Src/Entities/IGameEntitiesService.cs
@@ -0,0 +1,11 @@
+namespace Project.B.Entities
+{
+ ///
+ /// 游戏实体服务,通常是场景中的角色,怪物,道具等
+ ///
+ public interface IInGameEntitiesService
+ {
+
+ }
+
+}
diff --git a/Src/Entities/IGameEntitiesService.cs.meta b/Src/Entities/IGameEntitiesService.cs.meta
new file mode 100644
index 0000000..bb68606
--- /dev/null
+++ b/Src/Entities/IGameEntitiesService.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 37fcf1ccb8b19e049a5e20b3ceaf53de
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/Entities/INpcFactory.cs b/Src/Entities/INpcFactory.cs
new file mode 100644
index 0000000..16c1d3e
--- /dev/null
+++ b/Src/Entities/INpcFactory.cs
@@ -0,0 +1,7 @@
+namespace Project.B.Entities
+{
+ public interface INpcFactory:IEntitiesFactory
+ {
+
+ }
+}
diff --git a/Src/Entities/INpcFactory.cs.meta b/Src/Entities/INpcFactory.cs.meta
new file mode 100644
index 0000000..6010197
--- /dev/null
+++ b/Src/Entities/INpcFactory.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 15be9f6a652c2fa4da9f3a5432cea177
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/Entities/IPlayerFactory.cs b/Src/Entities/IPlayerFactory.cs
new file mode 100644
index 0000000..74b64de
--- /dev/null
+++ b/Src/Entities/IPlayerFactory.cs
@@ -0,0 +1,10 @@
+namespace Project.B.Entities
+{
+ ///
+ /// 玩家工厂
+ ///
+ public interface IPlayerFactory:IEntitiesFactory
+ {
+
+ }
+}
diff --git a/Src/Entities/IPlayerFactory.cs.meta b/Src/Entities/IPlayerFactory.cs.meta
new file mode 100644
index 0000000..b958337
--- /dev/null
+++ b/Src/Entities/IPlayerFactory.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 40f616061eb458a4c9ac203fe981a405
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/GameService.meta b/Src/GameService.meta
new file mode 100644
index 0000000..fab6a91
--- /dev/null
+++ b/Src/GameService.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: e61e9d1af77a0a3459eb82460e214bbd
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/GameService/Com.Project.B.GameService.asmdef b/Src/GameService/Com.Project.B.GameService.asmdef
new file mode 100644
index 0000000..a47b820
--- /dev/null
+++ b/Src/GameService/Com.Project.B.GameService.asmdef
@@ -0,0 +1,18 @@
+{
+ "name": "Com.Project.B.GameService",
+ "rootNamespace": "",
+ "references": [
+ "GUID:14fe60d984bf9f84eac55c6ea033a8f4",
+ "GUID:a4033552c5c40fa408838a1ce2b1b215",
+ "GUID:f51ebe6a0ceec4240a699833d6309b23"
+ ],
+ "includePlatforms": [],
+ "excludePlatforms": [],
+ "allowUnsafeCode": false,
+ "overrideReferences": false,
+ "precompiledReferences": [],
+ "autoReferenced": true,
+ "defineConstraints": [],
+ "versionDefines": [],
+ "noEngineReferences": true
+}
\ No newline at end of file
diff --git a/Src/GameService/Com.Project.B.GameService.asmdef.meta b/Src/GameService/Com.Project.B.GameService.asmdef.meta
new file mode 100644
index 0000000..1ba2160
--- /dev/null
+++ b/Src/GameService/Com.Project.B.GameService.asmdef.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 12c795c5ebfb7b245a0399e28b4015e8
+AssemblyDefinitionImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/GameService/IGameMapService.cs b/Src/GameService/IGameMapService.cs
new file mode 100644
index 0000000..8a7b27c
--- /dev/null
+++ b/Src/GameService/IGameMapService.cs
@@ -0,0 +1,58 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using BITKit;
+using Cysharp.Threading.Tasks;
+
+namespace Project.B.Map
+{
+ ///
+ /// 游戏地图服务
+ ///
+ public interface IGameMapService
+ {
+ ///
+ /// 初始化状态
+ ///
+ InitializationState InitializationState { get; }
+ ///
+ /// 当前已加载或正在加载的地图
+ ///
+ string CurrentMap { get; }
+ ///
+ /// 获取地图
+ ///
+ ///
+ UniTask GetMapAsync();
+ ///
+ /// 进入地图
+ ///
+ ///
+ ///
+ UniTask StartMapAsync(string map);
+ ///
+ /// 停止地图,也是返回菜单的意思
+ ///
+ ///
+ UniTask StopMapAsync();
+ ///
+ /// 当加载状态发生变化时
+ ///
+ event Action OnInitializationStateChanged;
+ ///
+ /// 切换场景前
+ ///
+ event Func OnMapChanging;
+
+ ///
+ /// 切换场景后
+ ///
+ event Action OnMapChanged;
+
+ ///
+ /// 地图加载进度
+ ///
+ event Action OnMapLoadingProgress;
+ }
+
+}
diff --git a/Src/GameService/IGameMapService.cs.meta b/Src/GameService/IGameMapService.cs.meta
new file mode 100644
index 0000000..69edbd1
--- /dev/null
+++ b/Src/GameService/IGameMapService.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3cef42cfdedec0c41b3992402685c70c
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/Health.meta b/Src/Health.meta
new file mode 100644
index 0000000..6def4c4
--- /dev/null
+++ b/Src/Health.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 62c1efeb1f5e26c45b753b1b37c1e3f7
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/Health/HealthService.cs b/Src/Health/HealthService.cs
new file mode 100644
index 0000000..0276bd5
--- /dev/null
+++ b/Src/Health/HealthService.cs
@@ -0,0 +1,89 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using BITKit;
+using Cysharp.Threading.Tasks;
+
+
+namespace Net.Project.B.Health
+{
+ ///
+ /// 生命值服务
+ ///
+ public interface IHealthService
+ {
+ ///
+ /// 已缓存的生命值
+ ///
+ public IReadOnlyDictionary Healths { get; }
+ ///
+ /// 在改变生命值前,ID,当前生命值,新的生命值,来源
+ /// 增加的数值
+ ///
+ public event Func OnHealthPlus;
+ ///
+ /// 在改变生命值后
+ ///
+ /// ///
+ /// 当健康值发生变化时触发的事件。
+ ///
+ public event Action OnHealthChanged;
+ ///
+ /// 调整生命值
+ ///
+ ///
+ /// +- not set
+ ///
+ public UniTask AddHealth(int id,int value,object arg);
+ }
+ public class HealthService:IHealthService
+ {
+ private static HealthService _singleton;
+ public HealthService()
+ {
+ _singleton = this;
+ }
+ [BITCommand]
+ public static void SetHealth(int id, int newHealth)
+ {
+ Healths.GetOrAdd(id,100);
+ Healths.Set(id,newHealth);
+ OnHealthChanged?.Invoke(id,newHealth,newHealth,null);
+ }
+ [BITCommand]
+ public static void AddHealth(int id, int newHealth)
+ {
+ Healths.GetOrAdd(id,100);
+ _singleton.AddHealth(id, newHealth, null).Forget();
+ }
+
+
+ IReadOnlyDictionary IHealthService.Healths => Healths;
+ private static event Func OnHealthChange;
+ private static event Action OnHealthChanged;
+ private static readonly ConcurrentDictionary Healths = new();
+
+ event Func IHealthService.OnHealthPlus
+ {
+ add => OnHealthChange += value;
+ remove => OnHealthChange -= value;
+ }
+ event Action IHealthService.OnHealthChanged
+ {
+ add => OnHealthChanged += value;
+ remove => OnHealthChanged -= value;
+ }
+ public UniTask AddHealth(int id, int value,object arg)
+ {
+ var current = Healths.GetOrAdd(id,100);
+ foreach (var func in OnHealthChange.CastAsFunc())
+ {
+ value =func.Invoke(id,current, value, arg);
+ }
+ var newHp = Math.Clamp(current + value, -1, 100);
+ Healths.Set(id,newHp);
+ OnHealthChanged?.Invoke(id,current,newHp,arg);
+ return UniTask.FromResult(newHp);
+ }
+ }
+}
diff --git a/Src/Health/HealthService.cs.meta b/Src/Health/HealthService.cs.meta
new file mode 100644
index 0000000..42e0da6
--- /dev/null
+++ b/Src/Health/HealthService.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 128dfad42ea28ca458121d3ca6b70ffc
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/Health/KnockedService.cs b/Src/Health/KnockedService.cs
new file mode 100644
index 0000000..4aaa0f5
--- /dev/null
+++ b/Src/Health/KnockedService.cs
@@ -0,0 +1,109 @@
+using System;
+using System.Collections;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using BITKit;
+using Microsoft.Extensions.Logging;
+
+namespace Net.Project.B.Health
+{
+ ///
+ /// 击倒服务
+ ///
+ public interface IKnockedService
+ {
+ ///
+ /// 击倒列表
+ ///
+ public HashSet Knocked { get; }
+ ///
+ /// 击倒生命值
+ ///
+ public IReadOnlyDictionary KnockedHealth { get; }
+ ///
+ /// 击倒回调
+ ///
+ public event Action OnKnocked;
+ ///
+ /// 击倒生命值回调
+ ///
+ public event Action OnKnockedHealthChanged;
+ }
+
+ public class KnockedService : IKnockedService,IDisposable
+ {
+ private readonly IHealthService _healthService;
+ private readonly ILogger _logger;
+
+ public KnockedService(IHealthService healthService, ILogger logger)
+ {
+ _healthService = healthService;
+ _logger = logger;
+ _healthService.OnHealthPlus += OnHealthPlus;
+ _healthService.OnHealthChanged += OnHealthChanged;
+ }
+
+ private int OnHealthPlus(int id, int oldHp, int plus, object sendor)
+ {
+ var isKnocked = _knocked.Contains(id);
+ if (oldHp < 0) return plus;
+ if ((oldHp + plus) > -1) return plus;
+ if (plus > 0) return plus;
+ if (isKnocked)
+ {
+ var currentHealth = _knockedHealth.GetOrAdd(id,100);
+ if (currentHealth + plus > -1)
+ {
+ var nextHealth = currentHealth + plus;
+ _knockedHealth[id] = nextHealth;
+ _onKnockedHealthChanged?.Invoke(id, currentHealth, nextHealth);
+ _logger.LogInformation($"Entity {id} 的击倒生命值减少了,剩余{_knockedHealth[id]}");
+ return 0;
+ }
+ _knockedHealth.Set(id,-1);
+ return plus;
+ }
+ _knockedHealth.TryAdd(id, 100);
+ _knocked.Add(id);
+ _onKnocked?.Invoke(id, true);
+ _logger.LogInformation($"Entity {id} 被击倒了");
+ return 0;
+ }
+
+ private void OnHealthChanged(int arg1, int arg2, int arg3, object arg4)
+ {
+ var isKnocked = _knocked.Contains(arg1);
+ if(isKnocked is false)return;
+ if (arg3 <= arg2) return;
+ _knocked.Remove(arg1);
+ _knockedHealth.TryRemove(arg1,out _);
+ _onKnocked?.Invoke(arg1, false);
+
+ _logger.LogInformation($"Entity {arg1} 自起了");
+ }
+
+ private static readonly HashSet _knocked = new();
+ private static readonly ConcurrentDictionary _knockedHealth = new();
+ private static event Action _onKnocked;
+ private static event Action _onKnockedHealthChanged;
+ public HashSet Knocked=> _knocked;
+ public IReadOnlyDictionary KnockedHealth => _knockedHealth;
+ public event Action OnKnocked
+ {
+ add => _onKnocked += value;
+ remove => _onKnocked -= value;
+ }
+ public event Action OnKnockedHealthChanged
+ {
+ add => _onKnockedHealthChanged += value;
+ remove => _onKnockedHealthChanged -= value;
+ }
+
+ public void Dispose()
+ {
+ _healthService.OnHealthPlus -= OnHealthPlus;
+ _healthService.OnHealthChanged -= OnHealthChanged;
+ }
+ }
+
+}
diff --git a/Src/Health/KnockedService.cs.meta b/Src/Health/KnockedService.cs.meta
new file mode 100644
index 0000000..91afc2a
--- /dev/null
+++ b/Src/Health/KnockedService.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1eec6f99cef0ae14ab1593764fad6a50
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/Health/Net.Project.B.Health.asmdef b/Src/Health/Net.Project.B.Health.asmdef
new file mode 100644
index 0000000..1a9cd51
--- /dev/null
+++ b/Src/Health/Net.Project.B.Health.asmdef
@@ -0,0 +1,17 @@
+{
+ "name": "Net.Project.B.Health",
+ "rootNamespace": "",
+ "references": [
+ "GUID:14fe60d984bf9f84eac55c6ea033a8f4",
+ "GUID:f51ebe6a0ceec4240a699833d6309b23"
+ ],
+ "includePlatforms": [],
+ "excludePlatforms": [],
+ "allowUnsafeCode": false,
+ "overrideReferences": false,
+ "precompiledReferences": [],
+ "autoReferenced": true,
+ "defineConstraints": [],
+ "versionDefines": [],
+ "noEngineReferences": true
+}
\ No newline at end of file
diff --git a/Src/Health/Net.Project.B.Health.asmdef.meta b/Src/Health/Net.Project.B.Health.asmdef.meta
new file mode 100644
index 0000000..8c19c23
--- /dev/null
+++ b/Src/Health/Net.Project.B.Health.asmdef.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 8f79dfa3edfa9514b8f6d7d2f0102ccc
+AssemblyDefinitionImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/Interaction.meta b/Src/Interaction.meta
new file mode 100644
index 0000000..6f37451
--- /dev/null
+++ b/Src/Interaction.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 1bcfe1d2412306a47900a35a4f5ae3e2
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/Interaction/Com.Project.B.Interaction.asmdef b/Src/Interaction/Com.Project.B.Interaction.asmdef
new file mode 100644
index 0000000..25a88fe
--- /dev/null
+++ b/Src/Interaction/Com.Project.B.Interaction.asmdef
@@ -0,0 +1,14 @@
+{
+ "name": "Com.Project.B.Interaction",
+ "rootNamespace": "",
+ "references": [],
+ "includePlatforms": [],
+ "excludePlatforms": [],
+ "allowUnsafeCode": false,
+ "overrideReferences": false,
+ "precompiledReferences": [],
+ "autoReferenced": true,
+ "defineConstraints": [],
+ "versionDefines": [],
+ "noEngineReferences": true
+}
\ No newline at end of file
diff --git a/Src/Interaction/Com.Project.B.Interaction.asmdef.meta b/Src/Interaction/Com.Project.B.Interaction.asmdef.meta
new file mode 100644
index 0000000..c83aeb9
--- /dev/null
+++ b/Src/Interaction/Com.Project.B.Interaction.asmdef.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: e527b3ce3106f974585be5134b6200e9
+AssemblyDefinitionImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Src/Interaction/IWorldInteractionService.cs b/Src/Interaction/IWorldInteractionService.cs
new file mode 100644
index 0000000..3887f2c
--- /dev/null
+++ b/Src/Interaction/IWorldInteractionService.cs
@@ -0,0 +1,64 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace Net.Project.B.Interaction
+{
+
+ public enum WorldInteractionProcess
+ {
+ None,
+ Hover,
+ Started,
+ Tap,
+ Hold,
+ Performed,
+ }
+ ///
+ /// 可互动类型
+ ///
+ public interface IWorldInteractable
+ {
+ public int Id { get; }
+ public IWorldInteractable Root { get; }
+ public IWorldInteractionType InteractionType { get; }
+ public object WorldObject { get; set; }
+ }
+ ///
+ /// 世界互动服务
+ ///
+ public interface IWorldInteractionService
+ {
+ ///
+ /// 注册可互动对象
+ ///
+ ///
+ ///
+ public bool Register(IWorldInteractable interactable);
+ ///
+ /// 注销可互动对象
+ ///
+ ///
+ ///
+ public bool Unregister(IWorldInteractable interactable);
+ ///
+ /// 尝试获取互动
+ ///
+ /// 通常是Collider InstanceId
+ /// 可互动对象
+ ///
+ public bool TryGetValue(int id, out IWorldInteractable interactable);
+ ///
+ /// 互动
+ ///
+ /// 互动者
+ /// 互动对象
+ /// 过程,例如开始,完成,结束
+ /// 是否互动成功
+ bool Interaction(object sender,IWorldInteractable interactable,WorldInteractionProcess process=WorldInteractionProcess.Performed);
+ ///
+ /// 互动回调
+ ///
+ public event Action