31 lines
820 B
C#
31 lines
820 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
|
|
public class ArrowKeysInput : IPlayerInput //ÑÄÅËÀÒÜ ÌÎÍÎÁÅÕ È Ñ×ÈÒÛÂÀÒÜ ÈÍÏÓÒ ÏÎÑÒÎßÍÍÎ Â ÀÏÄÅÉÒ, ÑÄÅËÀÒÜ ÃÅÒÈÍÏÓÒ?
|
|
{
|
|
public bool IsShooting()
|
|
{
|
|
if (Input.GetKeyDown(KeyCode.F))
|
|
return true;
|
|
return false;
|
|
}
|
|
EInputDirection? IPlayerInput.ScanDirection()
|
|
{
|
|
if (Input.GetKeyDown(KeyCode.UpArrow))
|
|
return EInputDirection.UP;
|
|
else if (Input.GetKeyDown(KeyCode.DownArrow))
|
|
return EInputDirection.DOWN;
|
|
else if (Input.GetKeyDown(KeyCode.RightArrow))
|
|
return EInputDirection.RIGHT;
|
|
else if (Input.GetKeyDown(KeyCode.LeftArrow))
|
|
return EInputDirection.LEFT;
|
|
else
|
|
return null;
|
|
}
|
|
|
|
|
|
}
|