title: Unity - "New" custom class instance isn't separated from other instance
body: <p><strong>Solved myself, I'm silly</strong></p>
  
  <p><strong>Solved myself, I'm silly</strong></p>
  
  <p><strong>Solved myself, I'm silly</strong></p>
  
  <p>See my answer below.</p>
  
  <p>Having an issue with classes here, not sure of the cause.</p>
  
  <p>In my scene I have 2 GameObjects being instantiated from the same prefab. Each has an InventoryManager script attached, and in this script I'm creating a new instance of a class called Inventory using inside InventoryManager:</p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  
  public class InventoryManager : MonoBehaviour {
  
      public Inventory inventory;
      private ItemDatabase itemDatabase;
  
      void Start () 
      {
          inventory = new Inventory (9);
      }
  }
  </code></pre>
  
  <p>But for whatever reason, any of the List's values in my Inventory class is being shared between both of the instantiated GameObjects.</p>
  
  <p>Here's a peak of the inventory class:</p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  using System.Collections.Generic;
  
  [System.Serializable]
  public class Inventory
  {
      public int ID;
      public List&lt;Item&gt; items = new List&lt;Item&gt;();
      public int maxSize;
  
      public static int inventoryCount;
  
      public Inventory(int size)
      {
          ID = inventoryCount;
          inventoryCount++;
          maxSize = size;
      }
  }
  </code></pre>
  
  <p>Basically, when I add a new thing into</p>
  
  <pre><code>gameobject1.GetComponent&lt;InventoryManager&gt;().inventory.Add(item1);
  </code></pre>
  
  <p>(The add method does exist, it's a bit long so i'll only post it if requested)</p>
  
  <p>It will also show up in gameobject2's inventory.</p>