コード例 #1
0
        void ReadImageProperties()
        {
            //Find the embedded game object with the data
            EmbeddedGameObjectTableHead result = null;

            foreach (var r in gameObjectEmbeds)
            {
                if (r.type == classname)
                {
                    result = r;
                }
            }

            //Crash if not correct
            if (result == null)
            {
                throw new Exception("Could not find image property data.");
            }

            //Go to
            stream.position = result.dataLocation;

            //Read
            properties = UProperty.ReadProperties(stream, this, null, false);
        }
コード例 #2
0
        void ReadDefaultProperties()
        {
            //Find the embedded game object with the data
            EmbeddedGameObjectTableHead result = FindEmbeddedObjectByType($"Default__{classname}_C");

            //Go to
            stream.position = result.dataLocation;

            //Read
            properties = UProperty.ReadProperties(stream, this, null, false);
        }
コード例 #3
0
        void ReadMetadataProperties()
        {
            //Find the embedded game object with the data
            EmbeddedGameObjectTableHead result = FindEmbeddedObjectByType($"{classname}");

            //Go to
            stream.position = result.dataLocation;

            //Read
            metadata = UProperty.ReadProperties(stream, this, null, false);
            var reader = new PropertyReader(metadata);

            //Get parent class

            if (reader.HasProperty("ParentClass"))
            {
                ObjectProperty parent     = reader.GetProperty <ObjectProperty>("ParentClass");
                var            parentFile = parent.GetReferencedFile();
                if (parentFile != null)
                {
                    //The parent is an object we can read
                    parentClassname  = parentFile.classname;
                    parentPath       = parentFile.pathname;
                    hasParentUObject = true;
                }
                else
                {
                    //The parent is not a uobject
                    hasParentUObject = false;
                }
            }
            else
            {
                hasParentUObject = false;
            }
        }