충돌, 레이캐스팅, 레이어, 카메라 기능 구현
This commit is contained in:
1 parent
2eee8e2ab2
commit
16497ffc6e
18 files changed
+1052
-135
No files matched your search
@@ -4,17 +4,32 @@ using UnityEngine;
|
||||
public class InputManager
|
||||
{
|
||||
public Action KeytAction = null;
|
||||
public Action<Define.MouseEvent> MouseAction = null;
|
||||
|
||||
bool _pressed = false;
|
||||
|
||||
public void OnUpdate()
|
||||
{
|
||||
if (Input.anyKey == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (KeytAction != null)
|
||||
if (Input.anyKey && KeytAction != null)
|
||||
{
|
||||
KeytAction.Invoke();
|
||||
}
|
||||
|
||||
if (MouseAction != null)
|
||||
{
|
||||
if (Input.GetMouseButton(0))
|
||||
{
|
||||
MouseAction.Invoke(Define.MouseEvent.Press);
|
||||
_pressed = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_pressed)
|
||||
{
|
||||
MouseAction.Invoke(Define.MouseEvent.Click);
|
||||
}
|
||||
_pressed = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user