projectEli/Assets/NeoFPS/Core/MotionGraphs/Conditions/HeightRestrictionCondition.cs

19 lines
619 B
C#
Raw Normal View History

2022-11-07 01:28:33 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using NeoFPS.CharacterMotion.Parameters;
namespace NeoFPS.CharacterMotion.Conditions
{
[MotionGraphElement("Character/Height Restriction")]
public class HeightRestrictionCondition : MotionGraphCondition
{
[SerializeField] private float m_TargetHeight = 1f;
[SerializeField] private bool m_Blocked = false;
public override bool CheckCondition(MotionGraphConnectable connectable)
{
return controller.CheckIsHeightMultiplierRestricted(m_TargetHeight) == m_Blocked;
}
}
}