コード例 #1
0
        public static AnimationChannel Deserialize(GLTFRoot root, JsonReader reader, Animation anim)
        {
            var animationChannel = new AnimationChannel();

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

                switch (curProp)
                {
                case "sampler":
                    animationChannel.Sampler = AnimationSamplerId.Deserialize(root, anim, reader);
                    break;

                case "target":
                    animationChannel.Target = AnimationChannelTarget.Deserialize(root, reader);
                    break;

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

            return(animationChannel);
        }
コード例 #2
0
        public AnimationChannel(AnimationChannel animationChannel, GLTFRoot root) : base(animationChannel)
        {
            if (animationChannel == null)
            {
                return;
            }

            Sampler = new AnimationSamplerId(animationChannel.Sampler, root);
            Target  = new AnimationChannelTarget(animationChannel.Target, root);
        }
コード例 #3
0
ファイル: GLTFId.cs プロジェクト: prefrontalcortex/UnityGLTF
 public AnimationSamplerId(AnimationSamplerId sampler, GLTFRoot root)
 {
     Id            = sampler.Id;
     GLTFAnimation = sampler.GLTFAnimation;
     Root          = root;
 }