由于开发项目,某个Scene场景内会有很多的静态物体。我们在Hierarchy窗口中选中后,虽然有三维坐标显示在物体上,但是也很难分辨。 于是unity提供了给编辑物体设置icon。 这些icon大家都很熟悉了吧。 问题来了,如果是一个两个物体,我手动设置下没问题。如果几十个,或者更多呢? “写代码啊!”有些同学都会抢答了。 于是我在网上百度下,有了以下的代码: private static GUIContent[] labelIcons; private static GUIContent[] largeIcons; private static GUIContent[] GetTextures(string basename, string postFix, int startIndex, int count) { GUIContent[] guiContentArray = new GUIContent[count]; var t = typeof(EditorGUIUtility); var mi = t.GetMethod("IconContent",...