Files
ChunilENG/Assets/Scripts/InputHandler.cs

41 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using UnityEngine;
namespace CHN
{
public class InputHandler
{
public Action updateLoop;
public Dictionary<KeyCode, Action> getKeyActions;
public Dictionary<KeyCode, Action> downKeyActions;
public Dictionary<KeyCode, Action> upKeyActions;
public Dictionary<KeyCode, Dictionary<KeyCode, Action>> shortCutActions;
public InputHandler(
Dictionary<KeyCode, Action> getKeyActions = null,
Dictionary<KeyCode, Action> downKeyActions = null,
Dictionary<KeyCode, Action> upKeyActions = null,
Dictionary<KeyCode, Dictionary<KeyCode, Action>> shortCutActions = null,
Action updateLoop = null)
{
if (getKeyActions == null)
getKeyActions = new();
this.getKeyActions = getKeyActions;
if (downKeyActions == null)
downKeyActions = new();
this.downKeyActions = downKeyActions;
if(upKeyActions == null)
upKeyActions = new();
this.upKeyActions = upKeyActions;
if(shortCutActions == null)
shortCutActions = new();
this.shortCutActions = shortCutActions;
this.updateLoop=updateLoop;
}
}
}