// Animancer // https://kybernetik.com.au/animancer // Copyright 2018-2023 Kybernetik // using System; using UnityEngine; namespace Animancer { /// /// https://kybernetik.com.au/animancer/api/Animancer/Float2ControllerTransitionAsset #if !UNITY_EDITOR [System.Obsolete(Validate.ProOnlyMessage)] #endif [CreateAssetMenu(menuName = Strings.MenuPrefix + "Controller Transition/Float 2", order = Strings.AssetMenuOrder + 7)] [HelpURL(Strings.DocsURLs.APIDocumentation + "/" + nameof(Float2ControllerTransitionAsset))] public class Float2ControllerTransitionAsset : AnimancerTransitionAsset { /// [Serializable] public new class UnShared : UnShared, Float2ControllerState.ITransition { } } /// /// https://kybernetik.com.au/animancer/api/Animancer/Float2ControllerTransition [Serializable] #if ! UNITY_EDITOR [System.Obsolete(Validate.ProOnlyMessage)] #endif public class Float2ControllerTransition : ControllerTransition, Float2ControllerState.ITransition, ICopyable { /************************************************************************************************************************/ [SerializeField] private string _ParameterNameX; /// [] The name that will be used to access . public ref string ParameterNameX => ref _ParameterNameX; /************************************************************************************************************************/ [SerializeField] private string _ParameterNameY; /// [] The name that will be used to access . public ref string ParameterNameY => ref _ParameterNameY; /************************************************************************************************************************/ /// Creates a new . public Float2ControllerTransition() { } /// Creates a new with the specified Animator Controller and parameters. public Float2ControllerTransition(RuntimeAnimatorController controller, string parameterNameX, string parameterNameY) { Controller = controller; _ParameterNameX = parameterNameX; _ParameterNameY = parameterNameY; } /************************************************************************************************************************/ /// public override Float2ControllerState CreateState() => State = new Float2ControllerState(Controller, _ParameterNameX, _ParameterNameY, ActionsOnStop); /************************************************************************************************************************/ /// public virtual void CopyFrom(Float2ControllerTransition copyFrom) { CopyFrom((ControllerTransition)copyFrom); if (copyFrom == null) { _ParameterNameX = default; _ParameterNameY = default; return; } _ParameterNameX = copyFrom._ParameterNameX; _ParameterNameY = copyFrom._ParameterNameY; } /************************************************************************************************************************/ #region Drawer #if UNITY_EDITOR /************************************************************************************************************************/ /// [UnityEditor.CustomPropertyDrawer(typeof(Float2ControllerTransition), true)] public class Drawer : ControllerTransition.Drawer { /************************************************************************************************************************/ /// /// Creates a new and sets the /// . /// public Drawer() : base(nameof(_ParameterNameX), nameof(_ParameterNameY)) { } /************************************************************************************************************************/ } /************************************************************************************************************************/ #endif #endregion /************************************************************************************************************************/ } }