arthurdiniz0_outer-math/OuterMath Unity Project/Assets/PlayMaker/Actions/Animator/SetAnimatorLayersAffectMassCenter.cs
// (c) Copyright HutongGames, LLC 2010-2020. All rights reserved.

using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
	[ActionCategory(ActionCategory.Animator)]
	[Tooltip("If true, additional layers affects the mass center")]
	public class SetAnimatorLayersAffectMassCenter: ComponentAction<Animator>
    {
		[RequiredField]
		[CheckForComponent(typeof(Animator))]
        [Tooltip("The GameObject with an Animator Component.")]
        public FsmOwnerDefault gameObject;
		
		[Tooltip("If true, additional layers affects the mass center")]
		public FsmBool affectMassCenter;
        
		
		public override void Reset()
		{
			gameObject = null;
			affectMassCenter= null;
		}
		
		public override void OnEnter()
		{
            if (UpdateCache(Fsm.GetOwnerDefaultTarget(gameObject)))
            {
                cachedComponent.layersAffectMassCenter = affectMassCenter.Value;
            }

            Finish();
        }
	}
}