您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
18 行
627 B
18 行
627 B
using UnityEngine;
|
|
using UOP1.StateMachine;
|
|
using UOP1.StateMachine.ScriptableObjects;
|
|
|
|
[CreateAssetMenu(menuName = "State Machines/Conditions/Is Character Controller Grounded")]
|
|
public class IsCharacterControllerGroundedConditionSO : StateConditionSO<IsCharacterControllerGroundedCondition> { }
|
|
|
|
public class IsCharacterControllerGroundedCondition : Condition
|
|
{
|
|
private CharacterController _characterController;
|
|
|
|
public override void Awake(StateMachine stateMachine)
|
|
{
|
|
_characterController = stateMachine.GetComponent<CharacterController>();
|
|
}
|
|
|
|
protected override bool Statement() => _characterController.isGrounded;
|
|
}
|