Exemplo n.º 1
0
 public void CopyTo(MonoBehaviour dest)
 {
     GameObject destGameObj = dest.m_GameObject.instance;
     if (destGameObj != null)
     {
         Transform animFrame = destGameObj.FindLinkedComponent(UnityClassID.Transform);
         while (animFrame.Parent != null)
         {
             animFrame = animFrame.Parent;
         }
         UPPtr.AnimatorRoot = animFrame;
     }
     else
     {
         UPPtr.AnimatorRoot = null;
     }
     Parser.type.CopyTo(dest.Parser.type);
 }
Exemplo n.º 2
0
 public dynamic LoadComponent(Stream stream, int index, NotLoaded comp)
 {
     stream.Position = comp.offset;
     try
     {
         switch (comp.classID1)
         {
         case UnityClassID.AnimationClip:
             {
                 AnimationClip animationClip = new AnimationClip(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, animationClip, comp);
                 animationClip.LoadFrom(stream);
                 return animationClip;
             }
         case UnityClassID.Animator:
             {
                 Animator animator = new Animator(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, animator, comp);
                 animator.LoadFrom(stream);
                 return animator;
             }
         case UnityClassID.AnimatorController:
             {
                 AnimatorController animatorController = new AnimatorController(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, animatorController, comp);
                 animatorController.LoadFrom(stream);
                 return animatorController;
             }
         case UnityClassID.AssetBundle:
             {
                 AssetBundle assetBundle = new AssetBundle(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, assetBundle, comp);
                 assetBundle.LoadFrom(stream);
                 return assetBundle;
             }
         case UnityClassID.AudioClip:
             {
                 if (loadingReferencials)
                 {
                     return comp;
                 }
                 AudioClip ac = new AudioClip(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, ac, comp);
                 ac.LoadFrom(stream);
                 return ac;
             }
         case UnityClassID.AudioListener:
             {
                 AudioListener audioListener = new AudioListener(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, audioListener, comp);
                 audioListener.LoadFrom(stream);
                 return audioListener;
             }
         case UnityClassID.AudioSource:
             {
                 AudioSource audioSrc = new AudioSource(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, audioSrc, comp);
                 audioSrc.LoadFrom(stream);
                 return audioSrc;
             }
         case UnityClassID.Avatar:
             {
                 if (loadingReferencials)
                 {
                     return comp;
                 }
                 Avatar avatar = new Avatar(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, avatar, comp);
                 avatar.LoadFrom(stream);
                 return avatar;
             }
         case UnityClassID.BoxCollider:
             {
                 BoxCollider boxCol = new BoxCollider(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, boxCol, comp);
                 boxCol.LoadFrom(stream);
                 return boxCol;
             }
         case UnityClassID.Camera:
             {
                 Camera camera = new Camera(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, camera, comp);
                 camera.LoadFrom(stream);
                 return camera;
             }
         case UnityClassID.CapsuleCollider:
             {
                 CapsuleCollider capsuleCol = new CapsuleCollider(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, capsuleCol, comp);
                 capsuleCol.LoadFrom(stream);
                 return capsuleCol;
             }
         case UnityClassID.Cubemap:
             {
                 Cubemap cubemap = new Cubemap(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, cubemap, comp);
                 cubemap.LoadFrom(stream);
                 Parser.Textures.Add(cubemap);
                 return cubemap;
             }
         case UnityClassID.EllipsoidParticleEmitter:
             {
                 EllipsoidParticleEmitter ellipsoid = new EllipsoidParticleEmitter(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, ellipsoid, comp);
                 ellipsoid.LoadFrom(stream);
                 return ellipsoid;
             }
         case UnityClassID.FlareLayer:
             {
                 FlareLayer flareLayer = new FlareLayer(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, flareLayer, comp);
                 flareLayer.LoadFrom(stream);
                 return flareLayer;
             }
         case UnityClassID.Light:
             {
                 Light light = new Light(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, light, comp);
                 light.LoadFrom(stream);
                 return light;
             }
         case UnityClassID.LinkToGameObject:
             {
                 LinkToGameObject link = new LinkToGameObject(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, link, comp);
                 link.LoadFrom(stream);
                 return link;
             }
         case UnityClassID.LinkToGameObject223:
             {
                 LinkToGameObject223 link = new LinkToGameObject223(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, link, comp);
                 link.LoadFrom(stream);
                 return link;
             }
         case UnityClassID.LinkToGameObject225:
             {
                 LinkToGameObject225 link = new LinkToGameObject225(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, link, comp);
                 link.LoadFrom(stream);
                 return link;
             }
         case UnityClassID.GameObject:
             {
                 GameObject gameObj = new GameObject(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, gameObj, comp);
                 gameObj.LoadFrom(stream);
                 return gameObj;
             }
         case UnityClassID.Material:
             {
                 Material mat = new Material(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, mat, comp);
                 mat.LoadFrom(stream);
                 return mat;
             }
         case UnityClassID.Mesh:
             {
                 if (loadingReferencials)
                 {
                     return comp;
                 }
                 Mesh mesh = new Mesh(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, mesh, comp);
                 mesh.LoadFrom(stream);
                 return mesh;
             }
         case UnityClassID.MeshCollider:
             {
                 MeshCollider meshCol = new MeshCollider(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, meshCol, comp);
                 meshCol.LoadFrom(stream);
                 return meshCol;
             }
         case UnityClassID.MeshFilter:
             {
                 MeshFilter meshFilter = new MeshFilter(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, meshFilter, comp);
                 meshFilter.LoadFrom(stream);
                 return meshFilter;
             }
         case UnityClassID.MeshRenderer:
             {
                 MeshRenderer meshRenderer = new MeshRenderer(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, meshRenderer, comp);
                 meshRenderer.LoadFrom(stream);
                 return meshRenderer;
             }
         default:
             if (comp.classID2 == UnityClassID.MonoBehaviour)
             {
                 if (Types.Count > 0)
                 {
                     MonoBehaviour monoBehaviour = new MonoBehaviour(this, comp.pathID, comp.classID1, comp.classID2);
                     ReplaceSubfile(index, monoBehaviour, comp);
                     monoBehaviour.LoadFrom(stream);
                     return monoBehaviour;
                 }
                 else
                 {
                     string message = comp.classID2 + " unhandled because of absence of Types in Cabinet (*.assets)";
                     if (!reported.Contains(message))
                     {
                         Report.ReportLog(message);
                         reported.Add(message);
                     }
                     return comp;
                 }
             }
             else
             {
                 string message = "Unhandled class: " + comp.classID1 + "/" + comp.classID2;
                 if (!reported.Contains(message))
                 {
                     Report.ReportLog(message);
                     reported.Add(message);
                 }
             }
             break;
         case UnityClassID.MonoScript:
             {
                 if (loadingReferencials)
                 {
                     return comp;
                 }
                 MonoScript monoScript = new MonoScript(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, monoScript, comp);
                 monoScript.LoadFrom(stream);
                 return monoScript;
             }
         case UnityClassID.MultiLink:
             {
                 MultiLink multi = new MultiLink(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, multi, comp);
                 multi.LoadFrom(stream);
                 return multi;
             }
         case UnityClassID.ParticleAnimator:
             {
                 ParticleAnimator particleAnimator = new ParticleAnimator(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, particleAnimator, comp);
                 particleAnimator.LoadFrom(stream);
                 return particleAnimator;
             }
         case UnityClassID.ParticleRenderer:
             {
                 ParticleRenderer particleRenderer = new ParticleRenderer(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, particleRenderer, comp);
                 particleRenderer.LoadFrom(stream);
                 return particleRenderer;
             }
         case UnityClassID.ParticleSystem:
             {
                 ParticleSystem particleSystem = new ParticleSystem(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, particleSystem, comp);
                 particleSystem.LoadFrom(stream);
                 return particleSystem;
             }
         case UnityClassID.ParticleSystemRenderer:
             {
                 ParticleSystemRenderer particleSystemRenderer = new ParticleSystemRenderer(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, particleSystemRenderer, comp);
                 particleSystemRenderer.LoadFrom(stream);
                 return particleSystemRenderer;
             }
         case UnityClassID.Projector:
             {
                 Projector projector = new Projector(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, projector, comp);
                 projector.LoadFrom(stream);
                 return projector;
             }
         case UnityClassID.Rigidbody:
             {
                 RigidBody rigidBody = new RigidBody(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, rigidBody, comp);
                 rigidBody.LoadFrom(stream);
                 return rigidBody;
             }
         case UnityClassID.Shader:
             {
                 Shader shader = new Shader(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, shader, comp);
                 shader.LoadFrom(stream);
                 return shader;
             }
         case UnityClassID.SkinnedMeshRenderer:
             {
                 SkinnedMeshRenderer sMesh = new SkinnedMeshRenderer(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, sMesh, comp);
                 sMesh.LoadFrom(stream);
                 return sMesh;
             }
         case UnityClassID.SphereCollider:
             {
                 SphereCollider sphereCol = new SphereCollider(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, sphereCol, comp);
                 sphereCol.LoadFrom(stream);
                 return sphereCol;
             }
         case UnityClassID.Sprite:
             {
                 Sprite sprite = new Sprite(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, sprite, comp);
                 sprite.LoadFrom(stream);
                 return sprite;
             }
         case UnityClassID.SpriteRenderer:
             {
                 SpriteRenderer spriteRenderer = new SpriteRenderer(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, spriteRenderer, comp);
                 spriteRenderer.LoadFrom(stream);
                 return spriteRenderer;
             }
         case UnityClassID.TextAsset:
             {
                 if (loadingReferencials)
                 {
                     return comp;
                 }
                 TextAsset ta = new TextAsset(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, ta, comp);
                 ta.LoadFrom(stream);
                 return ta;
             }
         case UnityClassID.Texture2D:
             {
                 if (loadingReferencials)
                 {
                     return comp;
                 }
                 Texture2D tex = new Texture2D(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, tex, comp);
                 tex.LoadFrom(stream);
                 Parser.Textures.Add(tex);
                 return tex;
             }
         case UnityClassID.Transform:
             {
                 Transform trans = new Transform(this, comp.pathID, comp.classID1, comp.classID2);
                 ReplaceSubfile(index, trans, comp);
                 trans.LoadFrom(stream);
                 return trans;
             }
         }
     }
     catch
     {
         Report.ReportLog("Failed to load " + comp.classID1 + "/" + comp.classID2 + " PathID=" + comp.pathID);
         foreach (NotLoaded notLoaded in RemovedList)
         {
             if (notLoaded == comp)
             {
                 RemovedList.Remove(notLoaded);
                 Components.RemoveAt(index);
                 notLoaded.replacement = null;
                 Components.Insert(index, notLoaded);
                 break;
             }
         }
     }
     return null;
 }
