コード例 #1
0
ファイル: Exporter.cs プロジェクト: fireundubh/AssetStudio
        public static bool ExportRawFile(AssetPreloadData asset, string exportPath, string fileExtension = ".dat")
        {
            var exportFullName = Path.Combine(exportPath, string.Concat(asset.Text, fileExtension));

            switch (asset.Type)
            {
            case ClassIDType.MonoBehaviour:
                exportFullName = GetExportMonoBehaviourPath(asset, exportPath, fileExtension);
                break;

            case ClassIDType.MonoScript:
                exportFullName = GetExportMonoScriptPath(asset, exportPath, fileExtension);
                break;
            }

            if (ExportFileExists(exportFullName))
            {
                return(false);
            }

            var bytes = asset.InitReader().ReadBytes((int)asset.Size);

            File.WriteAllBytes(exportFullName, bytes);
            return(true);
        }
コード例 #2
0
ファイル: MonoBehaviour.cs プロジェクト: xuhom/AssetStudio
        public MonoBehaviour(AssetPreloadData preloadData, bool readSwitch)
        {
            var sourceFile = preloadData.sourceFile;
            var reader     = preloadData.InitReader();

            var m_GameObject = sourceFile.ReadPPtr();
            var m_Enabled    = reader.ReadByte();

            reader.AlignStream(4);
            var m_Script = sourceFile.ReadPPtr();
            var m_Name   = reader.ReadAlignedString();

            if (readSwitch)
            {
                if ((serializedText = preloadData.GetClassString()) == null)
                {
                    var str = "PPtr<GameObject> m_GameObject\r\n";
                    str           += "\tint m_FileID = " + m_GameObject.m_FileID + "\r\n";
                    str           += "\tint64 m_PathID = " + m_GameObject.m_PathID + "\r\n";
                    str           += "UInt8 m_Enabled = " + m_Enabled + "\r\n";
                    str           += "PPtr<MonoScript> m_Script\r\n";
                    str           += "\tint m_FileID = " + m_Script.m_FileID + "\r\n";
                    str           += "\tint64 m_PathID = " + m_Script.m_PathID + "\r\n";
                    str           += "string m_Name = \"" + m_Name + "\"\r\n";
                    serializedText = str;
                }
            }
            else
            {
                preloadData.extension = ".txt";
                preloadData.Text      = m_Name;
            }
        }
コード例 #3
0
ファイル: MonoScript.cs プロジェクト: crazycpp/AssetStudio-1
        public MonoScript(AssetPreloadData preloadData)
        {
            var sourceFile = preloadData.sourceFile;
            var reader     = preloadData.InitReader();
            var version    = sourceFile.version;

            m_Name = reader.ReadAlignedString();
            if (version[0] > 3 || (version[0] == 3 && version[1] >= 4))
            {
                var m_ExecutionOrder = reader.ReadAlignedString();
            }
            if (version[0] < 5)
            {
                var m_PropertiesHash = reader.ReadUInt32();
            }
            else
            {
                var m_PropertiesHash = reader.ReadBytes(16);
            }
            if (version[0] < 3)
            {
                var m_PathName = reader.ReadAlignedString();
            }
            m_ClassName = reader.ReadAlignedString();
            if (version[0] >= 3)
            {
                m_Namespace = reader.ReadAlignedString();
            }
            m_AssemblyName = reader.ReadAlignedString();
            if (version[0] < 2018 || (version[0] == 2018 && version[1] < 2))
            {
                var m_IsEditorScript = reader.ReadBoolean();
            }
        }
