From bdf47cf0fd36a5c858575a805cca70ab623868eb Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 29 Oct 2020 19:39:42 +0800 Subject: *misc --- .../Scripts/Avatar/Conditions/ConditionCommand.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Assets/Scripts/Avatar/Conditions/ConditionCommand.cs (limited to 'Assets/Scripts/Avatar/Conditions/ConditionCommand.cs') diff --git a/Assets/Scripts/Avatar/Conditions/ConditionCommand.cs b/Assets/Scripts/Avatar/Conditions/ConditionCommand.cs new file mode 100644 index 00000000..d735ef5b --- /dev/null +++ b/Assets/Scripts/Avatar/Conditions/ConditionCommand.cs @@ -0,0 +1,22 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +/// +/// 按下某个command +/// +public class ConditionCommand : ConditionBase +{ + GamepadButton m_TargetCommand; + + public ConditionCommand(GamepadButton command) + { + m_TargetCommand = command; + } + + public override bool Evaluate() + { + return InputManager.Instance.CurrentCommand.code == m_TargetCommand; + } + +} -- cgit v1.1-26-g67d0