Containers are GameObjects that store a collection of inventory items that the player can retrieve. They are typically a per-scene object, but this script allows you to create a Container whose contents are the same in all scenes.
To use it:
- Create a new C# script named DontDestroyMe.cs, and paste in the contents below
- Drop a new Container in your game's first scene and add the new Dont Destroy Me component
- Make sure there is a Remember Container component attached
DontDestroyMe.cs:
using UnityEngine;
using System.Collections;
using AC;
public class DontDestroyMe : MonoBehaviour
{
private void Start ()
{ DontDestroyOnLoad (gameObject); }
}