コード例 #4
0
        public AnimatorController(AssetPreloadData preloadData)
        {
            var sourceFile = preloadData.sourceFile;
            var version    = preloadData.sourceFile.version;
            var reader     = preloadData.InitReader();

            reader.Position = preloadData.Offset;

            m_Name = reader.ReadAlignedString();
            var m_ControllerSize = reader.ReadUInt32();
            var m_Controller     = new ControllerConstant(reader, version);

            int tosSize = reader.ReadInt32();
            var m_TOS   = new List <KeyValuePair <uint, string> >(tosSize);

            for (int i = 0; i < tosSize; i++)
            {
                m_TOS.Add(new KeyValuePair <uint, string>(reader.ReadUInt32(), reader.ReadAlignedString()));
            }

            int numClips = reader.ReadInt32();

            m_AnimationClips = new PPtr[numClips];
            for (int i = 0; i < numClips; i++)
            {
                m_AnimationClips[i] = sourceFile.ReadPPtr();
            }
        }
コード例 #5
0
ファイル: MeshFilter.cs プロジェクト: LYP951018/AssetStudio
        public MeshFilter(AssetPreloadData preloadData, Dictionary <string, int> sharedFileIndex, List <AssetsFile> assetsfileList)
        {
            var sourceFile = preloadData.sourceFile;
            var reader     = preloadData.InitReader();

            m_GameObject = sourceFile.ReadPPtr(sharedFileIndex, assetsfileList);
            m_Mesh       = sourceFile.ReadPPtr(sharedFileIndex, assetsfileList);
        }
コード例 #6
0
ファイル: MeshFilter.cs プロジェクト: ziqings/AssetStudio
        public MeshFilter(AssetPreloadData preloadData)
        {
            var sourceFile = preloadData.sourceFile;
            var reader     = preloadData.InitReader();

            m_GameObject = sourceFile.ReadPPtr();
            m_Mesh       = sourceFile.ReadPPtr();
        }
コード例 #7
0
ファイル: Shader.cs プロジェクト: zhangxinlei-cn/AssetStudio
        public Shader(AssetPreloadData preloadData, bool readSwitch)
        {
            var sourceFile = preloadData.sourceFile;
            var reader     = preloadData.InitReader();

            m_Name = reader.ReadAlignedString();

            if (readSwitch)
            {
                if (sourceFile.version[0] == 5 && sourceFile.version[1] >= 5 || sourceFile.version[0] > 5)//5.5.0 and up
                {
                    var str = (string)ShaderResource.ResourceManager.GetObject($"Shader{sourceFile.version[0]}{sourceFile.version[1]}");
                    if (str == null)
                    {
                        str = preloadData.ViewStruct();
                        if (str == null)
                        {
                            m_Script = Encoding.UTF8.GetBytes("Serialized Shader can't be read");
                        }
                        else
                        {
                            m_Script = Encoding.UTF8.GetBytes(str);
                        }
                    }
                    else
                    {
                        reader.Position = preloadData.Offset;
                        var sb      = new StringBuilder();
                        var members = new JavaScriptSerializer().Deserialize <List <ClassMember> >(str);
                        ClassStructHelper.ReadClassStruct(sb, members, reader);
                        m_Script = Encoding.UTF8.GetBytes(sb.ToString());
                        //m_Script = ReadSerializedShader(members, a_Stream);
                    }
                }
                else
                {
                    m_Script = reader.ReadBytes(reader.ReadInt32());
                    if (sourceFile.version[0] == 5 && sourceFile.version[1] >= 3) //5.3 - 5.4
                    {
                        reader.AlignStream(4);
                        reader.ReadAlignedString();//m_PathName
                        var decompressedSize  = reader.ReadUInt32();
                        var m_SubProgramBlob  = reader.ReadBytes(reader.ReadInt32());
                        var decompressedBytes = new byte[decompressedSize];
                        using (var decoder = new Lz4DecoderStream(new MemoryStream(m_SubProgramBlob)))
                        {
                            decoder.Read(decompressedBytes, 0, (int)decompressedSize);
                        }
                        m_Script = m_Script.Concat(decompressedBytes.ToArray()).ToArray();
                    }
                }
            }
            else
            {
                preloadData.extension = ".txt";
                preloadData.Text      = m_Name;
            }
        }
