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