// Animancer // https://kybernetik.com.au/animancer // Copyright 2018-2024 Kybernetik // #if UNITY_EDITOR using UnityEngine; namespace Animancer.Editor.Previews { /// [Editor-Only] /// An which isn't actually a . /// /// https://kybernetik.com.au/animancer/api/Animancer.Editor.Previews/DummyAnimancerComponent public class DummyAnimancerComponent : IAnimancerComponent { /************************************************************************************************************************/ /// Creates a new . public DummyAnimancerComponent(Animator animator, AnimancerGraph playable) { Animator = animator; Graph = playable; InitialUpdateMode = animator.updateMode; } /************************************************************************************************************************/ /// public bool enabled => true; /// public GameObject gameObject => Animator.gameObject; /// public Animator Animator { get; set; } /// public AnimancerGraph Graph { get; private set; } /// public bool IsGraphInitialized => true; /// public bool ResetOnDisable => false; /// public AnimatorUpdateMode UpdateMode { get => Animator.updateMode; set => Animator.updateMode = value; } /************************************************************************************************************************/ /// public object GetKey(AnimationClip clip) => clip; /************************************************************************************************************************/ /// public string AnimatorFieldName => null; /// public string ActionOnDisableFieldName => null; /// public AnimatorUpdateMode? InitialUpdateMode { get; private set; } /************************************************************************************************************************/ /// Describes this and the . public override string ToString() => $"{nameof(DummyAnimancerComponent)}({(Animator != null ? Animator.name : "Destroyed")})"; /************************************************************************************************************************/ } } #endif