// Animancer // https://kybernetik.com.au/animancer // Copyright 2018-2023 Kybernetik //
using UnityEngine;
using System.Collections.Generic;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace Animancer
{
/// A based .
///
/// Documentation: Transition Assets
///
/// When adding a to any derived classes, you can use
/// and .
///
/// If you are using s, consider using an instead of
/// referencing this asset directly in order to avoid common issues with shared events.
///
/// https://kybernetik.com.au/animancer/api/Animancer/AnimancerTransitionAssetBase
///
[HelpURL(Strings.DocsURLs.APIDocumentation + "/" + nameof(AnimancerTransitionAssetBase))]
public abstract partial class AnimancerTransitionAssetBase : ScriptableObject, ITransition, IWrapper, IAnimationClipSource
{
/************************************************************************************************************************/
/// Returns the wrapped by this .
public abstract ITransition GetTransition();
///
object IWrapper.WrappedObject => GetTransition();
/************************************************************************************************************************/
/// Can this transition create a valid ?
public virtual bool IsValid => GetTransition().IsValid();
///
public virtual float FadeDuration => GetTransition().FadeDuration;
///
public virtual object Key => GetTransition().Key;
///
public virtual FadeMode FadeMode => GetTransition().FadeMode;
///
public virtual AnimancerState CreateState() => GetTransition().CreateState();
///
public virtual void Apply(AnimancerState state)
{
GetTransition().Apply(state);
state.SetDebugName(name);
}
/************************************************************************************************************************/
/// []
/// Calls .
///
public virtual void GetAnimationClips(List clips)
=> clips.GatherFromSource(GetTransition());
/************************************************************************************************************************/
}
}
/************************************************************************************************************************/
#if UNITY_EDITOR
namespace Animancer.Editor
{
/// A custom editor for .
[CustomEditor(typeof(AnimancerTransitionAssetBase), true), CanEditMultipleObjects]
internal class AnimancerTransitionAssetBaseEditor : ScriptableObjectEditor { }
}
#endif