title: Is it possible to serialize sprites in unity?
body: <p>I'm working on some games that are suppose to communicate with one another trough a file. One of the things i am trying to send between the games is a sprite and an audioclip but it doesn't seem to work. I'm using the following class.</p>
  
  <pre><code>[Serializable]
  class Data
  {
      public Sprite spriteToSend;
      public AudioClip clipToSend;
  }
  </code></pre>
  
  <p>I'm also using BinaryFormatter to save my data like so</p>
  
  <pre><code>BinaryFormatter bf = new BinaryFormatter();
  FileStream file = File.Create(Application.persistentDataPath +"/Data.dat");
  Data data = new ;
  bf.Serialize(file, data);
  file.Close();
  </code></pre>
  
  <p>and to load it like so</p>
  
  <pre><code>BinaryFormatter bf = new BinaryFormatter();
  FileStream file = File.Open(Application.persistentDataPath + "\\Data.dat", FileMode.Open);
  Data data = (Data)bf.Deserialize(file);
  file.Close();
  </code></pre>
  
  <p>but when i run it i get an error that says sprites and audioclips cant be Serialized.</p>
  
  <p>Am i doing something wrong or how can i solve this problem?</p>