diff --git a/Assets/Fungus/Animation/Scripts/Commands/ResetAnimTrigger.cs b/Assets/Fungus/Animation/Scripts/Commands/ResetAnimTrigger.cs index 3df2050b..9809d246 100644 --- a/Assets/Fungus/Animation/Scripts/Commands/ResetAnimTrigger.cs +++ b/Assets/Fungus/Animation/Scripts/Commands/ResetAnimTrigger.cs @@ -10,65 +10,65 @@ using System.Collections; namespace Fungus { - [CommandInfo("Animation", - "Reset Anim Trigger", - "Resets a trigger parameter on an Animator component.")] - [AddComponentMenu("")] - [ExecuteInEditMode] - public class ResetAnimTrigger : Command - { - [Tooltip("Reference to an Animator component in a game object")] - public AnimatorData _animator; + [CommandInfo("Animation", + "Reset Anim Trigger", + "Resets a trigger parameter on an Animator component.")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class ResetAnimTrigger : Command + { + [Tooltip("Reference to an Animator component in a game object")] + public AnimatorData _animator; - [Tooltip("Name of the trigger Animator parameter that will be reset")] - public StringData _parameterName; + [Tooltip("Name of the trigger Animator parameter that will be reset")] + public StringData _parameterName; - public override void OnEnter() - { - if (_animator.Value != null) - { - _animator.Value.ResetTrigger(_parameterName); - } + public override void OnEnter() + { + if (_animator.Value != null) + { + _animator.Value.ResetTrigger(_parameterName.Value); + } - Continue(); - } + Continue(); + } - public override string GetSummary() - { - if (_animator.Value == null) - { - return "Error: No animator selected"; - } + public override string GetSummary() + { + if (_animator.Value == null) + { + return "Error: No animator selected"; + } - return _animator.Value.name + " (" + _parameterName + ")"; - } + return _animator.Value.name + " (" + _parameterName.Value + ")"; + } - public override Color GetButtonColor() - { - return new Color32(170, 204, 169, 255); - } + public override Color GetButtonColor() + { + return new Color32(170, 204, 169, 255); + } - #region Backwards compatibility + #region Backwards compatibility - [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; - [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD = ""; + [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; + [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD = ""; - protected virtual void OnEnable() - { - if (animatorOLD != null) - { - _animator.Value = animatorOLD; - animatorOLD = null; - } + protected virtual void OnEnable() + { + if (animatorOLD != null) + { + _animator.Value = animatorOLD; + animatorOLD = null; + } - if (parameterNameOLD != "") - { - _parameterName.Value = parameterNameOLD; - parameterNameOLD = ""; - } - } + if (parameterNameOLD != "") + { + _parameterName.Value = parameterNameOLD; + parameterNameOLD = ""; + } + } - #endregion - } + #endregion + } } \ No newline at end of file diff --git a/Assets/Fungus/Animation/Scripts/Commands/SetAnimBool.cs b/Assets/Fungus/Animation/Scripts/Commands/SetAnimBool.cs index f86d4802..30e22f5c 100644 --- a/Assets/Fungus/Animation/Scripts/Commands/SetAnimBool.cs +++ b/Assets/Fungus/Animation/Scripts/Commands/SetAnimBool.cs @@ -10,68 +10,68 @@ using System.Collections; namespace Fungus { - [CommandInfo("Animation", - "Set Anim Bool", - "Sets a boolean parameter on an Animator component to control a Unity animation")] - [AddComponentMenu("")] - [ExecuteInEditMode] - public class SetAnimBool : Command - { - [Tooltip("Reference to an Animator component in a game object")] - public AnimatorData _animator; + [CommandInfo("Animation", + "Set Anim Bool", + "Sets a boolean parameter on an Animator component to control a Unity animation")] + [AddComponentMenu("")] + [ExecuteInEditMode] + public class SetAnimBool : Command + { + [Tooltip("Reference to an Animator component in a game object")] + public AnimatorData _animator; - [Tooltip("Name of the boolean Animator parameter that will have its value changed")] - public StringData _parameterName; + [Tooltip("Name of the boolean Animator parameter that will have its value changed")] + public StringData _parameterName; - [Tooltip("The boolean value to set the parameter to")] - public BooleanData value; + [Tooltip("The boolean value to set the parameter to")] + public BooleanData value; - public override void OnEnter() - { - if (_animator.Value != null) - { - _animator.Value.SetBool(_parameterName, value.Value); - } + public override void OnEnter() + { + if (_animator.Value != null) + { + _animator.Value.SetBool(_parameterName.Value, value.Value); + } - Continue(); - } + Continue(); + } - public override string GetSummary() - { - if (_animator.Value == null) - { - return "Error: No animator selected"; - } + public override string GetSummary() + { + if (_animator.Value == null) + { + return "Error: No animator selected"; + } - return _animator.Value.name + " (" + _parameterName + ")"; - } + return _animator.Value.name + " (" + _parameterName.Value + ")"; + } - public override Color GetButtonColor() - { - return new Color32(170, 204, 169, 255); - } + public override Color GetButtonColor() + { + return new Color32(170, 204, 169, 255); + } - #region Backwards compatibility + #region Backwards compatibility - [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; - [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD = ""; + [HideInInspector] [FormerlySerializedAs("animator")] public Animator animatorOLD; + [HideInInspector] [FormerlySerializedAs("parameterName")] public string parameterNameOLD = ""; - protected virtual void OnEnable() - { - if (animatorOLD != null) - { - _animator.Value = animatorOLD; - animatorOLD = null; - } + protected virtual void OnEnable() + { + if (animatorOLD != null) + { + _animator.Value = animatorOLD; + animatorOLD = null; + } - if (parameterNameOLD != "") - { - _parameterName.Value = parameterNameOLD; - parameterNameOLD = ""; - } - } + if (parameterNameOLD != "") + { + _parameterName.Value = parameterNameOLD; + parameterNameOLD = ""; + } + } - #endregion - } + #endregion + } } \ No newline at end of file