summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Input/InputManager.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-10-15 07:24:10 +0800
committerchai <chaifix@163.com>2020-10-15 07:24:10 +0800
commite846c64d6f927879cb8a095e62d773a8d7b3c9f4 (patch)
tree7882744bbf2b6c7096ec15fb300f088c5a0807c5 /Assets/Scripts/Input/InputManager.cs
parentcd12e74241678ee3c0752484d310b202187ba24c (diff)
*ability system
Diffstat (limited to 'Assets/Scripts/Input/InputManager.cs')
-rw-r--r--Assets/Scripts/Input/InputManager.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Assets/Scripts/Input/InputManager.cs b/Assets/Scripts/Input/InputManager.cs
index c1a26327..95f63ad7 100644
--- a/Assets/Scripts/Input/InputManager.cs
+++ b/Assets/Scripts/Input/InputManager.cs
@@ -6,6 +6,7 @@ public class InputManager : Singleton<InputManager>
{
private List<Command> m_CommandRecord;
private Command m_CurrentCommand;
+ private readonly int kCommandRecords = 10;
public void Init()
{
@@ -40,8 +41,12 @@ public class InputManager : Singleton<InputManager>
float time = Time.time;
Command command = new Command(cmd, time);
Debug.Log(CommandToString(command));
+
m_CurrentCommand = command;
m_CommandRecord.Add(command);
+
+ if(m_CommandRecord.Count > 10)
+ m_CommandRecord.RemoveRange(0, m_CommandRecord.Count - 10);
}
}
@@ -64,7 +69,7 @@ public class InputManager : Singleton<InputManager>
string CommandToString(Command cmd)
{
string sign = CommandCodeToString(cmd.code);
- return sign + " " + cmd.time + "s";
+ return sign + " " + cmd.time + "s" + " " + cmd.id;
}
}