首页 > 其他分享 >不修改Read/Write Enabled,Texture.GetPixels,Mesh.triangles

不修改Read/Write Enabled,Texture.GetPixels,Mesh.triangles

时间:2023-10-19 10:44:35浏览次数:33  
标签:readableText GetPixels Read Enabled Texture Write source Texture2D triangles

### 原理:将Texture拷贝一份出来然后读取
  /// <summary>
  /// 不通过设置Read/Write Enabled,直接克隆一份可读的Texture2D
  /// </summary>
  /// <param name="source"></param>
  /// <returns></returns>
  public static Texture2D CloneTextureToReadable(Texture2D source)
  {
      byte[] pix = source.GetRawTextureData();
      Texture2D readableText = new Texture2D(source.width, source.height, source.format, false);
      readableText.LoadRawTextureData(pix);
      readableText.Apply();
      return readableText;
  }

  //不要直接使用mesh.triangles
  private int GetTriangleCount(Mesh mesh)
  {
      List<int> tris = new List<int>();
      mesh.GetTriangles(tris, 0);
      return tris.Count / 3;
  }

标签:readableText,GetPixels,Read,Enabled,Texture,Write,source,Texture2D,triangles
From: https://www.cnblogs.com/terrynoya/p/17774176.html

相关文章

  • Laravel Faker Readme
    Faker   FakerisaPHPlibrarythatgeneratesfakedataforyou.Whetheryouneedtobootstrapyourdatabase,creategood-lookingXMLdocuments,fill-inyourpersistencetostresstestit,oranonymizedatatakenfromaproductionservice,Fakerisfor......
  • vue进行跳转之后出现Cannot read properties of undefined (reading 'router') TypeEr
    问题描述使用router进行页面跳转时,就出现了这样的问题:也就是这里出现了问题:问题解决本来是按照网上的教程:const_this=this;但是,但是,我本来就是用的这种方法呀~然后就打算直接在这个界面引用:importrouterfrom'@/router'router.push('/one');里面引用的跳转页面......
  • Redission并发锁报错:IllegalMonitorStateException: attempt to unlock lock, not loc
    生产上突然出现一条报错j.l.IllegalMonitorStateException:attempttounlocklock,notlockedbycurrentthreadbynodeid:1411e030-3c44-48d7-9eb6-6030022ce681thread-id:111ato.r.RedissonBaseLock.lambda$unlockAsync$2(RedissonBaseLock.java:323)......
  • WIndows 10 更新后,登录后黑屏【AppReadiness 问题】
    现象:更新Windows10版本 的累积更新KB4038788似乎会导致用户系统上登录时出现黑屏(用户可能需要长达5~10分钟才能登录)  临时解决方法:禁用APPReadiness服务 参考资料:https://support.microsoft.com/en-us/topic/black-screen-when-windows-10-restarts-after-a-......
  • [911] Read Data from Google Sheets into Pandas without the Google Sheets API (.g
    ref:ReadDatafromGoogleSheetsintoPandaswithouttheGoogleSheetsAPIimportpandasaspdsheet_id="1XqOtPkiE_Q0dfGSoyxrH730RkwrTczcRbDeJJpqRByQ"sheet_name="Sheet1"url=f"https://docs.google.com/spreadsheets/d/{sheet......
  • 解决TypeError: read_excel() got an unexpected keyword argument ‘parse_cols or
    解决TypeError:read_excel()gotanunexpectedkeywordargument‘parse_cols'或‘sheetname‘在使用pandas包进行Excel文件处理时,有时候会遇到TypeError:read_excel()gotanunexpectedkeywordargument‘parse_cols'或TypeError:read_excel()gotanunexpectedkeyword......
  • Thread.Sleep() 和 Thread.SpinWait()
    Thread.Sleep()和Thread.SpinWait() 前言:应用程序应该让线程等待而不是切换。 一:Thread.Sleep(1000);Thread.Sleep()方法:是强制放弃CPU的时间片,然后重新和其他线程一起参与CPU的竞争。 二:Thread.SpinWait(1000);Thread.SpinWait()方法:只是让CPU去执行一段没有用的代......
  • threads隐私问题
    threadsapp隐私问题虽然转移数据很方便,但是处理不当的话,后有一些隐私问题;忘了是从哪个帖子里面看到的了;欢迎关注公-众-号【TaonyDaily】、留言、评论,一起学习。Don’treinventthewheel,librarycodeistheretohelp.文章来源:刘俊涛的博客若有帮助到您,欢迎点......
  • 【Java 并发编程】ThreadLocal
    目录ThreadLocalThreadLocal实现线程隔离的原理ThreadLocal内存泄漏场景ThreadLocalThreadLocal是一个将在多线程中为每一个线程创建单独的变量副本的类;当使用ThreadLocal来维护变量时,ThreadLocal会为每个线程创建单独的变量副本,避免因多线程操作共享变量而导致的数据不......
  • 2023 巅峰极客 m1_read 详细复现
    定位逻辑本题给出了bin文件,即out.bin,故可以猜测其内部包含了加密结果或者密钥等m1_read文件打开后,函数数量不多,并且静态分析WinMain不可行于是翻找函数,可以找到形如AES的函数(sub_4BF0)利用Findcrypt也出现了AES的特征码,于是假定是AES,并且没有魔改函数接近结尾部分可以看出这......