Beispiel #1
0
        public GLTFScene(GLTFScene scene, GLTFRoot gltfRoot) : base(scene, gltfRoot)
        {
            if (scene == null)
            {
                return;
            }

            if (scene.Nodes != null)
            {
                Nodes = new List <NodeId>(scene.Nodes.Count);
                foreach (NodeId node in scene.Nodes)
                {
                    Nodes.Add(new NodeId(node, gltfRoot));
                }
            }
        }
Beispiel #2
0
        public static GLTFScene Deserialize(GLTFRoot root, JsonReader reader)
        {
            var scene = new GLTFScene();

            while (reader.Read() && reader.TokenType == JsonToken.PropertyName)
            {
                var curProp = reader.Value.ToString();

                switch (curProp)
                {
                case "nodes":
                    scene.Nodes = NodeId.ReadList(root, reader);
                    break;

                default:
                    scene.DefaultPropertyDeserializer(root, reader);
                    break;
                }
            }

            return(scene);
        }