コード例 #8
0
        public MonoBehaviour(AssetPreloadData preloadData)
        {
            var sourceFile = preloadData.sourceFile;
            var reader     = preloadData.InitReader();

            m_GameObject = sourceFile.ReadPPtr();
            m_Enabled    = reader.ReadByte();
            reader.AlignStream(4);
            m_Script = sourceFile.ReadPPtr();
            m_Name   = reader.ReadAlignedString();
        }
コード例 #9
0
        public static string ViewStruct(this AssetPreloadData asset)
        {
            var reader = asset.InitReader();

            if (asset.sourceFile.ClassStructures.TryGetValue(asset.Type1, out var classStructure))
            {
                var sb = new StringBuilder();
                ReadClassStruct(sb, classStructure.members, reader);
                return(sb.ToString());
            }
            return(null);
        }
コード例 #10
0
ファイル: Exporter.cs プロジェクト: nevaend/AssetStudio
        public static bool ExportRawFile(AssetPreloadData asset, string exportPath)
        {
            var exportFullName = exportPath + asset.Text + ".dat";

            if (ExportFileExists(exportFullName))
            {
                return(false);
            }
            var bytes = asset.InitReader().ReadBytes((int)asset.Size);

            File.WriteAllBytes(exportFullName, bytes);
            return(true);
        }
コード例 #11
0
        public Animator(AssetPreloadData preloadData)
        {
            var sourceFile = preloadData.sourceFile;
            var reader     = preloadData.InitReader();

            reader.Position = preloadData.Offset;

            m_GameObject = sourceFile.ReadPPtr();
            var m_Enabled = reader.ReadByte();

            reader.AlignStream(4);
            m_Avatar     = sourceFile.ReadPPtr();
            m_Controller = sourceFile.ReadPPtr();
        }
コード例 #12
0
        public Animator(AssetPreloadData preloadData, Dictionary <string, int> sharedFileIndex, List <AssetsFile> assetsfileList)
        {
            var sourceFile = preloadData.sourceFile;
            var reader     = preloadData.InitReader();

            reader.Position = preloadData.Offset;

            m_GameObject = sourceFile.ReadPPtr(sharedFileIndex, assetsfileList);
            var m_Enabled = reader.ReadByte();

            reader.AlignStream(4);
            m_Avatar     = sourceFile.ReadPPtr(sharedFileIndex, assetsfileList);
            m_Controller = sourceFile.ReadPPtr(sharedFileIndex, assetsfileList);
        }
コード例 #13
0
        protected Object(AssetPreloadData preloadData)
        {
            this.preloadData = preloadData;
            sourceFile       = preloadData.sourceFile;
            reader           = preloadData.InitReader();
            version          = sourceFile.version;
            buildType        = sourceFile.buildType;
            platform         = sourceFile.m_TargetPlatform;

            if (platform == BuildTarget.NoTarget)
            {
                var m_ObjectHideFlags = reader.ReadUInt32();
            }
        }
コード例 #14
0
        public SpriteAtlas(AssetPreloadData preloadData)
        {
            var sourceFile = preloadData.sourceFile;
            var reader     = preloadData.InitReader();

            var m_Name = reader.ReadAlignedString();
            //vector m_PackedSprites
            var size = reader.ReadInt32();

            for (int i = 0; i < size; i++)
            {
                //PPtr<Sprite> data
                sourceFile.ReadPPtr();
            }
            //vector m_PackedSpriteNamesToIndex
            size = reader.ReadInt32();
            for (int i = 0; i < size; i++)
            {
                var data = reader.ReadAlignedString();
            }
            //map m_RenderDataMap
            size = reader.ReadInt32();
            for (int i = 0; i < size; i++)
            {
                //pair first
                guids.Add(new Guid(reader.ReadBytes(16)));
                var second = reader.ReadInt64();
                //SpriteAtlasData second
                //  PPtr<Texture2D> texture
                textures.Add(sourceFile.ReadPPtr());
                // PPtr<Texture2D> alphaTexture
                var alphaTexture = sourceFile.ReadPPtr();
                //  Rectf textureRect
                textureRects.Add(new RectangleF(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle()));
                //  Vector2f textureRectOffset
                reader.Position += 8;
                if (sourceFile.version[0] > 2017 || (sourceFile.version[0] == 2017 && sourceFile.version[1] >= 2))//2017.2 and up
                {
                    //  Vector2f atlasRectOffset
                    reader.Position += 8;
                }
                //  Vector4f uvTransform
                //  float downscaleMultiplier
                //  unsigned int settingsRaw
                reader.Position += 24;
            }
            //string m_Tag
            //bool m_IsVariant
        }
