Class Cart
Represents a shopping cart that contains a collection of CartItem objects.
Implements
Inherited Members
Namespace: UnityEngine.Purchasing
Assembly: Unity.Purchasing.dll
Syntax
public class Cart : ICart
Constructors
Cart(CartItem)
Declaration
public Cart(CartItem cartItem)
Parameters
Type | Name | Description |
---|---|---|
CartItem | cartItem | A cart item. |
Methods
AddItem(CartItem)
Adds a new CartItem to the cart.
Declaration
public void AddItem(CartItem item)
Parameters
Type | Name | Description |
---|---|---|
CartItem | item | The CartItem to add. |
Equals(object)
Determines whether the specified object is equal to the current Cart.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with the current Cart. |
Returns
Type | Description |
---|---|
bool |
|
Overrides
GetHashCode()
Gets the hash code for the current Cart.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for the current Cart. |
Overrides
Items()
Gets the items in the cart as a read-only list.
Declaration
public IReadOnlyList<CartItem> Items()
Returns
Type | Description |
---|---|
IReadOnlyList<CartItem> | A read-only list of CartItem objects. |
RemoveItem(CartItem)
Removes a CartItem from the cart.
Declaration
public void RemoveItem(CartItem item)
Parameters
Type | Name | Description |
---|---|---|
CartItem | item | The CartItem to remove. |