// Animancer // https://kybernetik.com.au/animancer // Copyright 2022 Kybernetik //
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value.
using System;
namespace Animancer
{
/// https://kybernetik.com.au/animancer/api/Animancer/MixerState
partial class MixerState
{
/************************************************************************************************************************/
/// The number of parameters being managed by this state.
protected virtual int ParameterCount => 0;
/// Returns the name of a parameter being managed by this state.
/// This state doesn't manage any parameters.
protected virtual string GetParameterName(int index) => throw new NotSupportedException();
/// Returns the type of a parameter being managed by this state.
/// This state doesn't manage any parameters.
protected virtual UnityEngine.AnimatorControllerParameterType GetParameterType(int index) => throw new NotSupportedException();
/// Returns the value of a parameter being managed by this state.
/// This state doesn't manage any parameters.
protected virtual object GetParameterValue(int index) => throw new NotSupportedException();
/// Sets the value of a parameter being managed by this state.
/// This state doesn't manage any parameters.
protected virtual void SetParameterValue(int index, object value) => throw new NotSupportedException();
/************************************************************************************************************************/
#if UNITY_EDITOR
/************************************************************************************************************************/
/// [Editor-Only] Returns a for this state.
protected internal override Editor.IAnimancerNodeDrawer CreateDrawer() => new Drawer(this);
/************************************************************************************************************************/
///
public class Drawer : Editor.ParametizedAnimancerStateDrawer where T : MixerState
{
/************************************************************************************************************************/
/// Creates a new to manage the Inspector GUI for the `state`.
public Drawer(T state) : base(state) { }
/************************************************************************************************************************/
///
public override int ParameterCount => Target.ParameterCount;
///
public override string GetParameterName(int index) => Target.GetParameterName(index);
///
public override UnityEngine.AnimatorControllerParameterType GetParameterType(int index) => Target.GetParameterType(index);
///
public override object GetParameterValue(int index) => Target.GetParameterValue(index);
///
public override void SetParameterValue(int index, object value) => Target.SetParameterValue(index, value);
/************************************************************************************************************************/
}
/************************************************************************************************************************/
#endif
/************************************************************************************************************************/
}
}