diff options
Diffstat (limited to 'Assets/Scripts/Input/InputManager.cs')
-rw-r--r-- | Assets/Scripts/Input/InputManager.cs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Assets/Scripts/Input/InputManager.cs b/Assets/Scripts/Input/InputManager.cs index 95f63ad7..25daf848 100644 --- a/Assets/Scripts/Input/InputManager.cs +++ b/Assets/Scripts/Input/InputManager.cs @@ -5,9 +5,18 @@ using UnityEngine; public class InputManager : Singleton<InputManager>
{
private List<Command> m_CommandRecord;
- private Command m_CurrentCommand;
private readonly int kCommandRecords = 10;
+ // 本帧内的指令,会在下一帧被清空
+ private Command m_CurrentCommand;
+ public Command CurrentCommand
+ {
+ get
+ {
+ return m_CurrentCommand;
+ }
+ }
+
public void Init()
{
m_CommandRecord = new List<Command>();
@@ -48,6 +57,10 @@ public class InputManager : Singleton<InputManager> if(m_CommandRecord.Count > 10)
m_CommandRecord.RemoveRange(0, m_CommandRecord.Count - 10);
}
+ else if(m_CurrentCommand.code != CommandCode.Blank)
+ {
+ m_CurrentCommand = Command.Blank;
+ }
}
string CommandCodeToString(CommandCode cmd)
|