Class FpsInventoryBase
The base class for all player inventory behaviours
Inheritance
FpsInventoryBase
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: NeoFPS.dll
Syntax
public abstract class FpsInventoryBase : MonoBehaviour, IInventory, IMonoBehaviour, IQuickSlots, INeoSerializableComponent
Properties
backupSlot
Declaration
public IQuickSlotItem backupSlot { get; }
Property Value
duplicateBehaviour
Declaration
public abstract DuplicateEntryBehaviourFull duplicateBehaviour { get; }
Property Value
emptyAsBackupItem
Declaration
protected bool emptyAsBackupItem { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
initialisedContents
Declaration
protected bool initialisedContents { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
isBackupItemSelected
Declaration
public bool isBackupItemSelected { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
isLocked
Declaration
public bool isLocked { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
isNothingSelected
Declaration
public bool isNothingSelected { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
isSelectionLocked
Declaration
protected bool isSelectionLocked { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
numSlots
Declaration
public int numSlots { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
selected
Declaration
public IQuickSlotItem selected { get; }
Property Value
swapAction
Declaration
public abstract SwapAction swapAction { get; }
Property Value
swapping
Declaration
protected bool swapping { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
wieldableRootNsgo
Declaration
protected NeoSerializedGameObject wieldableRootNsgo { get; }
Property Value
wieldableRootScale
Declaration
public float wieldableRootScale { get; }
Property Value
| Type |
Description |
| System.Single |
|
Methods
AddItem(IInventoryItem)
Declaration
public InventoryAddResult AddItem(IInventoryItem item)
Parameters
Returns
AddItemFromPrefab(GameObject)
Declaration
public InventoryAddResult AddItemFromPrefab(GameObject prefab)
Parameters
| Type |
Name |
Description |
| GameObject |
prefab |
|
Returns
AddItemReference(FpsInventoryItemBase)
Declaration
protected abstract void AddItemReference(FpsInventoryItemBase item)
Parameters
AppendItem(IInventoryItem, IInventoryItem)
Declaration
protected InventoryAddResult AppendItem(IInventoryItem existing, IInventoryItem item)
Parameters
Returns
AppendPrefab(IInventoryItem, IInventoryItem)
Declaration
protected InventoryAddResult AppendPrefab(IInventoryItem existing, IInventoryItem prefab)
Parameters
Returns
ApplyLoadout(FpsInventoryLoadout, Boolean)
Declaration
public void ApplyLoadout(FpsInventoryLoadout loadout, bool replace = true)
Parameters
ApplyLoadout(IInventoryItem[], Boolean, Boolean)
Declaration
public void ApplyLoadout(IInventoryItem[] loadout, bool prefabs, bool replace = true)
Parameters
| Type |
Name |
Description |
| IInventoryItem[] |
loadout |
|
| System.Boolean |
prefabs |
|
| System.Boolean |
replace |
|
AutoSwitchSlot(Int32)
Declaration
public virtual void AutoSwitchSlot(int slot)
Parameters
| Type |
Name |
Description |
| System.Int32 |
slot |
|
AutoSwitchSlotDelayed(Int32)
Declaration
protected virtual IEnumerator AutoSwitchSlotDelayed(int slot)
Parameters
| Type |
Name |
Description |
| System.Int32 |
slot |
|
Returns
| Type |
Description |
| System.Collections.IEnumerator |
|
Awake()
Declaration
protected virtual void Awake()
CanAddItem(IInventoryItem)
Declaration
protected virtual bool CanAddItem(IInventoryItem item)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
CheckInitialised()
Declaration
protected virtual void CheckInitialised()
CheckInstantUse(Int32)
Declaration
protected abstract bool CheckInstantUse(int slot)
Parameters
| Type |
Name |
Description |
| System.Int32 |
slot |
|
Returns
| Type |
Description |
| System.Boolean |
|
ClearAllItems(UnityAction<IInventoryItem>)
Declaration
public abstract void ClearAllItems(UnityAction<IInventoryItem> onClearAction)
Parameters
ClearSlots()
Declaration
public abstract void ClearSlots()
ContainsItem(FpsInventoryItemBase)
Declaration
public abstract bool ContainsItem(FpsInventoryItemBase item)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
DropAllWieldables()
Declaration
public void DropAllWieldables()
DropItem(IQuickSlotItem)
Declaration
public void DropItem(IQuickSlotItem qsi)
Parameters
DropSelected()
Declaration
public void DropSelected()
GetItem(Int32)
Declaration
public abstract IInventoryItem GetItem(int itemIdentifier)
Parameters
| Type |
Name |
Description |
| System.Int32 |
itemIdentifier |
|
Returns
GetItems()
Declaration
public IInventoryItem[] GetItems()
Returns
GetItems(InventoryCallbacks.FilterItem)
Declaration
public IInventoryItem[] GetItems(InventoryCallbacks.FilterItem filter)
Parameters
Returns
GetItems(List<IInventoryItem>)
Declaration
public void GetItems(List<IInventoryItem> output)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.List<IInventoryItem> |
output |
|
GetItems(List<IInventoryItem>, InventoryCallbacks.FilterItem)
Declaration
public void GetItems(List<IInventoryItem> output, InventoryCallbacks.FilterItem filter)
Parameters
GetItemsSorted(InventoryCallbacks.FilterItem, Comparison<IInventoryItem>)
Declaration
public IInventoryItem[] GetItemsSorted(InventoryCallbacks.FilterItem filter, Comparison<IInventoryItem> compare)
Parameters
Returns
GetItemsSorted(List<IInventoryItem>, InventoryCallbacks.FilterItem, Comparison<IInventoryItem>)
Declaration
public abstract void GetItemsSorted(List<IInventoryItem> output, InventoryCallbacks.FilterItem filter, Comparison<IInventoryItem> compare)
Parameters
GetSlotItem(Int32)
Declaration
public abstract IQuickSlotItem GetSlotItem(int slot)
Parameters
| Type |
Name |
Description |
| System.Int32 |
slot |
|
Returns
GetStartingSlotOrder()
Declaration
protected int[] GetStartingSlotOrder()
Returns
| Type |
Description |
| System.Int32[] |
|
IsEquippableItem(Int32)
Declaration
protected abstract bool IsEquippableItem(int slot)
Parameters
| Type |
Name |
Description |
| System.Int32 |
slot |
|
Returns
| Type |
Description |
| System.Boolean |
|
IsSlotSelectable(Int32)
Declaration
public abstract bool IsSlotSelectable(int index)
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
|
Returns
| Type |
Description |
| System.Boolean |
|
LockSelectionToBackupItem(Object, Boolean)
Declaration
public bool LockSelectionToBackupItem(Object o, bool silent)
Parameters
| Type |
Name |
Description |
| Object |
o |
|
| System.Boolean |
silent |
|
Returns
| Type |
Description |
| System.Boolean |
|
LockSelectionToNothing(Object, Boolean)
Declaration
public bool LockSelectionToNothing(Object o, bool silent)
Parameters
| Type |
Name |
Description |
| Object |
o |
|
| System.Boolean |
silent |
|
Returns
| Type |
Description |
| System.Boolean |
|
LockSelectionToSlot(Int32, Object)
Declaration
public bool LockSelectionToSlot(int index, Object o)
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
|
| Object |
o |
|
Returns
| Type |
Description |
| System.Boolean |
|
OnItemRemoved(IInventoryItem)
Declaration
protected void OnItemRemoved(IInventoryItem item)
Parameters
OnSelectionChanged(Int32)
Declaration
protected void OnSelectionChanged(int slot)
Parameters
| Type |
Name |
Description |
| System.Int32 |
slot |
|
OnSlotItemChanged(Int32, IQuickSlotItem)
Declaration
protected void OnSlotItemChanged(int slot, IQuickSlotItem item)
Parameters
OnValidate()
Declaration
protected virtual void OnValidate()
ReadProperties(INeoDeserializer, NeoSerializedGameObject)
Declaration
public virtual void ReadProperties(INeoDeserializer reader, NeoSerializedGameObject nsgo)
Parameters
RemoveItem(IInventoryItem)
Declaration
public void RemoveItem(IInventoryItem item)
Parameters
RemoveItem(Int32, UnityAction<IInventoryItem>)
Declaration
public void RemoveItem(int itemIdentifier, UnityAction<IInventoryItem> onClearAction)
Parameters
| Type |
Name |
Description |
| System.Int32 |
itemIdentifier |
|
| UnityAction<IInventoryItem> |
onClearAction |
|
RemoveItemReference(FpsInventoryItemBase)
Declaration
protected abstract void RemoveItemReference(FpsInventoryItemBase item)
Parameters
SelectBackupItem(Boolean, Boolean)
Declaration
public virtual bool SelectBackupItem(bool toggle, bool silent)
Parameters
| Type |
Name |
Description |
| System.Boolean |
toggle |
|
| System.Boolean |
silent |
|
Returns
| Type |
Description |
| System.Boolean |
|
SelectNextSlot()
Declaration
public virtual bool SelectNextSlot()
Returns
| Type |
Description |
| System.Boolean |
|
SelectNothing(Boolean, Boolean)
Declaration
public virtual bool SelectNothing(bool toggle, bool silent)
Parameters
| Type |
Name |
Description |
| System.Boolean |
toggle |
|
| System.Boolean |
silent |
|
Returns
| Type |
Description |
| System.Boolean |
|
SelectPreviousSlot()
Declaration
public virtual bool SelectPreviousSlot()
Returns
| Type |
Description |
| System.Boolean |
|
SelectSlot(Int32)
Declaration
public virtual bool SelectSlot(int slot)
Parameters
| Type |
Name |
Description |
| System.Int32 |
slot |
|
Returns
| Type |
Description |
| System.Boolean |
|
SelectSlotInternal(Int32)
Declaration
protected abstract bool SelectSlotInternal(int slot)
Parameters
| Type |
Name |
Description |
| System.Int32 |
slot |
|
Returns
| Type |
Description |
| System.Boolean |
|
SelectStartingSlot()
Declaration
public bool SelectStartingSlot()
Returns
| Type |
Description |
| System.Boolean |
|
SetSelected(IQuickSlotItem, Int32, Boolean, Boolean)
Declaration
protected void SetSelected(IQuickSlotItem item, int slot, bool instant, bool silent)
Parameters
| Type |
Name |
Description |
| IQuickSlotItem |
item |
|
| System.Int32 |
slot |
|
| System.Boolean |
instant |
|
| System.Boolean |
silent |
|
SetSlotItem(Int32, IQuickSlotItem)
Declaration
public abstract void SetSlotItem(int slot, IQuickSlotItem item)
Parameters
Start()
Declaration
protected virtual void Start()
SwitchSelection()
Declaration
public virtual bool SwitchSelection()
Returns
| Type |
Description |
| System.Boolean |
|
SwitchSelectionOnRemove(IInventoryItem)
Declaration
protected virtual void SwitchSelectionOnRemove(IInventoryItem removed)
Parameters
UnlockSelection(Object)
Declaration
public void UnlockSelection(Object o)
Parameters
| Type |
Name |
Description |
| Object |
o |
|
WriteProperties(INeoSerializer, NeoSerializedGameObject, SaveMode)
Declaration
public virtual void WriteProperties(INeoSerializer writer, NeoSerializedGameObject nsgo, SaveMode saveMode)
Parameters
Events
onItemAdded
Declaration
public event UnityAction<IInventoryItem> onItemAdded
Event Type
onItemDropped
Declaration
public event UnityAction<IQuickSlotItem> onItemDropped
Event Type
onItemRemoved
Declaration
public event UnityAction<IInventoryItem> onItemRemoved
Event Type
onSelectionChanged
Declaration
public event UnityAction<int, IQuickSlotItem> onSelectionChanged
Event Type
onSlotItemChanged
Declaration
public event UnityAction<int, IQuickSlotItem> onSlotItemChanged
Event Type
Implements
See Also