docs.unity.cn
    Show / Hide Table of Contents

    Struct InventoryItemData

    Serializable data structure of an InventoryItem.

    Namespace: UnityEngine.GameFoundation.Data
    Syntax
    [Serializable]
    public struct InventoryItemData : IEquatable<InventoryItemData>

    Fields

    definitionKey

    Unique identifier of the item's definition.

    Declaration
    public string definitionKey
    Field Value
    Type Description
    String

    id

    Declaration
    public string id
    Field Value
    Type Description
    String

    mutableProperties

    Item's serializable mutable properties data.

    Declaration
    [FormerlySerializedAs("properties")]
    public PropertyData[] mutableProperties
    Field Value
    Type Description
    PropertyData[]

    quantity

    Quantity in stack (if InventoryItem is stackable).

    Declaration
    public long quantity
    Field Value
    Type Description
    Int64

    Methods

    Equals(Object)

    Tells whether this InventoryItemData instance equals obj.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj

    The other object to compare this instance with.

    Returns
    Type Description
    Boolean

    true if equals, false otherwise.

    Overrides
    ValueType.Equals(Object)

    Equals(InventoryItemData)

    Declaration
    public bool Equals(InventoryItemData other)
    Parameters
    Type Name Description
    InventoryItemData other
    Returns
    Type Description
    Boolean

    GetHashCode()

    Gets the hash code of this InventoryItemData instance. Returns the hash code of its id.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    The hash code of this InventoryItemData instance.

    Overrides
    ValueType.GetHashCode()
    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX
    on 16 June 2021