Exemplo n.º 3
0
        public MonoBehaviour Clone(AssetCabinet file)
        {
            AssetCabinet.TypeDefinition srcDef = this.file.Types.Find
            (
                delegate(AssetCabinet.TypeDefinition def)
                {
                    return def.typeId == (int)this.classID1;
                }
            );
            int destId = 0, minId = 0;
            AssetCabinet.TypeDefinition destDef = null;
            for (int i = 0; i < file.Types.Count; i++)
            {
                if (AssetCabinet.CompareTypes(srcDef, file.Types[i]))
                {
                    destDef = file.Types[i];
                    destId = destDef.typeId;
                    break;
                }
                if (file.Types[i].typeId < minId)
                {
                    minId = file.Types[i].typeId;
                }
            }
            if (destId == 0)
            {
                destDef = srcDef.Clone();
                destId = destDef.typeId = minId - 1;
                file.Types.Add(destDef);
            }

            MonoBehaviour dest = new MonoBehaviour(file, (UnityClassID)destId);
            dest.Parser = new TypeParser(file, destDef);
            AssetCabinet.IncompleteClones.Add(new Tuple<Component, Component>(this, dest));
            return dest;
        }
Exemplo n.º 4
0
 public static MonoBehaviour Import(string filePath, AssetCabinet file)
 {
     foreach (var typeDef in file.Types)
     {
         if (typeDef.definitions.type == UnityClassID.MonoBehaviour.ToString() &&
             typeDef.definitions.children.Length > 4)
         {
             var member = typeDef.definitions.children[4];
             if (member.type == "Param" && member.identifier == "list")
             {
                 MonoBehaviour m = new MonoBehaviour(null, 0, (UnityClassID)typeDef.typeId, UnityClassID.MonoBehaviour);
                 m.Parser = new TypeParser(file, typeDef);
                 m.m_Name = Path.GetFileNameWithoutExtension(filePath);
                 Uarray ParamListArr = (Uarray)m.Parser.type.Members[4].Members[0];
                 List<Line> lines = LoadLines(filePath);
                 ParamListArr.Value = new UType[lines.Count];
                 Type genericMonoType = ParamListArr.Members[1].GetType();
                 ConstructorInfo genericMonoCtrInfo = genericMonoType.GetConstructor(new Type[] { genericMonoType });
                 for (int i = 0; i < lines.Count; i++)
                 {
                     ParamListArr.Value[i] = (UType)genericMonoCtrInfo.Invoke(new object[] { ParamListArr.Members[1] });
                     UClass GenericMonoData = (UClass)ParamListArr.Value[i];
                     Uarray vectorListArr = (Uarray)GenericMonoData.Members[0].Members[0];
                     UClass[] Strings = new UClass[lines[i].m_Words.Count];
                     vectorListArr.Value = Strings;
                     Type stringType = vectorListArr.Members[1].GetType();
                     ConstructorInfo stringCtrInfo = genericMonoType.GetConstructor(new Type[] { stringType });
                     for (int j = 0; j < lines[i].m_Words.Count; j++)
                     {
                         Strings[j] = (UClass)stringCtrInfo.Invoke(new object[] { vectorListArr.Members[1] });
                         Strings[j].SetString(lines[i].m_Words[j]);
                     }
                 }
                 return m;
             }
         }
     }
     Report.ReportLog("Warning! No definition of required type found!");
     return null;
 }