コード例 #15
0
        public MeshFilter(AssetPreloadData preloadData)
        {
            var sourceFile = preloadData.sourceFile;
            var reader     = preloadData.InitReader();

            if (sourceFile.platform == -2)
            {
                uint m_ObjectHideFlags    = reader.ReadUInt32();
                PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
                PPtr m_PrefabInternal     = sourceFile.ReadPPtr();
            }

            m_GameObject = sourceFile.ReadPPtr();
            m_Mesh       = sourceFile.ReadPPtr();
        }
コード例 #16
0
        public MeshRenderer(AssetPreloadData preloadData)
        {
            var sourceFile = preloadData.sourceFile;
            var reader     = preloadData.InitReader();

            if (sourceFile.platform == -2)
            {
                uint m_ObjectHideFlags    = reader.ReadUInt32();
                PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
                PPtr m_PrefabInternal     = sourceFile.ReadPPtr();
            }

            m_GameObject = sourceFile.ReadPPtr();

            if (sourceFile.version[0] < 5)
            {
                m_Enabled        = reader.ReadBoolean();
                m_CastShadows    = reader.ReadByte();
                m_ReceiveShadows = reader.ReadBoolean();
                m_LightmapIndex  = reader.ReadByte();
            }
            else
            {
                m_Enabled = reader.ReadBoolean();
                reader.AlignStream(4);
                m_CastShadows    = reader.ReadByte();
                m_ReceiveShadows = reader.ReadBoolean();
                reader.AlignStream(4);

                m_LightmapIndex        = reader.ReadUInt16();
                m_LightmapIndexDynamic = reader.ReadUInt16();
            }

            if (sourceFile.version[0] >= 3)
            {
                reader.Position += 16;
            }                                                          //Vector4f m_LightmapTilingOffset
            if (sourceFile.version[0] >= 5)
            {
                reader.Position += 16;
            }                                                          //Vector4f m_LightmapTilingOffsetDynamic

            m_Materials = new PPtr[reader.ReadInt32()];
            for (int m = 0; m < m_Materials.Length; m++)
            {
                m_Materials[m] = sourceFile.ReadPPtr();
            }
        }
コード例 #17
0
        public string uniqueID = "0";//this way file and folder TreeNodes will be treated as FBX scene

        public GameObject(AssetPreloadData preloadData)
        {
            if (preloadData != null)
            {
                asset = preloadData;
                var sourceFile = preloadData.sourceFile;
                var reader     = preloadData.InitReader();

                uniqueID = preloadData.uniqueID;

                if (sourceFile.platform == -2)
                {
                    uint m_ObjectHideFlags    = reader.ReadUInt32();
                    PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
                    PPtr m_PrefabInternal     = sourceFile.ReadPPtr();
                }

                int m_Component_size = reader.ReadInt32();
                for (int j = 0; j < m_Component_size; j++)
                {
                    if ((sourceFile.version[0] == 5 && sourceFile.version[1] >= 5) || sourceFile.version[0] > 5)//5.5.0 and up
                    {
                        m_Components.Add(sourceFile.ReadPPtr());
                    }
                    else
                    {
                        int first = reader.ReadInt32();
                        m_Components.Add(sourceFile.ReadPPtr());
                    }
                }

                m_Layer = reader.ReadInt32();
                m_Name  = reader.ReadAlignedString();
                if (m_Name == "")
                {
                    m_Name = "GameObject #" + uniqueID;
                }
                m_Tag      = reader.ReadUInt16();
                m_IsActive = reader.ReadBoolean();

                Text             = m_Name;
                preloadData.Text = m_Name;
                //name should be unique
                Name = uniqueID;
            }
        }
