2022-01-04 解决Unable to find styl

2022-01-04  本文已影响0人  凌枫望星月
  IL code
  private void drawBackground()
  {
    GUI.Box(this.trackBodyBackground, GUIContent.none, (GUIStyle) "AnimationCurveEditorBackground");
    this.rect = this.trackBodyBackgroundNoVerticalScrollbar;
    this.BeginViewGUI(false);
    this.SetTickMarkerRanges();
    this.DrawMajorTicks(this.trackBodyBackground, (float) this.frameRate);
    this.EndViewGUI();
  }

警告信息为:
Unable to find style 'AnimationCurveEditorBackground' in skin 'DarkSkin' Layout


1)这个同学将‘AS TextArea’中的AS去掉,就可以解决警告


2)我想到能不能将AnimationCurveEditorBackground这个GUIStyle换成别的,就能解决这个警告问题,然后去搜索了怎么去修改dll,用微软提供的Ilasm.exe(IL 汇编程序)和Ildasm.exe(IL 反汇编程序)
Download: /releases[ latest ]
然后用微软文档来修改dll,先把dll反编译变成可编辑的il文件,再编译回去。
有些同学应该可以在C盘找到的这两个工具,但是我没找到其中一个,下载后却发现两个版本可能对不上,所以去自己找的汇编程序。
在修改il文件时将AnimationCurveEditorBackground更换为PopupCurveEditorBackground,问题解决。
我猜是在一次unity更新后将内置的GUIstyle也做了更新,有些老版本的换了名字。

这个问题在下一篇文章中得到验证查看Unity所有的默认UI效果 GUIStyle

上一篇 下一篇

猜你喜欢

热点阅读