// Animancer // https://kybernetik.com.au/animancer // Copyright 2018-2024 Kybernetik //
using UnityEngine;
namespace Animancer
{
/// https://kybernetik.com.au/animancer/api/Animancer/AnimancerEvent
partial struct AnimancerEvent
{
/// A non-generic interface for .
/// https://kybernetik.com.au/animancer/api/Animancer/IParameter
public interface IParameter
{
/************************************************************************************************************************/
/// The parameter value.
object Value { get; set; }
/************************************************************************************************************************/
}
///
/// Base class for s which assign the .
///
///
/// Inherit from
/// instead of this if is a value type to avoid repeated boxing costs.
///
/// https://kybernetik.com.au/animancer/api/Animancer/Parameter_1
public abstract class Parameter :
IParameter,
IInvokable
{
/************************************************************************************************************************/
[SerializeField]
private T _Value;
/// [] The serialized .
public virtual T Value
{
get => _Value;
set => _Value = value;
}
///
object IParameter.Value
{
get => _Value;
set => _Value = (T)value;
}
///
public virtual void Invoke()
{
CurrentParameter = _Value;
Current.InvokeBoundCallback();
}
/************************************************************************************************************************/
}
}
}