コード例 #18
0
ファイル: Transform.cs プロジェクト: LYP951018/AssetStudio
        public PPtr m_Father          = new PPtr();//can be transform or type 224 (as seen in Minions)

        public Transform(AssetPreloadData preloadData, Dictionary <string, int> sharedFileIndex, List <AssetsFile> assetsfileList)
        {
            var sourceFile = preloadData.sourceFile;
            var reader     = preloadData.InitReader();

            m_GameObject    = sourceFile.ReadPPtr(sharedFileIndex, assetsfileList);
            m_LocalRotation = new[] { reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle() };
            m_LocalPosition = new[] { reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle() };
            m_LocalScale    = new[] { reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle() };
            int m_ChildrenCount = reader.ReadInt32();

            for (int j = 0; j < m_ChildrenCount; j++)
            {
                m_Children.Add(sourceFile.ReadPPtr(sharedFileIndex, assetsfileList));
            }
            m_Father = sourceFile.ReadPPtr(sharedFileIndex, assetsfileList);
        }
コード例 #19
0
        public PPtr m_Father          = new PPtr();//can be transform or type 224 (as seen in Minions)

        public Transform(AssetPreloadData preloadData)
        {
            var sourceFile = preloadData.sourceFile;
            var reader     = preloadData.InitReader();

            m_GameObject    = sourceFile.ReadPPtr();
            m_LocalRotation = new[] { reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle() };
            m_LocalPosition = new[] { reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle() };
            m_LocalScale    = new[] { reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle() };
            int m_ChildrenCount = reader.ReadInt32();

            for (int j = 0; j < m_ChildrenCount; j++)
            {
                m_Children.Add(sourceFile.ReadPPtr());
            }
            m_Father = sourceFile.ReadPPtr();
        }
コード例 #20
0
        public TextAsset(AssetPreloadData preloadData, bool readSwitch)
        {
            var sourceFile = preloadData.sourceFile;
            var reader     = preloadData.InitReader();

            m_Name = reader.ReadAlignedString();

            if (readSwitch)
            {
                m_Script = reader.ReadBytes(reader.ReadInt32());
            }
            else
            {
                preloadData.extension = ".txt";
                preloadData.Text      = m_Name;
            }
        }
コード例 #21
0
        public MeshRenderer(AssetPreloadData preloadData)
        {
            var sourceFile = preloadData.sourceFile;
            var version    = sourceFile.version;
            var reader     = preloadData.InitReader();

            m_GameObject = sourceFile.ReadPPtr();
            if (version[0] < 5)
            {
                var m_Enabled        = reader.ReadBoolean();
                var m_CastShadows    = reader.ReadByte();
                var m_ReceiveShadows = reader.ReadBoolean();
                var m_LightmapIndex  = reader.ReadByte();
            }
            else
            {
                var m_Enabled = reader.ReadBoolean();
                reader.AlignStream(4);
                var m_CastShadows    = reader.ReadByte();
                var m_ReceiveShadows = reader.ReadBoolean();
                reader.AlignStream(4);
                if (version[0] >= 2018)//2018 and up
                {
                    var m_RenderingLayerMask = reader.ReadUInt32();
                }
                var m_LightmapIndex        = reader.ReadUInt16();
                var m_LightmapIndexDynamic = reader.ReadUInt16();
            }

            if (version[0] >= 3)
            {
                reader.Position += 16;//Vector4f m_LightmapTilingOffset
            }

            if (version[0] >= 5)
            {
                reader.Position += 16;//Vector4f m_LightmapTilingOffsetDynamic
            }

            m_Materials = new PPtr[reader.ReadInt32()];
            for (int m = 0; m < m_Materials.Length; m++)
            {
                m_Materials[m] = sourceFile.ReadPPtr();
            }
        }
