Summary of Unity Engine Tool Internship
I have been interning at the Engine Tools position for nearly a year, where I have been exposed to engine source code and have implemented various requirements. Looking back, it has been a long way, and I am grateful for the help of my colleagues in the group and the excellent blogs online (such as Unity Editor editor extension function related and Intel GPA Android Reverse Related. Here is a brief record of the basic content of the engine tool position, which should be a summary and review of resignation. Percept as you travel; Try your very best; Not fear the unknown; Not regret your choice.
Editor tools
The program not only has GamePlay orientation, but also Editor orientation, providing tools for planning art to better output content. In individual development/small teams, it may not be very important (or not at all), but if it is a large-scale project, that is a different story.
Editor classification
It can be roughly divided into two categories: one is to open a single window, and the other is to display it in the Inspector interface
Window editor
The main structure of the window editor is as follows:
1 | using UnityEditor; |
View editor
1 | using UnityEditor; |
Editor Panel
Next is how to organize various structures in the panel. Undoubtedly, Odin is now cleaner and more aesthetically pleasing, but Unity’s own Editor is easier to use and modify
Object control
1 | EditorGUILayout.LabelField("标题", "内容"); |
The draggable list needs to introduce UnityEditorInternal (optimize array display) and initialize ReorderableList before drawing
1 | reorderableList = new ReorderableList(listItems, typeof(string));//list's type isReorderableList,item's type is List<string> |
Interface layout
1 | EditorGUILayout.BeginHorizontal();//Horizontal layout |
Message Prompt
1 | EditorGUILayout.HelpBox("一般提示,最常用的提示", MessageType.Info); |
Editor file operations
It should be noted that modifying the Prefab file directly under Load cannot be saved back, and it must be instantiated before making the modifications and saving.
1 | AssetDatabase.CopyAsset(OldPath, NewPath) //Copy file |
Frame truncation, performance analysis, and reverse engineering
Frame truncation
Frame Debug
Convenient and fast, you can view the rendering order, shaders used for rendering, and texture related information, which can help quickly locate problems
RenderDoc
You can view vertex data, shader code, and modify preview effects. When encountering tricky rendering problems, you can give it a try
Performance analysis
You can analyze the overhead of various functions in Unity through the built-in Profiler, and you can also use code to enable logging to understand the performance of new functional modules (further, you can try the Profile Analyzer)
Reverse engineering
By using Intel GPA you can reverse engineer emulators on a computer. First, open the Auto detect Launched Applications in Graphics Monitor, then run the game, take screenshots of the desired scene, and finally load relevant screenshots in Graphics Frame Analyzer to obtain model resource information.