// Designed by KINEMATION, 2025. using KINEMATION.KAnimationCore.Runtime.Attributes; using KINEMATION.KAnimationCore.Runtime.Rig; using System.Collections.Generic; using UnityEngine; namespace KINEMATION.MagicBlend.Runtime { public enum MagicBlendOutType { DoNotBlendOut, AutoBlendOut, AutoBlendOutToPreviousAsset } public class MagicBlendAsset : ScriptableObject, IRigProvider { [Header("Rig")] public KRig rigAsset; [Header("Blending")] [Min(0f)] public float blendTime = 0.15f; public AnimationCurve blendCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f); [Header("Poses")] public AnimationClip basePose; public AnimationClip overlayPose; public List overrideOverlays = new List(); [Min(0f)] public float overlaySpeed = 1f; [Tooltip("If Overlay is static or not.")] public bool isAnimation = false; public MagicBlendOutType blendOutType = MagicBlendOutType.DoNotBlendOut; [Unfold] public List layeredBlends = new List(); [Range(0f, 1f)] public float globalWeight = 1f; public KRig GetRigAsset() { return rigAsset; } public bool HasOverrides() { if (overrideOverlays.Count == 0) return false; foreach (var overlay in overrideOverlays) if (overlay.overlay == null) return false; return true; } public KRigElement[] GetHierarchy() { return rigAsset == null ? null : rigAsset.GetHierarchy(); } } }