1
This commit is contained in:
18
Src/Inventory/Com.Project.B.Inventory.asmdef
Normal file
18
Src/Inventory/Com.Project.B.Inventory.asmdef
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "Com.Project.B.Inventory",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:14fe60d984bf9f84eac55c6ea033a8f4",
|
||||
"GUID:677cd05ca06c46b4395470200b1acdad",
|
||||
"GUID:f51ebe6a0ceec4240a699833d6309b23"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
7
Src/Inventory/Com.Project.B.Inventory.asmdef.meta
Normal file
7
Src/Inventory/Com.Project.B.Inventory.asmdef.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f0d7989fc8bc01489c1e1f65eedd1c3
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
36
Src/Inventory/IPlayerInventory.cs
Normal file
36
Src/Inventory/IPlayerInventory.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using BITKit;
|
||||
|
||||
namespace Net.Project.B.Inventory
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 玩家背包
|
||||
/// </summary>
|
||||
public interface IPlayerInventory
|
||||
{
|
||||
/// <summary>
|
||||
/// 背包
|
||||
/// </summary>
|
||||
public IRuntimeItemContainer Container { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 拾取物品的工厂方法
|
||||
/// </summary>
|
||||
event Action<IRuntimeItem> OnPickupItemFactory;
|
||||
|
||||
/// <summary>
|
||||
/// 使用物品的工厂方法,如果返回true则代表物品已被其他逻辑处理
|
||||
/// </summary>
|
||||
event Action<IRuntimeItem> UseFactory;
|
||||
|
||||
/// <summary>
|
||||
/// 使用物品的事件,如果返回true则代表物品已被其他逻辑处理
|
||||
/// </summary>
|
||||
event Action<IRuntimeItem> OnUsedItem;
|
||||
|
||||
void UseItem(int id);
|
||||
}
|
||||
}
|
11
Src/Inventory/IPlayerInventory.cs.meta
Normal file
11
Src/Inventory/IPlayerInventory.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c7d743b00f286c04985e59bc3d610882
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
81
Src/Inventory/IPlayerWeaponInventory.cs
Normal file
81
Src/Inventory/IPlayerWeaponInventory.cs
Normal file
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using BITKit;
|
||||
using BITKit.StateMachine;
|
||||
|
||||
namespace Net.Project.B.Inventory
|
||||
{
|
||||
/// <summary>
|
||||
/// 玩家武器槽
|
||||
/// </summary>
|
||||
public enum PlayerWeaponSlot
|
||||
{
|
||||
/// <summary>
|
||||
/// 主武器
|
||||
/// </summary>
|
||||
Primary,
|
||||
/// <summary>
|
||||
/// 主武器2
|
||||
/// </summary>
|
||||
Secondary,
|
||||
/// <summary>
|
||||
/// 副武器,例如手枪,近战武器等
|
||||
/// </summary>
|
||||
Sidearm,
|
||||
/// <summary>
|
||||
/// 消耗品,通常是护甲,医疗包等
|
||||
/// </summary>
|
||||
Supplies,
|
||||
/// <summary>
|
||||
/// 战术道具
|
||||
/// </summary>
|
||||
Tactics,
|
||||
/// <summary>
|
||||
/// 致命道具
|
||||
/// </summary>
|
||||
Lethal,
|
||||
/// <summary>
|
||||
/// 连杀奖励,特别的武器
|
||||
/// </summary>
|
||||
KillStreak
|
||||
}
|
||||
/// <summary>
|
||||
/// 玩家武器控制器
|
||||
/// </summary>
|
||||
public interface IPlayerWeaponController:IStateAsync{}
|
||||
/// <summary>
|
||||
/// 玩家枪支控制器
|
||||
/// </summary>
|
||||
public interface IPlayerGunController:IPlayerWeaponController{}
|
||||
/// <summary>
|
||||
/// 玩家近战武器控制器
|
||||
/// </summary>
|
||||
public interface IPlayerMeleeController:IPlayerWeaponController{}
|
||||
/// <summary>
|
||||
/// 玩家武器库存,与背包不是一个东西
|
||||
/// </summary>
|
||||
public interface IPlayerWeaponInventory
|
||||
{
|
||||
/// <summary>
|
||||
/// 武器槽
|
||||
/// </summary>
|
||||
public IReadOnlyDictionary<PlayerWeaponSlot,int> WeaponSlots { get; }
|
||||
/// <summary>
|
||||
/// 武器控制器状态机
|
||||
/// </summary>
|
||||
public IStateMachine<IPlayerWeaponController> StateMachine { get; }
|
||||
/// <summary>
|
||||
/// 武器槽更新回调,参数为:slot,ItemId,IsAdd
|
||||
/// </summary>
|
||||
public event Action<PlayerWeaponSlot, int, bool> OnWeaponSlotChanged;
|
||||
/// <summary>
|
||||
/// 丢下武器
|
||||
/// </summary>
|
||||
/// <param name="slot"></param>
|
||||
void Drop(PlayerWeaponSlot slot);
|
||||
void Use(PlayerWeaponSlot slot);
|
||||
void Use(int id);
|
||||
}
|
||||
|
||||
}
|
11
Src/Inventory/IPlayerWeaponInventory.cs.meta
Normal file
11
Src/Inventory/IPlayerWeaponInventory.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d7346ddba01563842a9e9c4b3438609b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user