您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
31 行
649 B
31 行
649 B
using UnityEngine;
|
|
using UOP1.StateMachine;
|
|
using UOP1.StateMachine.ScriptableObjects;
|
|
|
|
[CreateAssetMenu(menuName = "State Machines/Conditions/Is NPC In Dialogue")]
|
|
public class IsNPCInDialogueSO : StateConditionSO<IsNPCDialogueCondition> { }
|
|
|
|
public class IsNPCDialogueCondition : Condition
|
|
{
|
|
//Component references
|
|
private StepController _stepControllerScript;
|
|
|
|
public override void Awake(StateMachine stateMachine)
|
|
{
|
|
_stepControllerScript = stateMachine.GetComponent<StepController>();
|
|
}
|
|
|
|
protected override bool Statement()
|
|
{
|
|
|
|
if (_stepControllerScript.isInDialogue)
|
|
{
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
}
|