⮞ Go to NeoFPS.com

    Show / Hide Table of Contents

    Class FpsInventoryBase

    The base class for all player inventory behaviours

    Inheritance
    Object
    MonoBehaviour
    FpsInventoryBase
    FpsInventoryQuickSwitch
    FpsInventoryStacked
    FpsInventorySwappable
    Implements
    IInventory
    IMonoBehaviour
    IQuickSlots
    INeoSerializableComponent
    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()
    Namespace: NeoFPS
    Assembly: NeoFPS.dll
    Syntax
    public abstract class FpsInventoryBase : MonoBehaviour, IInventory, IMonoBehaviour, IQuickSlots, INeoSerializableComponent

    Properties

    backupSlot

    Declaration
    public IQuickSlotItem backupSlot { get; }
    Property Value
    Type Description
    IQuickSlotItem

    duplicateBehaviour

    Declaration
    public abstract DuplicateEntryBehaviourFull duplicateBehaviour { get; }
    Property Value
    Type Description
    DuplicateEntryBehaviourFull

    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
    Type Description
    IQuickSlotItem

    swapAction

    Declaration
    public abstract SwapAction swapAction { get; }
    Property Value
    Type Description
    SwapAction

    swapping

    Declaration
    protected bool swapping { get; }
    Property Value
    Type Description
    System.Boolean

    wieldableRootNsgo

    Declaration
    protected NeoSerializedGameObject wieldableRootNsgo { get; }
    Property Value
    Type Description
    NeoSerializedGameObject

    wieldableRootScale

    Declaration
    public float wieldableRootScale { get; }
    Property Value
    Type Description
    System.Single

    Methods

    AddItem(IInventoryItem)

    Declaration
    public InventoryAddResult AddItem(IInventoryItem item)
    Parameters
    Type Name Description
    IInventoryItem item
    Returns
    Type Description
    InventoryAddResult

    AddItemFromPrefab(GameObject)

    Declaration
    public InventoryAddResult AddItemFromPrefab(GameObject prefab)
    Parameters
    Type Name Description
    GameObject prefab
    Returns
    Type Description
    InventoryAddResult

    AddItemReference(FpsInventoryItemBase)

    Declaration
    protected abstract void AddItemReference(FpsInventoryItemBase item)
    Parameters
    Type Name Description
    FpsInventoryItemBase item

    AppendItem(IInventoryItem, IInventoryItem)

    Declaration
    protected InventoryAddResult AppendItem(IInventoryItem existing, IInventoryItem item)
    Parameters
    Type Name Description
    IInventoryItem existing
    IInventoryItem item
    Returns
    Type Description
    InventoryAddResult

    AppendPrefab(IInventoryItem, IInventoryItem)

    Declaration
    protected InventoryAddResult AppendPrefab(IInventoryItem existing, IInventoryItem prefab)
    Parameters
    Type Name Description
    IInventoryItem existing
    IInventoryItem prefab
    Returns
    Type Description
    InventoryAddResult

    ApplyLoadout(FpsInventoryLoadout, Boolean)

    Declaration
    public void ApplyLoadout(FpsInventoryLoadout loadout, bool replace = true)
    Parameters
    Type Name Description
    FpsInventoryLoadout loadout
    System.Boolean replace

    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
    Type Name Description
    IInventoryItem item
    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
    Type Name Description
    UnityAction<IInventoryItem> onClearAction

    ClearSlots()

    Declaration
    public abstract void ClearSlots()

    ContainsItem(FpsInventoryItemBase)

    Declaration
    public abstract bool ContainsItem(FpsInventoryItemBase item)
    Parameters
    Type Name Description
    FpsInventoryItemBase item
    Returns
    Type Description
    System.Boolean

    DropAllWieldables()

    Declaration
    public void DropAllWieldables()

    DropItem(IQuickSlotItem)

    Declaration
    public void DropItem(IQuickSlotItem qsi)
    Parameters
    Type Name Description
    IQuickSlotItem qsi

    DropSelected()

    Declaration
    public void DropSelected()

    GetItem(Int32)

    Declaration
    public abstract IInventoryItem GetItem(int itemIdentifier)
    Parameters
    Type Name Description
    System.Int32 itemIdentifier
    Returns
    Type Description
    IInventoryItem

    GetItems()

    Declaration
    public IInventoryItem[] GetItems()
    Returns
    Type Description
    IInventoryItem[]

    GetItems(InventoryCallbacks.FilterItem)

    Declaration
    public IInventoryItem[] GetItems(InventoryCallbacks.FilterItem filter)
    Parameters
    Type Name Description
    InventoryCallbacks.FilterItem filter
    Returns
    Type Description
    IInventoryItem[]

    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
    Type Name Description
    System.Collections.Generic.List<IInventoryItem> output
    InventoryCallbacks.FilterItem filter

    GetItemsSorted(InventoryCallbacks.FilterItem, Comparison<IInventoryItem>)

    Declaration
    public IInventoryItem[] GetItemsSorted(InventoryCallbacks.FilterItem filter, Comparison<IInventoryItem> compare)
    Parameters
    Type Name Description
    InventoryCallbacks.FilterItem filter
    System.Comparison<IInventoryItem> compare
    Returns
    Type Description
    IInventoryItem[]

    GetItemsSorted(List<IInventoryItem>, InventoryCallbacks.FilterItem, Comparison<IInventoryItem>)

    Declaration
    public abstract void GetItemsSorted(List<IInventoryItem> output, InventoryCallbacks.FilterItem filter, Comparison<IInventoryItem> compare)
    Parameters
    Type Name Description
    System.Collections.Generic.List<IInventoryItem> output
    InventoryCallbacks.FilterItem filter
    System.Comparison<IInventoryItem> compare

    GetSlotItem(Int32)

    Declaration
    public abstract IQuickSlotItem GetSlotItem(int slot)
    Parameters
    Type Name Description
    System.Int32 slot
    Returns
    Type Description
    IQuickSlotItem

    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
    Type Name Description
    IInventoryItem item

    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
    Type Name Description
    System.Int32 slot
    IQuickSlotItem item

    OnValidate()

    Declaration
    protected virtual void OnValidate()

    ReadProperties(INeoDeserializer, NeoSerializedGameObject)

    Declaration
    public virtual void ReadProperties(INeoDeserializer reader, NeoSerializedGameObject nsgo)
    Parameters
    Type Name Description
    INeoDeserializer reader
    NeoSerializedGameObject nsgo

    RemoveItem(IInventoryItem)

    Declaration
    public void RemoveItem(IInventoryItem item)
    Parameters
    Type Name Description
    IInventoryItem item

    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
    Type Name Description
    FpsInventoryItemBase item

    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
    Type Name Description
    System.Int32 slot
    IQuickSlotItem item

    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
    Type Name Description
    IInventoryItem removed

    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
    Type Name Description
    INeoSerializer writer
    NeoSerializedGameObject nsgo
    SaveMode saveMode

    Events

    onItemAdded

    Declaration
    public event UnityAction<IInventoryItem> onItemAdded
    Event Type
    Type Description
    UnityAction<IInventoryItem>

    onItemDropped

    Declaration
    public event UnityAction<IQuickSlotItem> onItemDropped
    Event Type
    Type Description
    UnityAction<IQuickSlotItem>

    onItemRemoved

    Declaration
    public event UnityAction<IInventoryItem> onItemRemoved
    Event Type
    Type Description
    UnityAction<IInventoryItem>

    onSelectionChanged

    Declaration
    public event UnityAction<int, IQuickSlotItem> onSelectionChanged
    Event Type
    Type Description
    UnityAction<System.Int32, IQuickSlotItem>

    onSlotItemChanged

    Declaration
    public event UnityAction<int, IQuickSlotItem> onSlotItemChanged
    Event Type
    Type Description
    UnityAction<System.Int32, IQuickSlotItem>

    Implements

    IInventory
    IMonoBehaviour
    IQuickSlots
    INeoSerializableComponent

    See Also

    IInventory
    IQuickSlots
    Back to top Copyright © 2019 Yondernauts Game Studios Ltd
    Generated with DocFX