コード例 #22
0
ファイル: Animation.cs プロジェクト: trackway/AssetStudio-1
        public Animation(AssetPreloadData preloadData)
        {
            var sourceFile = preloadData.sourceFile;
            var reader     = preloadData.InitReader();

            reader.Position = preloadData.Offset;

            m_GameObject = sourceFile.ReadPPtr();
            var m_Enabled = reader.ReadByte();

            reader.AlignStream(4);
            var m_Animation   = sourceFile.ReadPPtr();
            int numAnimations = reader.ReadInt32();

            m_Animations = new List <PPtr>(numAnimations);
            for (int i = 0; i < numAnimations; i++)
            {
                m_Animations.Add(sourceFile.ReadPPtr());
            }
        }
コード例 #23
0
        public AnimatorOverrideController(AssetPreloadData preloadData)
        {
            var sourceFile = preloadData.sourceFile;
            var reader     = preloadData.InitReader();

            reader.Position = preloadData.Offset;

            m_Name       = reader.ReadAlignedString();
            m_Controller = sourceFile.ReadPPtr();

            int numOverrides = reader.ReadInt32();

            m_Clips = new PPtr[numOverrides][];
            for (int i = 0; i < numOverrides; i++)
            {
                m_Clips[i]    = new PPtr[2];
                m_Clips[i][0] = sourceFile.ReadPPtr();
                m_Clips[i][1] = sourceFile.ReadPPtr();
            }
        }
コード例 #24
0
        public Animation(AssetPreloadData preloadData, Dictionary <string, int> sharedFileIndex, List <AssetsFile> assetsfileList)
        {
            var sourceFile = preloadData.sourceFile;
            var reader     = preloadData.InitReader();

            reader.Position = preloadData.Offset;

            m_GameObject = sourceFile.ReadPPtr(sharedFileIndex, assetsfileList);
            var m_Enabled = reader.ReadByte();

            reader.AlignStream(4);
            var m_Animation   = sourceFile.ReadPPtr(sharedFileIndex, assetsfileList);
            int numAnimations = reader.ReadInt32();

            m_Animations = new List <PPtr>(numAnimations);
            for (int i = 0; i < numAnimations; i++)
            {
                m_Animations.Add(sourceFile.ReadPPtr(sharedFileIndex, assetsfileList));
            }
        }
コード例 #25
0
        public AnimatorOverrideController(AssetPreloadData preloadData, Dictionary <string, int> sharedFileIndex, List <AssetsFile> assetsfileList)
        {
            var sourceFile = preloadData.sourceFile;
            var reader     = preloadData.InitReader();

            reader.Position = preloadData.Offset;

            m_Name       = reader.ReadAlignedString();
            m_Controller = sourceFile.ReadPPtr(sharedFileIndex, assetsfileList);

            int numOverrides = reader.ReadInt32();

            m_Clips = new PPtr[numOverrides][];
            for (int i = 0; i < numOverrides; i++)
            {
                m_Clips[i]    = new PPtr[2];
                m_Clips[i][0] = sourceFile.ReadPPtr(sharedFileIndex, assetsfileList);
                m_Clips[i][1] = sourceFile.ReadPPtr(sharedFileIndex, assetsfileList);
            }
        }
コード例 #26
0
        public Avatar(AssetPreloadData preloadData)
        {
            var sourceFile = preloadData.sourceFile;
            var version    = sourceFile.version;
            var reader     = preloadData.InitReader();

            reader.Position = preloadData.Offset;

            m_Name       = reader.ReadAlignedString();
            m_AvatarSize = reader.ReadUInt32();
            m_Avatar     = new AvatarConstant(reader, version);

            int numTOS = reader.ReadInt32();

            m_TOS = new List <KeyValuePair <uint, string> >(numTOS);
            for (int i = 0; i < numTOS; i++)
            {
                m_TOS.Add(new KeyValuePair <uint, string>(reader.ReadUInt32(), reader.ReadAlignedString()));
            }
        }