Exemplo n.º 5
0
        public void PasteAllMarked()
        {
            int components = Parser.Cabinet.Components.Count;

            try
            {
                Parser.Cabinet.BeginLoadingSkippedComponents();
                foreach (object obj in Gui.Scripting.Variables.Values)
                {
                    if (obj is Unity3dEditor && (Unity3dEditor)obj != this)
                    {
                        Unity3dEditor       editor  = (Unity3dEditor)obj;
                        HashSet <Component> remove  = new HashSet <Component>();
                        HashSet <Component> replace = new HashSet <Component>();
                        foreach (Component asset in editor.Marked)
                        {
                            Component loaded;
                            if (asset is NotLoaded)
                            {
                                loaded = editor.Parser.Cabinet.LoadComponent(asset.pathID);
                                remove.Add(asset);
                                replace.Add(loaded);
                            }
                            else
                            {
                                loaded = asset;
                            }
                            switch (asset.classID2)
                            {
                            case UnityClassID.Texture2D:
                                Texture2D tex = (Texture2D)loaded;
                                tex.Clone(Parser.Cabinet);
                                break;

                            case UnityClassID.Cubemap:
                                Cubemap cubemap = (Cubemap)loaded;
                                cubemap.Clone(Parser.Cabinet);
                                break;

                            case UnityClassID.Material:
                                Material mat = (Material)loaded;
                                mat.Clone(Parser.Cabinet);
                                break;

                            case UnityClassID.Mesh:
                                Mesh mesh = (Mesh)loaded;
                                mesh.Clone(Parser.Cabinet);
                                break;

                            case UnityClassID.Shader:
                                Shader shader = (Shader)loaded;
                                shader.Clone(Parser.Cabinet);
                                break;

                            case UnityClassID.Sprite:
                                Sprite sprite = (Sprite)loaded;
                                sprite.Clone(Parser.Cabinet);
                                break;

                            case UnityClassID.Animator:
                                Parser.Cabinet.MergeTypeDefinition(loaded.file, UnityClassID.GameObject);
                                Parser.Cabinet.MergeTypeDefinition(loaded.file, UnityClassID.Transform);
                                Animator anim = (Animator)loaded;
                                anim.m_GameObject.instance.Clone(Parser.Cabinet);
                                break;

                            case UnityClassID.GameObject:
                                Parser.Cabinet.MergeTypeDefinition(loaded.file, UnityClassID.GameObject);
                                Parser.Cabinet.MergeTypeDefinition(loaded.file, UnityClassID.Transform);
                                GameObject gameObj = (GameObject)loaded;
                                Component  clone   = gameObj.Clone(Parser.Cabinet);

                                Animator vAnim = new Animator(Parser.Cabinet, 0, 0, 0);
                                vAnim.m_Avatar     = new PPtr <Avatar>((Component)null);
                                vAnim.m_GameObject = new PPtr <GameObject>(clone);
                                if (loaded.file.Bundle.numContainerEntries(gameObj.m_Name, UnityClassID.GameObject) > 1)
                                {
                                    Report.ReportLog("Warning! Animator " + gameObj.m_Name + " has multiple entries in the AssetBundle's Container.");
                                }
                                vAnim.file.Bundle.AddComponent(vAnim.m_GameObject.instance.m_Name, clone);
                                VirtualAnimators.Add(vAnim);
                                if (loaded != asset)
                                {
                                    foreach (Animator a in editor.VirtualAnimators)
                                    {
                                        if (a.m_GameObject.asset == asset)
                                        {
                                            a.m_GameObject = new PPtr <GameObject>(loaded);
                                            break;
                                        }
                                    }
                                }
                                break;

                            case UnityClassID.Avatar:
                                Avatar avatar = (Avatar)loaded;
                                avatar.Clone(Parser.Cabinet);
                                break;

                            case UnityClassID.MonoBehaviour:
                                MonoBehaviour monoB = (MonoBehaviour)loaded;
                                monoB.Clone(Parser.Cabinet);
                                break;

                            case UnityClassID.TextAsset:
                                TextAsset text = (TextAsset)loaded;
                                text.Clone(Parser.Cabinet);
                                break;

                            case UnityClassID.AnimationClip:
                                AnimationClip clip = (AnimationClip)loaded;
                                clip.Clone(Parser.Cabinet);
                                break;
                            }
                        }

                        do
                        {
                            HashSet <Tuple <Component, Component> > loopSet = new HashSet <Tuple <Component, Component> >(AssetCabinet.IncompleteClones);
                            AssetCabinet.IncompleteClones.Clear();
                            foreach (var pair in loopSet)
                            {
                                Component  src  = pair.Item1;
                                Component  dest = pair.Item2;
                                Type       t    = src.GetType();
                                MethodInfo info = t.GetMethod("CopyTo", new Type[] { t });
                                info.Invoke(src, new object[] { dest });
                            }
                        }while (AssetCabinet.IncompleteClones.Count > 0);

                        foreach (Component asset in remove)
                        {
                            editor.Marked.Remove(asset);
                        }
                        foreach (Component asset in replace)
                        {
                            editor.Marked.Add(asset);
                        }
                    }
                }
            }
            finally
            {
                Parser.Cabinet.EndLoadingSkippedComponents();
                if (components != Parser.Cabinet.Components.Count)
                {
                    Changed = true;
                }
            }
        }
