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