コード例 #27
0
        public GameObject(AssetPreloadData preloadData, Dictionary <string, int> sharedFileIndex, List <AssetsFile> assetsfileList)
        {
            if (preloadData != null)
            {
                asset = preloadData;
                var sourceFile = preloadData.sourceFile;
                var reader     = preloadData.InitReader();

                uniqueID = preloadData.uniqueID;

                int m_Component_size = reader.ReadInt32();
                m_Components = new List <PPtr>(m_Component_size);
                for (int j = 0; j < m_Component_size; j++)
                {
                    if ((sourceFile.version[0] == 5 && sourceFile.version[1] >= 5) || sourceFile.version[0] > 5)//5.5.0 and up
                    {
                        m_Components.Add(sourceFile.ReadPPtr(sharedFileIndex, assetsfileList));
                    }
                    else
                    {
                        int first = reader.ReadInt32();
                        m_Components.Add(sourceFile.ReadPPtr(sharedFileIndex, assetsfileList));
                    }
                }

                m_Layer = reader.ReadInt32();
                m_Name  = reader.ReadAlignedString();
                if (m_Name == "")
                {
                    m_Name = "GameObject #" + uniqueID;
                }
                m_Tag      = reader.ReadUInt16();
                m_IsActive = reader.ReadBoolean();

                Text = m_Name;
                preloadData.FullName = m_Name;
                //name should be unique
                Name = uniqueID;
            }
        }
コード例 #28
0
        public BuildSettings(AssetPreloadData preloadData)
        {
            var sourceFile = preloadData.sourceFile;
            var reader     = preloadData.InitReader();

            int levels = reader.ReadInt32();

            for (int l = 0; l < levels; l++)
            {
                string level = reader.ReadAlignedString();
            }

            if (sourceFile.version[0] == 5)
            {
                int preloadedPlugins = reader.ReadInt32();
                for (int l = 0; l < preloadedPlugins; l++)
                {
                    string preloadedPlugin = reader.ReadAlignedString();
                }
            }

            reader.Position += 4; //bool flags
            if (sourceFile.fileGen >= 8)
            {
                reader.Position += 4;
            }                                                      //bool flags
            if (sourceFile.fileGen >= 9)
            {
                reader.Position += 4;
            }                                                      //bool flags
            if (sourceFile.version[0] == 5 ||
                (sourceFile.version[0] == 4 && (sourceFile.version[1] >= 3 ||
                                                (sourceFile.version[1] == 2 && sourceFile.buildType[0] != "a"))))
            {
                reader.Position += 4;
            }                                                             //bool flags

            m_Version = reader.ReadAlignedString();
        }
コード例 #29
0
        public MovieTexture(AssetPreloadData preloadData, bool readSwitch)
        {
            var sourceFile = preloadData.sourceFile;
            var reader     = preloadData.InitReader();

            m_Name = reader.ReadAlignedString();
            if (readSwitch)
            {
                var m_Loop = reader.ReadBoolean();
                reader.AlignStream(4);
                //PPtr<AudioClip>
                sourceFile.ReadPPtr();
                var size = reader.ReadInt32();
                m_MovieData = reader.ReadBytes(size);
                var m_ColorSpace = reader.ReadInt32();
            }
            else
            {
                preloadData.extension = ".ogv";
                preloadData.Text      = m_Name;
            }
        }
コード例 #30
0
ファイル: MovieTexture.cs プロジェクト: LYP951018/AssetStudio
        public MovieTexture(AssetPreloadData preloadData, bool readSwitch, Dictionary <string, int> sharedFileIndex, List <AssetsFile> assetsfileList)
        {
            var sourceFile = preloadData.sourceFile;
            var reader     = preloadData.InitReader();

            m_Name = reader.ReadAlignedString();
            if (readSwitch)
            {
                var m_Loop = reader.ReadBoolean();
                reader.AlignStream(4);
                //PPtr<AudioClip>
                sourceFile.ReadPPtr(sharedFileIndex, assetsfileList);
                var size = reader.ReadInt32();
                m_MovieData = reader.ReadBytes(size);
                var m_ColorSpace = reader.ReadInt32();
            }
            else
            {
                preloadData.extension = ".ogv";
                preloadData.FullName  = m_Name;
            }
        }