Exemplo n.º 6
0
        public void ExportMonoBehaviour(Component asset, string path)
        {
            MonoBehaviour mono = LoadWhenNeeded(asset);

            mono.Export(path);
        }
Exemplo n.º 7
0
        public string[] GetAssetNames(bool filter)
        {
            string[] assetNames = new string[Parser.Cabinet.Components.Count];
            using (BinaryReader reader = new BinaryReader(File.OpenRead(Parser.FilePath)))
            {
                Stream stream = reader.BaseStream;
                for (int i = 0; i < Parser.Cabinet.Components.Count; i++)
                {
                    NotLoaded comp = Parser.Cabinet.Components[i] as NotLoaded;
                    if (comp == null)
                    {
                        Component subfile = Parser.Cabinet.Components[i];
                        assetNames[i] = AssetCabinet.ToString(subfile);
                        continue;
                    }
                    if (comp.Name == null)
                    {
                        stream.Position = comp.offset;
                        switch (comp.classID1)
                        {
                        case UnityClassID.AssetBundle:
                        case UnityClassID.Avatar:
                        case UnityClassID.Mesh:
                            if (!filter)
                            {
                                comp.Name = reader.ReadNameA4();
                            }
                            break;

                        case UnityClassID.AudioClip:
                        case UnityClassID.AnimationClip:
                        case UnityClassID.AnimatorController:
                        case UnityClassID.AnimatorOverrideController:
                        case UnityClassID.Cubemap:
                        case UnityClassID.Material:
                        case UnityClassID.Shader:
                        case UnityClassID.Sprite:
                        case UnityClassID.TextAsset:
                        case UnityClassID.Texture2D:
                            comp.Name = reader.ReadNameA4();
                            break;

                        case UnityClassID.MonoScript:
                            comp.Name = comp.pathID + " / " + reader.ReadNameA4();
                            break;

                        case UnityClassID.Animator:
                        case UnityClassID.EllipsoidParticleEmitter:
                        case UnityClassID.Light:
                        case UnityClassID.ParticleAnimator:
                        case UnityClassID.ParticleRenderer:
                        case UnityClassID.ParticleSystem:
                        case UnityClassID.ParticleSystemRenderer:
                            comp.Name = GetNameFromGameObject(filter, stream);
                            break;

                        default:
                            if ((int)comp.classID1 <= -1 && comp.classID2 == UnityClassID.MonoBehaviour)
                            {
                                comp.Name = GetNameFromGameObject(filter, stream);
                                if (comp.Name == null)
                                {
                                    comp.Name = MonoBehaviour.LoadName(stream);
                                }
                            }
                            break;

                        case UnityClassID.AudioListener:
                        case UnityClassID.AudioSource:
                        case UnityClassID.BoxCollider:
                        case UnityClassID.Camera:
                        case UnityClassID.CapsuleCollider:
                        case UnityClassID.FlareLayer:
                        case UnityClassID.LinkToGameObject:
                        case UnityClassID.LinkToGameObject223:
                        case UnityClassID.LinkToGameObject225:
                        case UnityClassID.MeshCollider:
                        case UnityClassID.MeshFilter:
                        case UnityClassID.MeshRenderer:
                        case UnityClassID.MultiLink:
                        case UnityClassID.Projector:
                        case UnityClassID.Rigidbody:
                        case UnityClassID.SkinnedMeshRenderer:
                        case UnityClassID.SphereCollider:
                        case UnityClassID.SpriteRenderer:
                        case UnityClassID.Transform:
                            if (!filter)
                            {
                                comp.Name = GetNameFromGameObject(true, stream);
                            }
                            break;

                        case UnityClassID.GameObject:
                            if (!filter || IsVirtualAnimator(comp))
                            {
                                comp.Name = GameObject.LoadName(stream);
                            }
                            break;
                        }
                    }
                    assetNames[i] = comp.Name != null ? comp.Name : comp.pathID.ToString();
                }
            }
            return(assetNames);
        }