摘要: private Texture2D RenderTextureToTexture2D(RenderTexture texture) { RenderTexture RT = RenderTexture.active; RenderTexture.active = texture; Texture2D 阅读全文
posted @ 2020-09-11 13:51 艾孜尔江 阅读(878) 评论(0) 推荐(0)
摘要: /// <summary> /// color 转换hex /// </summary> /// <param name="color"></param> /// <returns></returns> public static string ColorToHex(Color color) { i 阅读全文
posted @ 2020-09-11 13:49 艾孜尔江 阅读(3205) 评论(0) 推荐(0)
摘要: public static Texture2D BytesToTexture2D(byte[] bytes, int w = 1920, int h = 1080) { Texture2D texture2D = new Texture2D(w, h); texture2D.LoadImage(by 阅读全文
posted @ 2020-09-11 13:48 艾孜尔江 阅读(1131) 评论(0) 推荐(0)
摘要: //压缩字节 //1.创建压缩的数据流 //2.设定compressStream为存放被压缩的文件流,并设定为压缩模式 //3.将需要压缩的字节写到被压缩的文件流 public static byte[] CompressBytes(byte[] bytes) { using (MemoryStre 阅读全文
posted @ 2020-09-11 13:47 艾孜尔江 阅读(2072) 评论(0) 推荐(0)
摘要: private Texture2D TextureToTexture2D(Texture texture) { Texture2D texture2D = new Texture2D(texture.width, texture.height, TextureFormat.RGBA32, false 阅读全文
posted @ 2020-09-11 13:46 艾孜尔江 阅读(710) 评论(0) 推荐(0)
摘要: public static byte[] Color32ArrayToByteArray(Color32[] colors) { if (colors == null || colors.Length == 0) return null; int lengthOfColor32 = Marshal. 阅读全文
posted @ 2020-09-11 13:43 艾孜尔江 阅读(1421) 评论(0) 推荐(0)