// SPDX-FileCopyrightText: 2023 Unity Technologies and the glTFast authors // SPDX-License-Identifier: Apache-2.0 #if UNITY_ANIMATION using System; using System.Collections.Generic; #endif namespace GLTFast.Schema { #if UNITY_ANIMATION /// [Serializable] public class Animation : AnimationBase { } /// /// Animation channel type /// Animation sampler type [Serializable] public abstract class AnimationBase : AnimationBase where TChannel : AnimationChannelBase where TSampler : AnimationSampler { public TChannel[] channels; public TSampler[] samplers; public override IReadOnlyList Channels => channels; public override IReadOnlyList Samplers => samplers; } /// /// A keyframe animation. /// /// [Serializable] public abstract class AnimationBase : NamedObject { /// /// An array of channels, each of which targets an animation's sampler at a /// node's property. Different channels of the same animation can't have equal /// targets. /// public abstract IReadOnlyList Channels { get; } /// /// An array of samplers that combines input and output accessors with an /// interpolation algorithm to define a keyframe graph (but not its target). /// public abstract IReadOnlyList Samplers { get; } internal void GltfSerialize(JsonWriter writer) { writer.AddObject(); GltfSerializeName(writer); writer.Close(); throw new NotImplementedException($"GltfSerialize missing on {GetType()}"); } } #else // Empty placeholder classes used in generic type definitions /// public class Animation : AnimationBase { } /// /// A keyframe animation. /// /// public abstract class AnimationBase { } #endif // UNITY_ANIMATION }