1. Home
  2. S-Inventory
  3. Containers
  4. Creating a Container

Creating a Container

Drag and drop the “Container.cs” component to a game object to make it a container.

  • Container ID: assign a unique ID for each container.
  • Min Distance: The minimum distance required to open the container’s UI panel by a mouse click (if player is using mouse controls) or a keyboard button (if player is using keyboard controls).
  • Max Items: The maximum amount of items that the container can store.
  • Rearrange items: If set to true, items will be automatically arranged in the container panel based on their type.
  • Player: Drag and drop the player’s game object in this field.
  • Panel: Drag and drop the object that contains the Container UI script.
  • Default Item: This is a prefab that exists in your project files and which has the “Item.cs” component. This prefab has default settings and will be used in loading saved items. There’s one ready default item in the project: S-Inventory -> Default Item.
  • Key: Key used to show/hide the container’s UI window if player is using keyboard controls.
  • Open Container: Sound played when the container has been opened.
  • Close Container: Sound played when the container has been closed.
  • Save And Load: If checked, all items in this container will be saved and loaded.
Was this article helpful to you? Yes No

How can we help?