-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathInputManager.cs
More file actions
32 lines (24 loc) · 858 Bytes
/
InputManager.cs
File metadata and controls
32 lines (24 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class InputManager : MonoBehaviour
{
public float InputV { get; private set; }
public float InputH { get; private set; }
public bool Fire { get; private set; }
public bool Equip1 { get; private set; }
public bool Equip2 { get; private set; }
public bool Equip3 { get; private set; }
public bool Inventory { get; private set; }
// Update is called once per frame
void Update()
{
InputV = Input.GetAxisRaw("Vertical");
InputH = Input.GetAxisRaw("Horizontal");
Fire = Input.GetMouseButton(0);
Equip1 = Input.GetKeyDown(KeyCode.Alpha1);
Equip2 = Input.GetKeyDown(KeyCode.Alpha2);
Equip3 = Input.GetKeyDown(KeyCode.Alpha3);
Inventory = Input.GetKeyDown(KeyCode.I);
}
}