private static string SaveScreenShot(int width, int height, Color[] pixels, string name)
{
Texture2D textured = new Texture2D(width, height);
textured.SetPixels(pixels, 0);
textured.Apply(true);
byte[] bytes = textured.EncodeToPNG();
Object.DestroyImmediate(textured, true);
string uniquePathForName = GetUniquePathForName(name);
File.WriteAllBytes(uniquePathForName, bytes);
Debug.Log(string.Format("Saved screenshot at {0}", uniquePathForName));
return uniquePathForName;
}