public static Texture2D LoadImage(string filename, int width, int height) { if (File.Exists(PlugInIconPath + filename)) { var bytes = File.ReadAllBytes(PlugInIconPath + filename); //Debug.Log("image bytes read"); Texture2D texture = new Texture2D(width, height, TextureFormat.ARGB32, false); //Debug.Log("texture created"); texture.LoadImage(bytes); //Debug.Log("image loaded to texture"); return texture; } return null; }
public void Awake() { playTex = Utilities.LoadImage("play.png", 24, 24); pauseTex = Utilities.LoadImage("pause.png", 24, 24);; ffTex = Utilities.LoadImage("ff2.png", 24, 24);; stopTex = Utilities.LoadImage("stop.png", 24, 24); }