You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
87 lines
4.1 KiB
87 lines
4.1 KiB
// Animancer // https://kybernetik.com.au/animancer // Copyright 2021 Kybernetik // |
|
|
|
using System; |
|
using UnityEngine; |
|
|
|
namespace Animancer |
|
{ |
|
/// <inheritdoc/> |
|
/// https://kybernetik.com.au/animancer/api/Animancer/Float2ControllerTransitionAsset |
|
[CreateAssetMenu(menuName = Strings.MenuPrefix + "Controller Transition/Float 2", order = Strings.AssetMenuOrder + 7)] |
|
[HelpURL(Strings.DocsURLs.APIDocumentation + "/" + nameof(Float2ControllerTransitionAsset))] |
|
public class Float2ControllerTransitionAsset : AnimancerTransitionAsset<Float2ControllerTransition> |
|
{ |
|
/// <inheritdoc/> |
|
[Serializable] |
|
public class UnShared : |
|
AnimancerTransitionAsset.UnShared<Float2ControllerTransitionAsset, Float2ControllerTransition, Float2ControllerState>, |
|
Float2ControllerState.ITransition |
|
{ } |
|
} |
|
|
|
/// <inheritdoc/> |
|
/// https://kybernetik.com.au/animancer/api/Animancer/Float2ControllerTransition |
|
[Serializable] |
|
public class Float2ControllerTransition : ControllerTransition<Float2ControllerState>, Float2ControllerState.ITransition |
|
{ |
|
/************************************************************************************************************************/ |
|
|
|
[SerializeField] |
|
private string _ParameterNameX; |
|
|
|
/// <summary>[<see cref="SerializeField"/>] The name that will be used to access <see cref="ParameterX"/>.</summary> |
|
public ref string ParameterNameX => ref _ParameterNameX; |
|
|
|
/************************************************************************************************************************/ |
|
|
|
[SerializeField] |
|
private string _ParameterNameY; |
|
|
|
/// <summary>[<see cref="SerializeField"/>] The name that will be used to access <see cref="ParameterY"/>.</summary> |
|
public ref string ParameterNameY => ref _ParameterNameY; |
|
|
|
/************************************************************************************************************************/ |
|
|
|
/// <summary>Creates a new <see cref="Float2ControllerTransition"/>.</summary> |
|
public Float2ControllerTransition() { } |
|
|
|
/// <summary>Creates a new <see cref="Float2ControllerTransition"/> with the specified Animator Controller and parameters.</summary> |
|
public Float2ControllerTransition(RuntimeAnimatorController controller, string parameterNameX, string parameterNameY) |
|
{ |
|
Controller = controller; |
|
_ParameterNameX = parameterNameX; |
|
_ParameterNameY = parameterNameY; |
|
} |
|
|
|
/************************************************************************************************************************/ |
|
|
|
/// <inheritdoc/> |
|
public override Float2ControllerState CreateState() |
|
=> State = new Float2ControllerState(Controller, _ParameterNameX, _ParameterNameY, KeepStateOnStop); |
|
|
|
/************************************************************************************************************************/ |
|
#region Drawer |
|
#if UNITY_EDITOR |
|
/************************************************************************************************************************/ |
|
|
|
/// <inheritdoc/> |
|
[UnityEditor.CustomPropertyDrawer(typeof(Float2ControllerTransition), true)] |
|
public class Drawer : ControllerTransition.Drawer |
|
{ |
|
/************************************************************************************************************************/ |
|
|
|
/// <summary> |
|
/// Creates a new <see cref="Drawer"/> and sets the |
|
/// <see cref="ControllerTransition.Drawer.Parameters"/>. |
|
/// </summary> |
|
public Drawer() : base(nameof(_ParameterNameX), nameof(_ParameterNameY)) { } |
|
|
|
/************************************************************************************************************************/ |
|
} |
|
|
|
/************************************************************************************************************************/ |
|
#endif |
|
#endregion |
|
/************************************************************************************************************************/ |
|
} |
|
}
|
|
|