I find a lot of art brothers love to ask the program Unity3d why always lose material? I do not rule out u3d have a bug in the case will lose material? But in fact many times is caused by human operation.
1. Do not save on the upload
This operation is too scary, remember!! U3d inside you regardless of what you operate, when you want to upload SVN must first save the scene, Ctrl+s remember!! If you do not save the upload is likely to lose material.
2. My computer is clearly OK, how can you lose material?
I found a very interesting phenomenon, every time I go to the art computer to see its SVN project, I will find all kinds of "Huang" the whole project serious conflict. Then the dialogue between the program and the Fine Arts is: "Is this resource useful?" I don't have to delete it, I re-update ... "Hahaha I think it is possible only programmers will be very sensitive to conflict, but I think this thing can not blame art, art is very abstract things, not to the program to specific to a semicolon can not be carried out."
3. Manage Material maps
If the project does not manage the material and stickers, you will find that there are a lot of exactly the same picture is not the same name, but also in use. It is possible that several fine arts are being done at the same time, which can lead to a waste of resources.
4. Special effects Drop material
I give a practical example, our project scene and special effects are two people to do. Before you always encounter the scene effect of the problem of missing material. The reason is that the special effects of the person to modify the special effects, but do not know the scene, because the effect may be in a lot of scenes are in use.
As shown in the preiject below prefab if you drag into the hierarchy view, they are related, and if you modify prefab directly in Project view, all hierarchy associated with it will be modified. Small changes This is not a problem, if there are some big changes, then the hierarchy view of the prefab may be lost or broken. But if you have a lot of scenes that refer to the same prefab, so many scenes will be hard to find.
Select a prefab in the Hierarch view and click Select in the right Inspector view to automatically find the Prefab object in Project view. So reverse how do I find the prefab referenced in the hierarchy view from Project view?
As shown, Unity3d does a feature, selects a prefab in Project view, and then right-selects the find References in Scene, At this point, unity will automatically help you find the Gameobject in the hierarchy view that references this prefab in the current scene.
But this method is a bit limited, that is, it can only find the current scene, assuming that your prefab in a lot of scenes are quoted, then this is not found, for the fine arts I decided to write a small tool, hey.
C #
| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
[MenuItem("Assets/check Prefab use?") )] private static void onsearchforreferences() { //Make sure the right mouse button is selected as a prefab if(Selection. Gameobjects. Length! = 1) { return; } //Traverse all game scenes foreach(editorbuildsettingsscene scene in editorbuildsettings. Scenes) { if(scene. Enabled) { //Open scene editorapplication. Openscene(scene. Path); //Get all game objects in the scene gameobject []gos = (gameobject[< Span class= "Crayon-sy" >]) findobjectsoftype (typeof ( Gameobject foreach(gameobject go in gos) { //Determine if the Gameobject is a prefab reference if(prefabutility. Getprefabtype(go) = = prefabtype. Prefabinstance) { unityengine. Object parentobject = editorutility. Getprefabparent (go) string path = assetdatabase. Getassetpath(parentobject); //Determine if the Gameobject prefab is the same path as the right-click Prefab. if(path = = assetdatabase. Getassetpath(Selection. Activegameobject)) { //output scene name, and path referenced by prefab Debug. Log(scene. Path + "" + getgameobjectpath(go); } } } } } }Public static string getgameobjectpath(gameobject obj) { string path = "/" + obj. Name; While (obj. Transform. Parent = null) { obj = obj. Transform. Parent. Gameobject; path = "/" + obj. Name + path; } return path; } |
As shown, I can find out which scene is referencing this prefab. Here I do not use gameobject and prefab to judge, I think it is best not to use the name, because the hierarchy view of the name can be arbitrarily modified, if changed, it is certainly not found, and the scene so many completely have the same names.
Isn't it very simple? Hey.
Or there is a way to run the dynamic loading of the prefab, but some of the scene effects in fact there is no meaning, just the display, the program does not need to operate it.
With this gadget, then after the art to change the prefab, run a joint to see if some of the scene is normal display? Hey, hey.
Unity-----------------------packaged with Buildassetbundle