title: Scriptable object doesn't work on build
body: <p>I'm hoping this might be something simple I'm missing.</p>
  
  <p>I have a ScriptableObject script that looks like this:</p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  
  [CreateAssetMenu]
  public class Item: ScriptableObject
  {
      public string iname;
      public int iindex;
      public Sprite sprite;
      public GameObject itemObject;
      public int value;
      public string description;
      public itemType itemtype;
  
      public enum itemType
      {
  
          Consumable,
          Equippable,
      }
  
  }
  </code></pre>
  
  <p>This works great in the editor, but if I publish to Android or Windows any script that references the ScriptableObject, it does not work. What am I missing?</p>
  
  <p>For example the following block of code does not seem to execute at all:</p>
  
  <pre><code>for (int i = 0; i &lt; 3; i++)
  {
      int lootnum = Random.Range(0, 4);
  
  
      slot1 = itemdb[lootnum];
      tlist[i] = itemdb[lootnum];
      slotlist[i].transform.GetChild(0).GetComponent&lt;Image&gt;().sprite = itemdb[lootnum].sprite;
      slotlist[i].transform.GetChild(0).GetComponent&lt;Image&gt;().enabled = true;
  }
  </code></pre>
  
  <p>Those lists in the code are of the type Item defined in the above script. I'm not sure how to debug this as I get no errors or warnings in the editor.</p>
  
  <p>Here is the script which populates the inventory. There's a bit of junk in there but it definitley works fine pressing play in the editor. Just not on build.</p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  using System.Collections.Generic;
  using UnityEngine.UI;
  
  public class Inventory : MonoBehaviour {
  
  
      public int invSize;
      public Item slot1;
      public Item tslot1;
      public Item tslot2;
       public Item tslot3;
      public GameObject t1;
      public GameObject t2;
      public GameObject t3;
      public Sprite itemsprite;
      public List&lt;Item&gt; itemdb = new List&lt;Item&gt;();
      public List&lt;Item&gt; items = new List&lt;Item&gt;();
      public List&lt;Item&gt; tlist = new List&lt;Item&gt;();
      public Text stext;
      public Text description;
      public Item selectItem;
      public GameObject selectSlot;
      public Object test2;
  
      public List&lt;GameObject&gt; slotlist = new List&lt;GameObject&gt;();
  
  
      // Use this for initialization
      void Start () {
  
  
      }
  
      // Update is called once per frame
      void Update () {
  
      }
  
      public void addItem(Item itemToAdd)
      {
          //items.Add(itemdb[0]);
          for (int i = 0; i &lt; 5; i++)
          {
  
              if (items[i] == null)
              {
                  items[i] = itemToAdd;
                  itemsprite = itemToAdd.sprite;
  
                  return;
              }
          }
      }
  
  
      public void GenTreasure()
      {
  
  
  
  
  
          for (int i = 0; i &lt; 3; i++)
          {
              int lootnum = Random.Range(0, 4);
  
  
              slot1 = itemdb[lootnum];
              tlist[i] = itemdb[lootnum];
              slotlist[i].transform.GetChild(0).GetComponent&lt;Image&gt;().sprite = itemdb[lootnum].sprite;
              slotlist[i].transform.GetChild(0).GetComponent&lt;Image&gt;().enabled = true;
          }
  
      }
  
  
      public void Uptext(int indexx)
      {
          stext.text = tlist[indexx].iname;
          selectItem = tlist[indexx];
          selectSlot = slotlist[indexx];
          description.text = selectItem.description;
      }
  
      public void Take(int index)
      {
          //items.Add(selectItem);
          for (int i = 0; i &lt; invSize; i++)
          {
  
              if (items[i] == null)
              {
                  items[i] = selectItem;
                  //   itemsprite = itemToAdd.sprite;
                  selectItem = null;
                  //   tlist[i] = null;
                  //    slotlist[i].transform.GetChild(0).GetComponent&lt;Image&gt;().sprite = null;
                  selectSlot.transform.GetChild(0).GetComponent&lt;Image&gt;().enabled = false;
  
                  return;
              }
  
          }
  
      }
  }
  </code></pre>