private static Texture2D LoadTaskTexture(string imageName) { if (BehaviorDesignerUtility.textureCache.ContainsKey(imageName)) { return(BehaviorDesignerUtility.textureCache[imageName]); } Texture2D texture2D = null; Stream rStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(imageName); texture2D = new Texture2D(0, 0, TextureFormat.RGBA32, false, true); texture2D.LoadImage(BehaviorDesignerUtility.ReadToEnd(rStream)); texture2D.hideFlags = HideFlags.HideAndDontSave; return(texture2D); }